Fixed the collection migration issue

pull/3689/head
tidusjar 4 years ago
parent 9c67607f95
commit c0fc645135

@ -8,34 +8,34 @@ namespace Ombi.Store.Migrations.OmbiMySql
{ {
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
{ {
// migrationBuilder.Sql(@"CREATE TABLE `MobileDevices` ( migrationBuilder.Sql(@"CREATE TABLE `MobileDevices` (
// `Id` int NOT NULL AUTO_INCREMENT, `Id` int NOT NULL AUTO_INCREMENT,
// `Token` longtext CHARACTER SET utf8mb4 NULL, `Token` longtext CHARACTER SET utf8mb4 NULL,
// `UserId` varchar(255) COLLATE utf8mb4_bin NOT NULL, `UserId` varchar(255) COLLATE utf8mb4_bin NOT NULL,
// `AddedAt` datetime(6) NOT NULL, `AddedAt` datetime(6) NOT NULL,
// CONSTRAINT `PK_MobileDevices` PRIMARY KEY (`Id`), CONSTRAINT `PK_MobileDevices` PRIMARY KEY (`Id`),
// CONSTRAINT `FK_MobileDevices_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE RESTRICT CONSTRAINT `FK_MobileDevices_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE RESTRICT
//);"); );");
migrationBuilder.CreateTable( //migrationBuilder.CreateTable(
name: "MobileDevices", // name: "MobileDevices",
columns: table => new // columns: table => new
{ // {
Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), // Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Token = table.Column<string>(maxLength: 256, nullable: true), // Token = table.Column<string>(maxLength: 256, nullable: true),
UserId = table.Column<string>(maxLength: 256, nullable: false), // UserId = table.Column<string>(maxLength: 255, nullable: false),
AddedAt = table.Column<DateTime>(maxLength: 256, nullable: false), // AddedAt = table.Column<DateTime>(maxLength: 256, nullable: false),
}, // },
constraints: table => // constraints: table =>
{ // {
table.PrimaryKey("PK_MobileDevices", x => x.Id); // table.PrimaryKey("PK_MobileDevices", x => x.Id);
table.ForeignKey( // table.ForeignKey(
name: "FK_MobileDevices_AspNetUsers_UserId", // name: "FK_MobileDevices_AspNetUsers_UserId",
column: x => x.UserId, // column: x => x.UserId,
principalTable: "AspNetUsers", // principalTable: "AspNetUsers",
principalColumn: "Id", // principalColumn: "Id",
onDelete: ReferentialAction.Restrict); // onDelete: ReferentialAction.Restrict);
}); // });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(

Loading…
Cancel
Save