using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Brizco.Repository.Migrations { /// public partial class addShiftPlanUser : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ShiftPlanUsers", columns: table => new { Id = table.Column(type: "uuid", nullable: false), ShiftPlanId = table.Column(type: "uuid", nullable: false), ApplicationUserId = table.Column(type: "uuid", nullable: false), RemovedAt = table.Column(type: "timestamp without time zone", nullable: false), CreatedAt = table.Column(type: "timestamp without time zone", nullable: false), CreatedBy = table.Column(type: "text", nullable: false), IsRemoved = table.Column(type: "boolean", nullable: false), RemovedBy = table.Column(type: "text", nullable: false), ModifiedAt = table.Column(type: "timestamp without time zone", nullable: false), ModifiedBy = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ShiftPlanUsers", x => x.Id); table.ForeignKey( name: "FK_ShiftPlanUsers_AspNetUsers_ApplicationUserId", column: x => x.ApplicationUserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_ShiftPlanUsers_ShiftPlans_ShiftPlanId", column: x => x.ShiftPlanId, principalTable: "ShiftPlans", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_ShiftPlanUsers_ApplicationUserId", table: "ShiftPlanUsers", column: "ApplicationUserId"); migrationBuilder.CreateIndex( name: "IX_ShiftPlanUsers_ShiftPlanId", table: "ShiftPlanUsers", column: "ShiftPlanId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ShiftPlanUsers"); } } }