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(nullable: false) .Annotation("Sqlite:Autoincrement", true), AuthorId = table.Column(nullable: false), DateAdded = table.Column(nullable: true), GuildConfigId = table.Column(nullable: true), Index = table.Column(nullable: false), Name = table.Column(nullable: true), Price = table.Column(nullable: false), RoleId = table.Column(nullable: false), RoleName = table.Column(nullable: true), Type = table.Column(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(nullable: false) .Annotation("Sqlite:Autoincrement", true), DateAdded = table.Column(nullable: true), ShopEntryId = table.Column(nullable: true), Text = table.Column(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"); } } }