20260402104505_RemoveUnusedBudgetCategoryTranslations.cs
2,070 bytes
| 1 | using System; |
|---|---|
| 2 | using Microsoft.EntityFrameworkCore.Migrations; |
| 3 | |
| 4 | #nullable disable |
| 5 | |
| 6 | namespace App.DAL.EF.Migrations |
| 7 | { |
| 8 | /// <inheritdoc /> |
| 9 | public partial class RemoveUnusedBudgetCategoryTranslations : Migration |
| 10 | { |
| 11 | /// <inheritdoc /> |
| 12 | protected override void Up(MigrationBuilder migrationBuilder) |
| 13 | { |
| 14 | migrationBuilder.DropTable( |
| 15 | name: "BudgetCategoryTranslations"); |
| 16 | } |
| 17 | |
| 18 | /// <inheritdoc /> |
| 19 | protected override void Down(MigrationBuilder migrationBuilder) |
| 20 | { |
| 21 | migrationBuilder.CreateTable( |
| 22 | name: "BudgetCategoryTranslations", |
| 23 | columns: table => new |
| 24 | { |
| 25 | Id = table.Column<Guid>(type: "uuid", nullable: false), |
| 26 | BudgetCategoryId = table.Column<Guid>(type: "uuid", nullable: false), |
| 27 | CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 28 | Culture = table.Column<string>(type: "character varying(5)", maxLength: 5, nullable: false), |
| 29 | Name = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false), |
| 30 | UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false) |
| 31 | }, |
| 32 | constraints: table => |
| 33 | { |
| 34 | table.PrimaryKey("PK_BudgetCategoryTranslations", x => x.Id); |
| 35 | table.ForeignKey( |
| 36 | name: "FK_BudgetCategoryTranslations_BudgetCategories_BudgetCategoryId", |
| 37 | column: x => x.BudgetCategoryId, |
| 38 | principalTable: "BudgetCategories", |
| 39 | principalColumn: "Id", |
| 40 | onDelete: ReferentialAction.Restrict); |
| 41 | }); |
| 42 | |
| 43 | migrationBuilder.CreateIndex( |
| 44 | name: "IX_BudgetCategoryTranslations_BudgetCategoryId", |
| 45 | table: "BudgetCategoryTranslations", |
| 46 | column: "BudgetCategoryId"); |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | |