| | | 1 | | using Microsoft.EntityFrameworkCore.Migrations; |
| | | 2 | | |
| | | 3 | | #nullable disable |
| | | 4 | | |
| | | 5 | | namespace ProjectTemplate.Infrastructure.Data.Migrations; |
| | | 6 | | |
| | | 7 | | /// <inheritdoc /> |
| | | 8 | | public partial class InitialCreate : Migration |
| | | 9 | | { |
| | | 10 | | /// <inheritdoc /> |
| | | 11 | | protected override void Up(MigrationBuilder migrationBuilder) |
| | | 12 | | { |
| | 2 | 13 | | migrationBuilder.CreateTable( |
| | 2 | 14 | | name: "AuditRecords", |
| | 2 | 15 | | columns: table => new |
| | 2 | 16 | | { |
| | 2 | 17 | | Id = table.Column<Guid>(type: "TEXT", nullable: false), |
| | 2 | 18 | | ModifiedBy = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false), |
| | 2 | 19 | | ModifiedOnUtc = table.Column<DateTime>(type: "TEXT", nullable: false), |
| | 2 | 20 | | Application = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false), |
| | 2 | 21 | | Entity = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false), |
| | 2 | 22 | | State = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false), |
| | 2 | 23 | | KeyValues = table.Column<string>(type: "TEXT", nullable: false), |
| | 2 | 24 | | OriginalValues = table.Column<string>(type: "TEXT", nullable: false), |
| | 2 | 25 | | CurrentValues = table.Column<string>(type: "TEXT", nullable: false) |
| | 2 | 26 | | }, |
| | 4 | 27 | | constraints: table => table.PrimaryKey("PK_AuditRecords", x => x.Id)); |
| | | 28 | | |
| | 2 | 29 | | migrationBuilder.CreateTable( |
| | 2 | 30 | | name: "ExternalLoginAccounts", |
| | 2 | 31 | | columns: table => new |
| | 2 | 32 | | { |
| | 2 | 33 | | Id = table.Column<Guid>(type: "TEXT", nullable: false), |
| | 2 | 34 | | LocalUserId = table.Column<Guid>(type: "TEXT", nullable: false), |
| | 2 | 35 | | ProviderName = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false), |
| | 2 | 36 | | ProviderUserId = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false), |
| | 2 | 37 | | DisplayName = table.Column<string>(type: "TEXT", maxLength: 200, nullable: true), |
| | 2 | 38 | | Email = table.Column<string>(type: "TEXT", maxLength: 320, nullable: true), |
| | 2 | 39 | | CreatedOnUtc = table.Column<DateTime>(type: "TEXT", nullable: false), |
| | 2 | 40 | | UpdatedOnUtc = table.Column<DateTime>(type: "TEXT", nullable: true), |
| | 2 | 41 | | LastLoginOnUtc = table.Column<DateTime>(type: "TEXT", nullable: true) |
| | 2 | 42 | | }, |
| | 4 | 43 | | constraints: table => table.PrimaryKey("PK_ExternalLoginAccounts", x => x.Id)); |
| | | 44 | | |
| | 2 | 45 | | migrationBuilder.CreateIndex( |
| | 2 | 46 | | name: "IX_ExternalLoginAccounts_Email", |
| | 2 | 47 | | table: "ExternalLoginAccounts", |
| | 2 | 48 | | column: "Email"); |
| | | 49 | | |
| | 2 | 50 | | migrationBuilder.CreateIndex( |
| | 2 | 51 | | name: "IX_ExternalLoginAccounts_LocalUserId", |
| | 2 | 52 | | table: "ExternalLoginAccounts", |
| | 2 | 53 | | column: "LocalUserId"); |
| | | 54 | | |
| | 2 | 55 | | migrationBuilder.CreateIndex( |
| | 2 | 56 | | name: "IX_ExternalLoginAccounts_ProviderName_ProviderUserId", |
| | 2 | 57 | | table: "ExternalLoginAccounts", |
| | 2 | 58 | | columns: ["ProviderName", "ProviderUserId"], |
| | 2 | 59 | | unique: true); |
| | 2 | 60 | | } |
| | | 61 | | |
| | | 62 | | /// <inheritdoc /> |
| | | 63 | | protected override void Down(MigrationBuilder migrationBuilder) |
| | | 64 | | { |
| | 2 | 65 | | migrationBuilder.DropTable( |
| | 2 | 66 | | name: "AuditRecords"); |
| | | 67 | | |
| | 2 | 68 | | migrationBuilder.DropTable( |
| | 2 | 69 | | name: "ExternalLoginAccounts"); |
| | 2 | 70 | | } |
| | | 71 | | } |