14 protected override void Up(MigrationBuilder migrationBuilder)
16 ArgumentNullException.ThrowIfNull(migrationBuilder);
18 migrationBuilder.DropTable(
19 name:
"WatchdogReattachInformations");
21 migrationBuilder.DropColumn(
23 table:
"ReattachInformations");
25 migrationBuilder.DropColumn(
26 name:
"SecondaryPort",
27 table:
"DreamDaemonSettings");
29 migrationBuilder.RenameColumn(
31 table:
"DreamDaemonSettings",
36 protected override void Down(MigrationBuilder migrationBuilder)
38 ArgumentNullException.ThrowIfNull(migrationBuilder);
40 migrationBuilder.RenameColumn(
42 table:
"DreamDaemonSettings",
43 newName:
"PrimaryPort");
45 migrationBuilder.AddColumn<
bool>(
47 table:
"ReattachInformations",
52 migrationBuilder.AddColumn<
int>(
53 name:
"SecondaryPort",
54 table:
"DreamDaemonSettings",
59 migrationBuilder.CreateTable(
60 name:
"WatchdogReattachInformations",
63 Id = table.Column<
long>(type:
"bigint", nullable:
false)
64 .Annotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
65 AlphaId = table.Column<
long>(type:
"bigint", nullable:
true),
66 AlphaIsActive = table.Column<
bool>(type:
"boolean", nullable:
false),
67 BravoId = table.Column<
long>(type:
"bigint", nullable:
true),
68 InstanceId = table.Column<
long>(type:
"bigint", nullable:
false),
72 table.PrimaryKey(
"PK_WatchdogReattachInformations", x => x.Id);
74 name:
"FK_WatchdogReattachInformations_ReattachInformations_AlphaId",
75 column: x => x.AlphaId,
76 principalTable:
"ReattachInformations",
77 principalColumn:
"Id",
78 onDelete: ReferentialAction.Restrict);
80 name:
"FK_WatchdogReattachInformations_ReattachInformations_BravoId",
81 column: x => x.BravoId,
82 principalTable:
"ReattachInformations",
83 principalColumn:
"Id",
84 onDelete: ReferentialAction.Restrict);
86 name:
"FK_WatchdogReattachInformations_Instances_InstanceId",
87 column: x => x.InstanceId,
88 principalTable:
"Instances",
89 principalColumn:
"Id",
90 onDelete: ReferentialAction.Cascade);
93 migrationBuilder.CreateIndex(
94 name:
"IX_WatchdogReattachInformations_AlphaId",
95 table:
"WatchdogReattachInformations",
98 migrationBuilder.CreateIndex(
99 name:
"IX_WatchdogReattachInformations_BravoId",
100 table:
"WatchdogReattachInformations",
103 migrationBuilder.CreateIndex(
104 name:
"IX_WatchdogReattachInformations_InstanceId",
105 table:
"WatchdogReattachInformations",
106 column:
"InstanceId",