13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.DropIndex(
18 name:
"IX_Instances_Path",
21 migrationBuilder.AddColumn<
string>(
22 name:
"SwarmIdentifer",
26 migrationBuilder.CreateIndex(
27 name:
"IX_Instances_Path_SwarmIdentifer",
29 columns:
new[] {
"Path",
"SwarmIdentifer" },
34 protected override void Down(MigrationBuilder migrationBuilder)
36 ArgumentNullException.ThrowIfNull(migrationBuilder);
38 migrationBuilder.RenameTable(
40 newName:
"Instances_down");
42 migrationBuilder.CreateTable(
46 Id = table.Column<
long>(nullable:
false)
47 .Annotation(
"Sqlite:Autoincrement",
true),
48 Name = table.Column<
string>(maxLength: 10000, nullable:
false),
49 Path = table.Column<
string>(nullable:
false),
50 Online = table.Column<
bool>(nullable:
false),
51 ConfigurationType = table.Column<
int>(nullable:
false),
52 AutoUpdateInterval = table.Column<uint>(nullable:
false),
53 ChatBotLimit = table.Column<ushort>(nullable:
false),
57 table.PrimaryKey(
"PK_Instances", x => x.Id);
60 migrationBuilder.Sql(
"INSERT INTO Instances (Id, Name, Path, Online, ConfigurationType, AutoUpdateInterval, ChatBotLimit) SELECT Id, Name, Path, Online, ConfigurationType, AutoUpdateInterval, ChatBotLimit FROM Instances_down");
62 migrationBuilder.DropTable(
63 name:
"Instances_down");
65 migrationBuilder.RenameTable(
67 newName:
"Instances_down");
69 migrationBuilder.RenameTable(
70 name:
"Instances_down",
71 newName:
"Instances");