From c0fc645135ef770ede3d1292e23b694077db4118 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Tue, 21 Jul 2020 22:32:42 +0100 Subject: [PATCH] Fixed the collection migration issue --- .../OmbiMySql/20200218230644_MobileDevices.cs | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Ombi.Store/Migrations/OmbiMySql/20200218230644_MobileDevices.cs b/src/Ombi.Store/Migrations/OmbiMySql/20200218230644_MobileDevices.cs index a18e28270..ce2c2ebd2 100644 --- a/src/Ombi.Store/Migrations/OmbiMySql/20200218230644_MobileDevices.cs +++ b/src/Ombi.Store/Migrations/OmbiMySql/20200218230644_MobileDevices.cs @@ -8,34 +8,34 @@ namespace Ombi.Store.Migrations.OmbiMySql { protected override void Up(MigrationBuilder migrationBuilder) { -// migrationBuilder.Sql(@"CREATE TABLE `MobileDevices` ( -// `Id` int NOT NULL AUTO_INCREMENT, -// `Token` longtext CHARACTER SET utf8mb4 NULL, -// `UserId` varchar(255) COLLATE utf8mb4_bin NOT NULL, -// `AddedAt` datetime(6) NOT NULL, -// CONSTRAINT `PK_MobileDevices` PRIMARY KEY (`Id`), -// CONSTRAINT `FK_MobileDevices_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE RESTRICT -//);"); + migrationBuilder.Sql(@"CREATE TABLE `MobileDevices` ( + `Id` int NOT NULL AUTO_INCREMENT, + `Token` longtext CHARACTER SET utf8mb4 NULL, + `UserId` varchar(255) COLLATE utf8mb4_bin NOT NULL, + `AddedAt` datetime(6) NOT NULL, + CONSTRAINT `PK_MobileDevices` PRIMARY KEY (`Id`), + CONSTRAINT `FK_MobileDevices_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE RESTRICT +);"); - migrationBuilder.CreateTable( - name: "MobileDevices", - columns: table => new - { - Id = table.Column(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Token = table.Column(maxLength: 256, nullable: true), - UserId = table.Column(maxLength: 256, nullable: false), - AddedAt = table.Column(maxLength: 256, nullable: false), - }, - constraints: table => - { - table.PrimaryKey("PK_MobileDevices", x => x.Id); - table.ForeignKey( - name: "FK_MobileDevices_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); + //migrationBuilder.CreateTable( + // name: "MobileDevices", + // columns: table => new + // { + // Id = table.Column(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + // Token = table.Column(maxLength: 256, nullable: true), + // UserId = table.Column(maxLength: 255, nullable: false), + // AddedAt = table.Column(maxLength: 256, nullable: false), + // }, + // constraints: table => + // { + // table.PrimaryKey("PK_MobileDevices", x => x.Id); + // table.ForeignKey( + // name: "FK_MobileDevices_AspNetUsers_UserId", + // column: x => x.UserId, + // principalTable: "AspNetUsers", + // principalColumn: "Id", + // onDelete: ReferentialAction.Restrict); + // }); migrationBuilder.CreateIndex(