13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.DropForeignKey(
18 name:
"FK_ChatBots_Instances_InstanceId",
21 migrationBuilder.DropIndex(
22 name:
"IX_ChatChannels_ChatSettingsId_IrcChannel",
23 table:
"ChatChannels");
25 migrationBuilder.DropIndex(
26 name:
"IX_ChatBots_InstanceId",
29 migrationBuilder.DropIndex(
30 name:
"IX_ChatBots_Name",
33 migrationBuilder.AlterColumn<
string>(
34 name:
"SystemIdentifier",
37 oldClrType: typeof(
string),
40 migrationBuilder.AlterColumn<
string>(
41 name:
"PullRequestRevision",
45 oldClrType: typeof(
string));
47 migrationBuilder.AlterColumn<
string>(
49 table:
"ChatChannels",
52 oldClrType: typeof(
string),
55 migrationBuilder.AlterColumn<
int>(
59 oldClrType: typeof(
int),
62 migrationBuilder.AlterColumn<
string>(
67 oldClrType: typeof(
string));
69 migrationBuilder.CreateIndex(
70 name:
"IX_Users_SystemIdentifier",
72 column:
"SystemIdentifier",
75 migrationBuilder.CreateIndex(
76 name:
"IX_ChatBots_InstanceId_Name",
78 columns:
new[] {
"InstanceId",
"Name" },
81 migrationBuilder.CreateIndex(
82 name:
"IX_ChatChannels_ChatSettingsId_IrcChannel",
83 table:
"ChatChannels",
84 columns:
new[] {
"ChatSettingsId",
"IrcChannel" },
86 filter:
"[IrcChannel] IS NOT NULL");
88 migrationBuilder.AddForeignKey(
89 name:
"FK_ChatBots_Instances_InstanceId",
92 principalTable:
"Instances",
93 principalColumn:
"Id",
94 onDelete: ReferentialAction.Cascade);
98 protected override void Down(MigrationBuilder migrationBuilder)
100 ArgumentNullException.ThrowIfNull(migrationBuilder);
102 migrationBuilder.DropForeignKey(
103 name:
"FK_ChatBots_Instances_InstanceId",
106 migrationBuilder.DropIndex(
107 name:
"IX_ChatChannels_ChatSettingsId_IrcChannel",
108 table:
"ChatChannels");
110 migrationBuilder.DropIndex(
111 name:
"IX_Users_SystemIdentifier",
114 migrationBuilder.DropIndex(
115 name:
"IX_ChatBots_InstanceId_Name",
118 migrationBuilder.AlterColumn<
string>(
119 name:
"SystemIdentifier",
122 oldClrType: typeof(
string),
125 migrationBuilder.AlterColumn<
string>(
126 name:
"PullRequestRevision",
129 oldClrType: typeof(
string),
132 migrationBuilder.AlterColumn<
string>(
134 table:
"ChatChannels",
136 oldClrType: typeof(
string),
140 migrationBuilder.AlterColumn<
int>(
144 oldClrType: typeof(
int));
146 migrationBuilder.AlterColumn<
string>(
150 oldClrType: typeof(
string),
153 migrationBuilder.CreateIndex(
154 name:
"IX_ChatBots_InstanceId",
156 column:
"InstanceId");
158 migrationBuilder.CreateIndex(
159 name:
"IX_ChatBots_Name",
164 migrationBuilder.CreateIndex(
165 name:
"IX_ChatChannels_ChatSettingsId_IrcChannel",
166 table:
"ChatChannels",
167 columns:
new[] {
"ChatSettingsId",
"IrcChannel" },
169 filter:
"[IrcChannel] IS NOT NULL");
171 migrationBuilder.AddForeignKey(
172 name:
"FK_ChatBots_Instances_InstanceId",
174 column:
"InstanceId",
175 principalTable:
"Instances",
176 principalColumn:
"Id",
177 onDelete: ReferentialAction.Cascade);