79 lines
3.1 KiB
C#
79 lines
3.1 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
namespace NadekoBot.Migrations
|
|||
|
{
|
|||
|
public partial class flowershop : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "ShopEntry",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(nullable: false)
|
|||
|
.Annotation("Sqlite:Autoincrement", true),
|
|||
|
AuthorId = table.Column<ulong>(nullable: false),
|
|||
|
DateAdded = table.Column<DateTime>(nullable: true),
|
|||
|
GuildConfigId = table.Column<int>(nullable: true),
|
|||
|
Index = table.Column<int>(nullable: false),
|
|||
|
Name = table.Column<string>(nullable: true),
|
|||
|
Price = table.Column<int>(nullable: false),
|
|||
|
RoleId = table.Column<ulong>(nullable: false),
|
|||
|
RoleName = table.Column<string>(nullable: true),
|
|||
|
Type = table.Column<int>(nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_ShopEntry", x => x.Id);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_ShopEntry_GuildConfigs_GuildConfigId",
|
|||
|
column: x => x.GuildConfigId,
|
|||
|
principalTable: "GuildConfigs",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Restrict);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "ShopEntryItem",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(nullable: false)
|
|||
|
.Annotation("Sqlite:Autoincrement", true),
|
|||
|
DateAdded = table.Column<DateTime>(nullable: true),
|
|||
|
ShopEntryId = table.Column<int>(nullable: true),
|
|||
|
Text = table.Column<string>(nullable: true)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_ShopEntryItem", x => x.Id);
|
|||
|
table.ForeignKey(
|
|||
|
name: "FK_ShopEntryItem_ShopEntry_ShopEntryId",
|
|||
|
column: x => x.ShopEntryId,
|
|||
|
principalTable: "ShopEntry",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Restrict);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_ShopEntry_GuildConfigId",
|
|||
|
table: "ShopEntry",
|
|||
|
column: "GuildConfigId");
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_ShopEntryItem_ShopEntryId",
|
|||
|
table: "ShopEntryItem",
|
|||
|
column: "ShopEntryId");
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "ShopEntryItem");
|
|||
|
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "ShopEntry");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|