| | | 1 | | using Microsoft.EntityFrameworkCore.Migrations; |
| | | 2 | | |
| | | 3 | | #nullable disable |
| | | 4 | | |
| | | 5 | | namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Tenants |
| | | 6 | | { |
| | | 7 | | /// <inheritdoc /> |
| | | 8 | | public partial class V3_3 : Migration |
| | | 9 | | { |
| | | 10 | | private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema; |
| | | 11 | | |
| | | 12 | | /// <inheritdoc /> |
| | 0 | 13 | | public V3_3(Elsa.Persistence.EFCore.IElsaDbContextSchema schema) |
| | | 14 | | { |
| | 0 | 15 | | _schema = schema; |
| | 0 | 16 | | } |
| | | 17 | | |
| | | 18 | | /// <inheritdoc /> |
| | | 19 | | protected override void Up(MigrationBuilder migrationBuilder) |
| | | 20 | | { |
| | 0 | 21 | | migrationBuilder.CreateTable( |
| | 0 | 22 | | name: "Tenants", |
| | 0 | 23 | | columns: table => new |
| | 0 | 24 | | { |
| | 0 | 25 | | Id = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 26 | | Name = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 27 | | Configuration = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 28 | | TenantId = table.Column<string>(type: "TEXT", nullable: true) |
| | 0 | 29 | | }, |
| | 0 | 30 | | constraints: table => |
| | 0 | 31 | | { |
| | 0 | 32 | | table.PrimaryKey("PK_Tenants", x => x.Id); |
| | 0 | 33 | | }); |
| | | 34 | | |
| | 0 | 35 | | migrationBuilder.CreateIndex( |
| | 0 | 36 | | name: "IX_Tenant_Name", |
| | 0 | 37 | | table: "Tenants", |
| | 0 | 38 | | column: "Name"); |
| | | 39 | | |
| | 0 | 40 | | migrationBuilder.CreateIndex( |
| | 0 | 41 | | name: "IX_Tenant_TenantId", |
| | 0 | 42 | | table: "Tenants", |
| | 0 | 43 | | column: "TenantId"); |
| | 0 | 44 | | } |
| | | 45 | | |
| | | 46 | | /// <inheritdoc /> |
| | | 47 | | protected override void Down(MigrationBuilder migrationBuilder) |
| | | 48 | | { |
| | 0 | 49 | | migrationBuilder.DropTable( |
| | 0 | 50 | | name: "Tenants"); |
| | 0 | 51 | | } |
| | | 52 | | } |
| | | 53 | | } |