mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
fixed the migration
This commit is contained in:
parent
dd03135d7c
commit
3a89483599
2 changed files with 19 additions and 25 deletions
|
@ -8,28 +8,15 @@ namespace Ombi.Store.Migrations.OmbiMySql
|
|||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MobileDevices",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Token = table.Column<string>(nullable: true),
|
||||
UserId = table.Column<string>(nullable: true),
|
||||
AddedAt = table.Column<DateTime>(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.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.CreateIndex(
|
||||
name: "IX_MobileDevices_UserId",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue