using System; using Microsoft.EntityFrameworkCore.Migrations; namespace NadekoBot.Migrations { public partial class warningcommands : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "WarningsInitialized", table: "GuildConfigs", nullable: false, defaultValue: false); migrationBuilder.CreateTable( name: "Warnings", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), DateAdded = table.Column(nullable: true), Forgiven = table.Column(nullable: false), ForgivenBy = table.Column(nullable: true), GuildId = table.Column(nullable: false), Moderator = table.Column(nullable: true), Reason = table.Column(nullable: true), UserId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Warnings", x => x.Id); }); migrationBuilder.CreateTable( name: "WarningPunishment", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Count = table.Column(nullable: false), DateAdded = table.Column(nullable: true), GuildConfigId = table.Column(nullable: true), Punishment = table.Column(nullable: false), Time = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_WarningPunishment", x => x.Id); table.ForeignKey( name: "FK_WarningPunishment_GuildConfigs_GuildConfigId", column: x => x.GuildConfigId, principalTable: "GuildConfigs", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_WarningPunishment_GuildConfigId", table: "WarningPunishment", column: "GuildConfigId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Warnings"); migrationBuilder.DropTable( name: "WarningPunishment"); migrationBuilder.DropColumn( name: "WarningsInitialized", table: "GuildConfigs"); } } }