13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.DropTable(
18 name:
"WatchdogReattachInformations");
20 migrationBuilder.RenameTable(
21 name:
"ReattachInformations",
22 newName:
"ReattachInformations_up");
24 migrationBuilder.CreateTable(
25 name:
"ReattachInformations",
28 Id = table.Column<
long>(nullable:
false)
29 .Annotation(
"Sqlite:Autoincrement",
true),
30 AccessIdentifier = table.Column<
string>(nullable:
false),
31 ProcessId = table.Column<
int>(nullable:
false),
32 Port = table.Column<ushort>(nullable:
false),
33 RebootState = table.Column<
int>(nullable:
false),
34 LaunchSecurityLevel = table.Column<
int>(nullable:
false),
35 CompileJobId = table.Column<
long>(nullable:
false),
39 table.PrimaryKey(
"PK_ReattachInformations", x => x.Id);
41 name:
"FK_ReattachInformations_CompileJobs_CompileJobId",
42 column: x => x.CompileJobId,
43 principalTable:
"CompileJobs",
44 principalColumn:
"Id",
45 onDelete: ReferentialAction.Cascade);
49 $
"INSERT INTO ReattachInformations SELECT Id,AccessIdentifier,ProcessId,Port,RebootState,LaunchSecurityLevel,CompileJobId FROM ReattachInformations_up");
51 migrationBuilder.DropTable(
52 name:
"ReattachInformations_up");
54 migrationBuilder.RenameTable(
55 name:
"DreamDaemonSettings",
56 newName:
"DreamDaemonSettings_up");
58 migrationBuilder.CreateTable(
59 name:
"DreamDaemonSettings",
62 Id = table.Column<
long>(nullable:
false)
63 .Annotation(
"Sqlite:Autoincrement",
true),
64 AllowWebClient = table.Column<
bool>(nullable:
false),
65 SecurityLevel = table.Column<
int>(nullable:
false),
66 Port = table.Column<ushort>(nullable:
false),
67 StartupTimeout = table.Column<uint>(nullable:
false),
68 HeartbeatSeconds = table.Column<uint>(nullable:
false),
69 AutoStart = table.Column<
bool>(nullable:
false),
70 InstanceId = table.Column<
long>(nullable:
false),
71 TopicRequestTimeout = table.Column<uint>(nullable:
false),
75 table.PrimaryKey(
"PK_DreamDaemonSettings", x => x.Id);
77 name:
"FK_DreamDaemonSettings_Instances_InstanceId",
78 column: x => x.InstanceId,
79 principalTable:
"Instances",
80 principalColumn:
"Id",
81 onDelete: ReferentialAction.Cascade);
85 $
"INSERT INTO DreamDaemonSettings SELECT Id,AllowWebClient,SecurityLevel,PrimaryPort,AutoStart,HeartbeatSeconds,StartupTimeout,InstanceId,TopicRequestTimeout FROM DreamDaemonSettings_up");
87 migrationBuilder.DropTable(
88 name:
"DreamDaemonSettings_up");
92 protected override void Down(MigrationBuilder migrationBuilder)
94 ArgumentNullException.ThrowIfNull(migrationBuilder);
96 migrationBuilder.RenameColumn(
98 table:
"DreamDaemonSettings",
99 newName:
"PrimaryPort");
101 migrationBuilder.AddColumn<ushort>(
102 name:
"SecondaryPort",
103 table:
"DreamDaemonSettings",
106 defaultValue: (ushort)0);
108 migrationBuilder.AddColumn<
bool>(
110 table:
"ReattachInformations",
113 defaultValue:
false);
115 migrationBuilder.CreateTable(
116 name:
"WatchdogReattachInformations",
117 columns: table =>
new
119 Id = table.Column<
long>(type:
"INTEGER", nullable:
false)
120 .Annotation(
"Sqlite:Autoincrement",
true),
121 AlphaId = table.Column<
long>(type:
"INTEGER", nullable:
true),
122 AlphaIsActive = table.Column<
bool>(type:
"INTEGER", nullable:
false),
123 BravoId = table.Column<
long>(type:
"INTEGER", nullable:
true),
124 InstanceId = table.Column<
long>(type:
"INTEGER", nullable:
false),
126 constraints: table =>
128 table.PrimaryKey(
"PK_WatchdogReattachInformations", x => x.Id);
130 name:
"FK_WatchdogReattachInformations_ReattachInformations_AlphaId",
131 column: x => x.AlphaId,
132 principalTable:
"ReattachInformations",
133 principalColumn:
"Id",
134 onDelete: ReferentialAction.Restrict);
136 name:
"FK_WatchdogReattachInformations_ReattachInformations_BravoId",
137 column: x => x.BravoId,
138 principalTable:
"ReattachInformations",
139 principalColumn:
"Id",
140 onDelete: ReferentialAction.Restrict);
142 name:
"FK_WatchdogReattachInformations_Instances_InstanceId",
143 column: x => x.InstanceId,
144 principalTable:
"Instances",
145 principalColumn:
"Id",
146 onDelete: ReferentialAction.Cascade);
149 migrationBuilder.CreateIndex(
150 name:
"IX_WatchdogReattachInformations_AlphaId",
151 table:
"WatchdogReattachInformations",
154 migrationBuilder.CreateIndex(
155 name:
"IX_WatchdogReattachInformations_BravoId",
156 table:
"WatchdogReattachInformations",
159 migrationBuilder.CreateIndex(
160 name:
"IX_WatchdogReattachInformations_InstanceId",
161 table:
"WatchdogReattachInformations",
162 column:
"InstanceId",