using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace backend.Migrations { public partial class ToDoItems : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ToDoItems", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), Title = table.Column(type: "text", nullable: false), Description = table.Column(type: "text", nullable: false), LinkedReviewId = table.Column(type: "integer", nullable: false), Status = table.Column(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ToDoItems", x => x.Id); table.ForeignKey( name: "FK_ToDoItems_Reviews_LinkedReviewId", column: x => x.LinkedReviewId, principalTable: "Reviews", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ToDoItems_LinkedReviewId", table: "ToDoItems", column: "LinkedReviewId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ToDoItems"); } } }