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",
74 filter:
"[SystemIdentifier] IS NOT NULL");
76 migrationBuilder.CreateIndex(
77 name:
"IX_ChatBots_InstanceId_Name",
79 columns:
new[] {
"InstanceId",
"Name" },
82 migrationBuilder.CreateIndex(
83 name:
"IX_ChatChannels_ChatSettingsId_IrcChannel",
84 table:
"ChatChannels",
85 columns:
new[] {
"ChatSettingsId",
"IrcChannel" },
87 filter:
"[IrcChannel] IS NOT NULL");
89 migrationBuilder.AddForeignKey(
90 name:
"FK_ChatBots_Instances_InstanceId",
93 principalTable:
"Instances",
94 principalColumn:
"Id",
95 onDelete: ReferentialAction.Cascade);
99 protected override void Down(MigrationBuilder migrationBuilder)
101 ArgumentNullException.ThrowIfNull(migrationBuilder);
103 migrationBuilder.DropForeignKey(
104 name:
"FK_ChatBots_Instances_InstanceId",
107 migrationBuilder.DropIndex(
108 name:
"IX_ChatChannels_ChatSettingsId_IrcChannel",
109 table:
"ChatChannels");
111 migrationBuilder.DropIndex(
112 name:
"IX_Users_SystemIdentifier",
115 migrationBuilder.DropIndex(
116 name:
"IX_ChatBots_InstanceId_Name",
119 migrationBuilder.AlterColumn<
string>(
120 name:
"SystemIdentifier",
123 oldClrType: typeof(
string),
126 migrationBuilder.AlterColumn<
string>(
127 name:
"PullRequestRevision",
130 oldClrType: typeof(
string),
133 migrationBuilder.AlterColumn<
string>(
135 table:
"ChatChannels",
137 oldClrType: typeof(
string),
141 migrationBuilder.AlterColumn<
int>(
145 oldClrType: typeof(
int));
147 migrationBuilder.AlterColumn<
string>(
151 oldClrType: typeof(
string),
154 migrationBuilder.CreateIndex(
155 name:
"IX_ChatBots_InstanceId",
157 column:
"InstanceId");
159 migrationBuilder.CreateIndex(
160 name:
"IX_ChatBots_Name",
165 migrationBuilder.CreateIndex(
166 name:
"IX_ChatChannels_ChatSettingsId_IrcChannel",
167 table:
"ChatChannels",
168 columns:
new[] {
"ChatSettingsId",
"IrcChannel" },
170 filter:
"[IrcChannel] IS NOT NULL");
172 migrationBuilder.AddForeignKey(
173 name:
"FK_ChatBots_Instances_InstanceId",
175 column:
"InstanceId",
176 principalTable:
"Instances",
177 principalColumn:
"Id",
178 onDelete: ReferentialAction.Cascade);