| | | 1 | | using Microsoft.EntityFrameworkCore.Migrations; |
| | | 2 | | |
| | | 3 | | #nullable disable |
| | | 4 | | |
| | | 5 | | namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Labels |
| | | 6 | | { |
| | | 7 | | /// <inheritdoc /> |
| | | 8 | | public partial class Initial : Migration |
| | | 9 | | { |
| | | 10 | | /// <inheritdoc /> |
| | | 11 | | protected override void Up(MigrationBuilder migrationBuilder) |
| | | 12 | | { |
| | 0 | 13 | | migrationBuilder.CreateTable( |
| | 0 | 14 | | name: "Labels", |
| | 0 | 15 | | columns: table => new |
| | 0 | 16 | | { |
| | 0 | 17 | | Id = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 18 | | Name = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 19 | | NormalizedName = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 20 | | Description = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 21 | | Color = table.Column<string>(type: "TEXT", nullable: true) |
| | 0 | 22 | | }, |
| | 0 | 23 | | constraints: table => |
| | 0 | 24 | | { |
| | 0 | 25 | | table.PrimaryKey("PK_Labels", x => x.Id); |
| | 0 | 26 | | }); |
| | | 27 | | |
| | 0 | 28 | | migrationBuilder.CreateTable( |
| | 0 | 29 | | name: "WorkflowDefinitionLabels", |
| | 0 | 30 | | columns: table => new |
| | 0 | 31 | | { |
| | 0 | 32 | | Id = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 33 | | WorkflowDefinitionId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 34 | | WorkflowDefinitionVersionId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 35 | | LabelId = table.Column<string>(type: "TEXT", nullable: false) |
| | 0 | 36 | | }, |
| | 0 | 37 | | constraints: table => |
| | 0 | 38 | | { |
| | 0 | 39 | | table.PrimaryKey("PK_WorkflowDefinitionLabels", x => x.Id); |
| | 0 | 40 | | }); |
| | | 41 | | |
| | 0 | 42 | | migrationBuilder.CreateIndex( |
| | 0 | 43 | | name: "WorkflowDefinitionLabel_LabelId", |
| | 0 | 44 | | table: "WorkflowDefinitionLabels", |
| | 0 | 45 | | column: "LabelId"); |
| | | 46 | | |
| | 0 | 47 | | migrationBuilder.CreateIndex( |
| | 0 | 48 | | name: "WorkflowDefinitionLabel_WorkflowDefinitionId", |
| | 0 | 49 | | table: "WorkflowDefinitionLabels", |
| | 0 | 50 | | column: "WorkflowDefinitionId"); |
| | | 51 | | |
| | 0 | 52 | | migrationBuilder.CreateIndex( |
| | 0 | 53 | | name: "WorkflowDefinitionLabel_WorkflowDefinitionVersionId", |
| | 0 | 54 | | table: "WorkflowDefinitionLabels", |
| | 0 | 55 | | column: "WorkflowDefinitionVersionId"); |
| | 0 | 56 | | } |
| | | 57 | | |
| | | 58 | | /// <inheritdoc /> |
| | | 59 | | protected override void Down(MigrationBuilder migrationBuilder) |
| | | 60 | | { |
| | 0 | 61 | | migrationBuilder.DropTable( |
| | 0 | 62 | | name: "Labels"); |
| | | 63 | | |
| | 0 | 64 | | migrationBuilder.DropTable( |
| | 0 | 65 | | name: "WorkflowDefinitionLabels"); |
| | 0 | 66 | | } |
| | | 67 | | } |
| | | 68 | | } |