using Microsoft.EntityFrameworkCore.Migrations; namespace NadekoBot.Migrations { public partial class protection : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AntiRaidSetting", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Action = table.Column(nullable: false), GuildConfigId = table.Column(nullable: false), Seconds = table.Column(nullable: false), UserThreshold = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_AntiRaidSetting", x => x.Id); table.ForeignKey( name: "FK_AntiRaidSetting_GuildConfigs_GuildConfigId", column: x => x.GuildConfigId, principalTable: "GuildConfigs", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "AntiSpamSetting", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Action = table.Column(nullable: false), GuildConfigId = table.Column(nullable: false), MessageThreshold = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_AntiSpamSetting", x => x.Id); table.ForeignKey( name: "FK_AntiSpamSetting_GuildConfigs_GuildConfigId", column: x => x.GuildConfigId, principalTable: "GuildConfigs", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "AntiSpamIgnore", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), AntiSpamSettingId = table.Column(nullable: true), ChannelId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_AntiSpamIgnore", x => x.Id); table.ForeignKey( name: "FK_AntiSpamIgnore_AntiSpamSetting_AntiSpamSettingId", column: x => x.AntiSpamSettingId, principalTable: "AntiSpamSetting", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_AntiRaidSetting_GuildConfigId", table: "AntiRaidSetting", column: "GuildConfigId", unique: true); migrationBuilder.CreateIndex( name: "IX_AntiSpamIgnore_AntiSpamSettingId", table: "AntiSpamIgnore", column: "AntiSpamSettingId"); migrationBuilder.CreateIndex( name: "IX_AntiSpamSetting_GuildConfigId", table: "AntiSpamSetting", column: "GuildConfigId", unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AntiRaidSetting"); migrationBuilder.DropTable( name: "AntiSpamIgnore"); migrationBuilder.DropTable( name: "AntiSpamSetting"); } } }