using System; using Microsoft.EntityFrameworkCore.Migrations; namespace NadekoBot.Migrations { public partial class currencyplantsandpassword : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "CommandPrice"); migrationBuilder.AddColumn( name: "CurrencyGenerationPassword", table: "BotConfig", nullable: false, defaultValue: false); migrationBuilder.CreateTable( name: "PlantedCurrency", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), DateAdded = table.Column(nullable: true), Amount = table.Column(nullable: false), Password = table.Column(nullable: true), GuildId = table.Column(nullable: false), ChannelId = table.Column(nullable: false), UserId = table.Column(nullable: false), MessageId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_PlantedCurrency", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_PlantedCurrency_ChannelId", table: "PlantedCurrency", column: "ChannelId"); migrationBuilder.CreateIndex( name: "IX_PlantedCurrency_MessageId", table: "PlantedCurrency", column: "MessageId", unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PlantedCurrency"); migrationBuilder.DropColumn( name: "CurrencyGenerationPassword", table: "BotConfig"); migrationBuilder.CreateTable( name: "CommandPrice", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), BotConfigId = table.Column(nullable: true), CommandName = table.Column(nullable: true), DateAdded = table.Column(nullable: true), Price = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_CommandPrice", x => x.Id); table.ForeignKey( name: "FK_CommandPrice_BotConfig_BotConfigId", column: x => x.BotConfigId, principalTable: "BotConfig", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_CommandPrice_BotConfigId", table: "CommandPrice", column: "BotConfigId"); migrationBuilder.CreateIndex( name: "IX_CommandPrice_Price", table: "CommandPrice", column: "Price", unique: true); } } }