13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.RenameTable(
18 name:
"DreamDaemonSettings",
19 newName:
"DreamDaemonSettings_up");
21 migrationBuilder.CreateTable(
22 name:
"DreamDaemonSettings",
25 Id = table.Column<
long>(nullable:
false)
26 .Annotation(
"Sqlite:Autoincrement",
true),
27 AllowWebClient = table.Column<
bool>(nullable:
false),
28 SecurityLevel = table.Column<
int>(nullable:
false),
29 PrimaryPort = table.Column<ushort>(nullable:
false),
30 SecondaryPort = table.Column<ushort>(nullable:
false),
31 StartupTimeout = table.Column<uint>(nullable:
false),
32 HeartbeatSeconds = table.Column<uint>(nullable:
false),
33 AutoStart = table.Column<
bool>(nullable:
false),
34 InstanceId = table.Column<
long>(nullable:
false),
38 table.PrimaryKey(
"PK_DreamDaemonSettings", x => x.Id);
40 name:
"FK_DreamDaemonSettings_Instances_InstanceId",
41 column: x => x.InstanceId,
42 principalTable:
"Instances",
43 principalColumn:
"Id",
44 onDelete: ReferentialAction.Cascade);
48 $
"INSERT INTO DreamDaemonSettings SELECT Id,AllowWebClient,SecurityLevel,PrimaryPort,SecondaryPort,AutoStart,HeartbeatSeconds,StartupTimeout,InstanceId FROM DreamDaemonSettings_up");
50 migrationBuilder.DropTable(
51 name:
"DreamDaemonSettings_up");
55 protected override void Down(MigrationBuilder migrationBuilder)
57 ArgumentNullException.ThrowIfNull(migrationBuilder);
59 migrationBuilder.AddColumn<
string>(
61 table:
"DreamDaemonSettings",
64 migrationBuilder.AddColumn<
int>(
66 table:
"DreamDaemonSettings",
69 migrationBuilder.AddColumn<
bool>(
71 table:
"DreamDaemonSettings",
75 migrationBuilder.AddColumn<
bool>(
77 table:
"DreamDaemonSettings",