mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Use manual migration
This commit is contained in:
@ -6,25 +6,34 @@ namespace osu.Game.Migrations
|
|||||||
{
|
{
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.AddColumn<int>(
|
migrationBuilder.Sql(@"create table Settings_dg_tmp
|
||||||
name: "SkinInfoID",
|
(
|
||||||
table: "Settings",
|
ID INTEGER not null
|
||||||
nullable: true);
|
constraint PK_Settings
|
||||||
|
primary key autoincrement,
|
||||||
|
Key TEXT not null,
|
||||||
|
RulesetID INTEGER,
|
||||||
|
Value TEXT,
|
||||||
|
Variant INTEGER,
|
||||||
|
SkinInfoID int
|
||||||
|
constraint Settings_SkinInfo_ID_fk
|
||||||
|
references SkinInfo
|
||||||
|
on delete restrict
|
||||||
|
);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
insert into Settings_dg_tmp(ID, Key, RulesetID, Value, Variant) select ID, Key, RulesetID, Value, Variant from Settings;
|
||||||
name: "IX_Settings_SkinInfoID",
|
|
||||||
table: "Settings",
|
|
||||||
column: "SkinInfoID");
|
|
||||||
|
|
||||||
// unsupported by sqlite
|
drop table Settings;
|
||||||
|
|
||||||
// migrationBuilder.AddForeignKey(
|
alter table Settings_dg_tmp rename to Settings;
|
||||||
// name: "FK_Settings_SkinInfo_SkinInfoID",
|
|
||||||
// table: "Settings",
|
create index IX_Settings_RulesetID_Variant
|
||||||
// column: "SkinInfoID",
|
on Settings (RulesetID, Variant);
|
||||||
// principalTable: "SkinInfo",
|
|
||||||
// principalColumn: "ID",
|
create index Settings_SkinInfoID_index
|
||||||
// onDelete: ReferentialAction.Restrict);
|
on Settings (SkinInfoID);
|
||||||
|
|
||||||
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
Reference in New Issue
Block a user