|
| 1 | +using Microsoft.EntityFrameworkCore.Infrastructure; |
| 2 | +using Microsoft.EntityFrameworkCore.Migrations; |
| 3 | + |
| 4 | +#nullable disable |
| 5 | + |
| 6 | +namespace Refresh.Database.Migrations |
| 7 | +{ |
| 8 | + /// <inheritdoc /> |
| 9 | + [DbContext(typeof(GameDatabaseContext))] |
| 10 | + [Migration("20260331143640_AddAbilityToDisallowEmailDomains")] |
| 11 | + public partial class AddAbilityToDisallowEmailDomains : Migration |
| 12 | + { |
| 13 | + /// <inheritdoc /> |
| 14 | + protected override void Up(MigrationBuilder migrationBuilder) |
| 15 | + { |
| 16 | + migrationBuilder.RenameTable(name: "DisallowedEmails", newName: "DisallowedEmailAddresses"); |
| 17 | + migrationBuilder.DropPrimaryKey(name: "PK_DisallowedEmails", table: "DisallowedEmailAddresses"); |
| 18 | + migrationBuilder.RenameColumn(name: "Email", table: "DisallowedEmailAddresses", newName: "Address"); |
| 19 | + migrationBuilder.AddPrimaryKey(name: "PK_DisallowedEmailAddresses", table: "DisallowedEmailAddresses", column: "Address"); |
| 20 | + |
| 21 | + migrationBuilder.CreateTable( |
| 22 | + name: "DisallowedEmailDomains", |
| 23 | + columns: table => new |
| 24 | + { |
| 25 | + Domain = table.Column<string>(type: "text", nullable: false) |
| 26 | + }, |
| 27 | + constraints: table => |
| 28 | + { |
| 29 | + table.PrimaryKey("PK_DisallowedEmailDomains", x => x.Domain); |
| 30 | + }); |
| 31 | + } |
| 32 | + |
| 33 | + /// <inheritdoc /> |
| 34 | + protected override void Down(MigrationBuilder migrationBuilder) |
| 35 | + { |
| 36 | + migrationBuilder.DropTable( |
| 37 | + name: "DisallowedEmailDomains"); |
| 38 | + |
| 39 | + migrationBuilder.RenameTable(name: "DisallowedEmailAddresses", newName: "DisallowedEmails"); |
| 40 | + migrationBuilder.DropPrimaryKey(name: "PK_DisallowedEmailAddresses", table: "DisallowedEmails"); |
| 41 | + migrationBuilder.RenameColumn(name: "Address", table: "DisallowedEmails", newName: "Email"); |
| 42 | + migrationBuilder.AddPrimaryKey(name: "PK_DisallowedEmails", table: "DisallowedEmails", column: "Email"); |
| 43 | + } |
| 44 | + } |
| 45 | +} |
0 commit comments