using System; using Microsoft.EntityFrameworkCore.Migrations; namespace NadekoBot.Migrations { public partial class groupnamerecreate : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "GroupName", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), DateAdded = table.Column(nullable: true), GuildConfigId = table.Column(nullable: false), Number = table.Column(nullable: false), Name = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_GroupName", x => x.Id); table.ForeignKey( name: "FK_GroupName_GuildConfigs_GuildConfigId", column: x => x.GuildConfigId, principalTable: "GuildConfigs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_GroupName_GuildConfigId_Number", table: "GroupName", columns: new[] { "GuildConfigId", "Number" }, unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "GroupName"); } } }