[a569b7c] | 1 | using System;
|
---|
| 2 | using Microsoft.EntityFrameworkCore.Migrations;
|
---|
| 3 | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
---|
| 4 |
|
---|
| 5 | #nullable disable
|
---|
| 6 |
|
---|
| 7 | namespace backend.Migrations
|
---|
| 8 | {
|
---|
| 9 | public partial class ToDoItems : Migration
|
---|
| 10 | {
|
---|
| 11 | protected override void Up(MigrationBuilder migrationBuilder)
|
---|
| 12 | {
|
---|
| 13 | migrationBuilder.CreateTable(
|
---|
| 14 | name: "ToDoItems",
|
---|
| 15 | columns: table => new
|
---|
| 16 | {
|
---|
| 17 | Id = table.Column<int>(type: "integer", nullable: false)
|
---|
| 18 | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
---|
| 19 | CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
---|
| 20 | Title = table.Column<string>(type: "text", nullable: false),
|
---|
| 21 | Description = table.Column<string>(type: "text", nullable: false),
|
---|
| 22 | LinkedReviewId = table.Column<int>(type: "integer", nullable: false),
|
---|
| 23 | Status = table.Column<int>(type: "integer", nullable: false)
|
---|
| 24 | },
|
---|
| 25 | constraints: table =>
|
---|
| 26 | {
|
---|
| 27 | table.PrimaryKey("PK_ToDoItems", x => x.Id);
|
---|
| 28 | table.ForeignKey(
|
---|
| 29 | name: "FK_ToDoItems_Reviews_LinkedReviewId",
|
---|
| 30 | column: x => x.LinkedReviewId,
|
---|
| 31 | principalTable: "Reviews",
|
---|
| 32 | principalColumn: "Id",
|
---|
| 33 | onDelete: ReferentialAction.Cascade);
|
---|
| 34 | });
|
---|
| 35 |
|
---|
| 36 | migrationBuilder.CreateIndex(
|
---|
| 37 | name: "IX_ToDoItems_LinkedReviewId",
|
---|
| 38 | table: "ToDoItems",
|
---|
| 39 | column: "LinkedReviewId");
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | protected override void Down(MigrationBuilder migrationBuilder)
|
---|
| 43 | {
|
---|
| 44 | migrationBuilder.DropTable(
|
---|
| 45 | name: "ToDoItems");
|
---|
| 46 | }
|
---|
| 47 | }
|
---|
| 48 | }
|
---|