Fix incorrect initial migration

Also adds variant to settings
This commit is contained in:
Dean Herbert
2018-01-25 23:41:03 +09:00
parent 45e8a2b69b
commit 03154dbc63
12 changed files with 40 additions and 30 deletions

View File

@ -10,8 +10,8 @@ using System;
namespace osu.Game.Migrations
{
[DbContext(typeof(OsuDbContext))]
[Migration("20180124024000_AddSettings")]
partial class AddSettings
[Migration("20180125143340_Settings")]
partial class Settings
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
@ -202,14 +202,16 @@ namespace osu.Game.Migrations
b.Property<int>("IntKey")
.HasColumnName("Key");
b.Property<int>("IntValue")
b.Property<int?>("RulesetID");
b.Property<string>("StringValue")
.HasColumnName("Value");
b.Property<int?>("RulesetID");
b.Property<int?>("Variant");
b.HasKey("ID");
b.HasIndex("RulesetID");
b.HasIndex("RulesetID", "Variant");
b.ToTable("Settings");
});

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace osu.Game.Migrations
{
public partial class AddSettings : Migration
public partial class Settings : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
@ -19,8 +19,9 @@ namespace osu.Game.Migrations
ID = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Key = table.Column<int>(type: "INTEGER", nullable: false),
Value = table.Column<int>(type: "INTEGER", nullable: false),
RulesetID = table.Column<int>(type: "INTEGER", nullable: true)
RulesetID = table.Column<int>(type: "INTEGER", nullable: true),
Value = table.Column<string>(type: "TEXT", nullable: true),
Variant = table.Column<int>(type: "INTEGER", nullable: true)
},
constraints: table =>
{
@ -33,9 +34,9 @@ namespace osu.Game.Migrations
columns: new[] { "RulesetID", "Variant" });
migrationBuilder.CreateIndex(
name: "IX_Settings_RulesetID",
name: "IX_Settings_RulesetID_Variant",
table: "Settings",
column: "RulesetID");
columns: new[] { "RulesetID", "Variant" });
}
protected override void Down(MigrationBuilder migrationBuilder)

View File

@ -201,14 +201,16 @@ namespace osu.Game.Migrations
b.Property<int>("IntKey")
.HasColumnName("Key");
b.Property<int>("IntValue")
b.Property<int?>("RulesetID");
b.Property<string>("StringValue")
.HasColumnName("Value");
b.Property<int?>("RulesetID");
b.Property<int?>("Variant");
b.HasKey("ID");
b.HasIndex("RulesetID");
b.HasIndex("RulesetID", "Variant");
b.ToTable("Settings");
});