using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.SeaHavenIndustries.Migrations { /// public partial class AddTaskListTemplates : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "TaskListTemplates", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true), IsActive = table.Column(type: "bit", nullable: false), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_TaskListTemplates", x => x.Id); }); migrationBuilder.CreateTable( name: "TaskListTemplateItems", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), TaskListTemplateId = table.Column(type: "int", nullable: false), ItemText = table.Column(type: "nvarchar(max)", nullable: true), SortOrder = table.Column(type: "int", nullable: false), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_TaskListTemplateItems", x => x.Id); table.ForeignKey( name: "FK_TaskListTemplateItems_TaskListTemplates_TaskListTemplateId", column: x => x.TaskListTemplateId, principalTable: "TaskListTemplates", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_TaskListTemplateItems_TaskListTemplateId", table: "TaskListTemplateItems", column: "TaskListTemplateId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "TaskListTemplateItems"); migrationBuilder.DropTable( name: "TaskListTemplates"); } } }