0
I’m creating the table AspNetUSers
while applying update-database
The following error occurs
You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right syntax to use near '(6) NULL,
LockoutEnabled
bit NOT NULL,AccessFailedCount
int NOT N' at line 14
I’m using a mysql database
And from what I understand the problem occurs on this line LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AspNetUSers",
columns: table => new
{
Id = table.Column<string>(nullable: false),
UserName = table.Column<string>(nullable: true),
NormalizedUserName = table.Column<string>(nullable: true),
Email = table.Column<string>(nullable: true),
NormalizedEmail = table.Column<string>(nullable: true),
EmailConfirmed = table.Column<bool>(nullable: false),
PasswordHash = table.Column<string>(nullable: true),
SecurityStamp = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
PhoneNumber = table.Column<string>(nullable: true),
PhoneNumberConfirmed = table.Column<bool>(nullable: false),
TwoFactorEnabled = table.Column<bool>(nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
LockoutEnabled = table.Column<bool>(nullable: false),
AccessFailedCount = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUSers", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AspNetUSers");
}
I pulled the field //LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
and ends up creating the tables.
But how do I make this field compatible with mysql
It does not correct this solution
– Amadeu Antunes
https://stackoverflow.com/questions/32103607/will-does-mysql-support-datetimeoffset
– Amadeu Antunes
So it is a specific question of the Mysql Provider, I will edit the answer with a content from the documentation of Provider Pomelo.Mysql
– Julio Borges
created in the database directly in mysql in this way Lockoutend datetime and it worked despite not knowing if later will not give future problems in something
– Amadeu Antunes
You followed the guidance I was putting in the answer, but I supplemented it to be clearer and help those who have the same question.
– Julio Borges