Skip to content
This repository was archived by the owner on Oct 16, 2022. It is now read-only.

Commit f80cb1d

Browse files
committed
Deleted all previous migrations and recreated initial
This is to help mitigate issues with outdated versions of MySQL databases not having the ability to rename columns.
1 parent 3208a75 commit f80cb1d

13 files changed

+138
-802
lines changed

ShopsUI - OpenMod/Migrations/20210307211059_InitialRelease.Designer.cs

Lines changed: 72 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ShopsUI - OpenMod/Migrations/20210307211059_InitialRelease.cs

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,90 @@ protected override void Up(MigrationBuilder migrationBuilder)
1111
name: "ShopsUI_ItemShops",
1212
columns: table => new
1313
{
14-
ItemShopId = table.Column<int>(nullable: false)
15-
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
16-
BuyPrice = table.Column<decimal>(nullable: true),
17-
SellPrice = table.Column<decimal>(nullable: true),
14+
ItemId = table.Column<ushort>(nullable: false),
15+
BuyPrice = table.Column<decimal>(type: "decimal(24,2)", nullable: true),
16+
SellPrice = table.Column<decimal>(type: "decimal(24,2)", nullable: true),
1817
Order = table.Column<int>(nullable: false)
1918
},
2019
constraints: table =>
2120
{
22-
table.PrimaryKey("PK_ShopsUI_ItemShops", x => x.ItemShopId);
21+
table.PrimaryKey("PK_ShopsUI_ItemShops", x => x.ItemId);
2322
});
2423

2524
migrationBuilder.CreateTable(
2625
name: "ShopsUI_VehicleShops",
2726
columns: table => new
2827
{
29-
VehicleShopId = table.Column<int>(nullable: false)
30-
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
31-
BuyPrice = table.Column<decimal>(nullable: false),
28+
VehicleId = table.Column<ushort>(nullable: false),
29+
BuyPrice = table.Column<decimal>(type: "decimal(24,2)", nullable: false),
3230
Order = table.Column<int>(nullable: false)
3331
},
3432
constraints: table =>
3533
{
36-
table.PrimaryKey("PK_ShopsUI_VehicleShops", x => x.VehicleShopId);
34+
table.PrimaryKey("PK_ShopsUI_VehicleShops", x => x.VehicleId);
35+
});
36+
37+
migrationBuilder.CreateTable(
38+
name: "ShopsUI_ItemGroups",
39+
columns: table => new
40+
{
41+
Id = table.Column<int>(nullable: false)
42+
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
43+
Permission = table.Column<string>(nullable: false),
44+
IsWhitelist = table.Column<bool>(nullable: false),
45+
ItemShopItemId = table.Column<ushort>(nullable: false)
46+
},
47+
constraints: table =>
48+
{
49+
table.PrimaryKey("PK_ShopsUI_ItemGroups", x => x.Id);
50+
table.ForeignKey(
51+
name: "FK_ShopsUI_ItemGroups_ShopsUI_ItemShops_ItemShopItemId",
52+
column: x => x.ItemShopItemId,
53+
principalTable: "ShopsUI_ItemShops",
54+
principalColumn: "ItemId",
55+
onDelete: ReferentialAction.Cascade);
56+
});
57+
58+
migrationBuilder.CreateTable(
59+
name: "ShopsUI_VehicleGroups",
60+
columns: table => new
61+
{
62+
Id = table.Column<int>(nullable: false)
63+
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
64+
Permission = table.Column<string>(nullable: false),
65+
IsWhitelist = table.Column<bool>(nullable: false),
66+
VehicleShopVehicleId = table.Column<ushort>(nullable: false)
67+
},
68+
constraints: table =>
69+
{
70+
table.PrimaryKey("PK_ShopsUI_VehicleGroups", x => x.Id);
71+
table.ForeignKey(
72+
name: "FK_ShopsUI_VehicleGroups_ShopsUI_VehicleShops_VehicleShopVehicl~",
73+
column: x => x.VehicleShopVehicleId,
74+
principalTable: "ShopsUI_VehicleShops",
75+
principalColumn: "VehicleId",
76+
onDelete: ReferentialAction.Cascade);
3777
});
78+
79+
migrationBuilder.CreateIndex(
80+
name: "IX_ShopsUI_ItemGroups_ItemShopItemId",
81+
table: "ShopsUI_ItemGroups",
82+
column: "ItemShopItemId");
83+
84+
migrationBuilder.CreateIndex(
85+
name: "IX_ShopsUI_VehicleGroups_VehicleShopVehicleId",
86+
table: "ShopsUI_VehicleGroups",
87+
column: "VehicleShopVehicleId");
3888
}
3989

4090
protected override void Down(MigrationBuilder migrationBuilder)
4191
{
92+
migrationBuilder.DropTable(
93+
name: "ShopsUI_ItemGroups");
94+
95+
migrationBuilder.DropTable(
96+
name: "ShopsUI_VehicleGroups");
97+
4298
migrationBuilder.DropTable(
4399
name: "ShopsUI_ItemShops");
44100

ShopsUI - OpenMod/Migrations/20210531183815_PomeloMigration.Designer.cs

Lines changed: 0 additions & 61 deletions
This file was deleted.

ShopsUI - OpenMod/Migrations/20210531183815_PomeloMigration.cs

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)