mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-04-06 09:11:49 -04:00
Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com> Co-authored-by: Joe Milazzo <josephmajora@gmail.com>
74 lines
2.9 KiB
C#
74 lines
2.9 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Kavita.Database.Migrations
|
|
{
|
|
public partial class DeviceSupport : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SeriesRelation_Series_TargetSeriesId",
|
|
table: "SeriesRelation");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Device",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
IpAddress = table.Column<string>(type: "TEXT", nullable: true),
|
|
Name = table.Column<string>(type: "TEXT", nullable: true),
|
|
EmailAddress = table.Column<string>(type: "TEXT", nullable: true),
|
|
Platform = table.Column<int>(type: "INTEGER", nullable: false),
|
|
AppUserId = table.Column<int>(type: "INTEGER", nullable: false),
|
|
LastUsed = table.Column<DateTime>(type: "TEXT", nullable: false),
|
|
Created = table.Column<DateTime>(type: "TEXT", nullable: false),
|
|
LastModified = table.Column<DateTime>(type: "TEXT", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Device", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Device_AspNetUsers_AppUserId",
|
|
column: x => x.AppUserId,
|
|
principalTable: "AspNetUsers",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Device_AppUserId",
|
|
table: "Device",
|
|
column: "AppUserId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SeriesRelation_Series_TargetSeriesId",
|
|
table: "SeriesRelation",
|
|
column: "TargetSeriesId",
|
|
principalTable: "Series",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SeriesRelation_Series_TargetSeriesId",
|
|
table: "SeriesRelation");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Device");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SeriesRelation_Series_TargetSeriesId",
|
|
table: "SeriesRelation",
|
|
column: "TargetSeriesId",
|
|
principalTable: "Series",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|