using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace TodoTicketApp.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Tickets", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Title = table.Column(type: "TEXT", nullable: false), Description = table.Column(type: "TEXT", nullable: false), CreatedAt = table.Column(type: "TEXT", nullable: false), Priority = table.Column(type: "INTEGER", nullable: false), IsCompleted = table.Column(type: "INTEGER", nullable: false), AttachmentNames = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Tickets", x => x.Id); }); migrationBuilder.CreateTable( name: "Comments", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), TicketId = table.Column(type: "TEXT", nullable: false), Text = table.Column(type: "TEXT", nullable: false), CreatedAt = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Comments", x => x.Id); table.ForeignKey( name: "FK_Comments_Tickets_TicketId", column: x => x.TicketId, principalTable: "Tickets", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Comments_TicketId", table: "Comments", column: "TicketId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Comments"); migrationBuilder.DropTable( name: "Tickets"); } } }