using Microsoft.EntityFrameworkCore.Migrations; namespace wispro.sp.api.Migrations { public partial class addObjectStaffStatistics : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "StaffStatistics", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CalMonthId = table.Column(type: "int", nullable: false), StaffId = table.Column(type: "int", nullable: false), jxType = table.Column(type: "nvarchar(max)", nullable: true), totalBasePoint = table.Column(type: "float", nullable: true), totalActuallyPoint = table.Column(type: "float", nullable: true) }, constraints: table => { table.PrimaryKey("PK_StaffStatistics", x => x.Id); table.ForeignKey( name: "FK_StaffStatistics_CalMonth_CalMonthId", column: x => x.CalMonthId, principalTable: "CalMonth", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_StaffStatistics_Staff_StaffId", column: x => x.StaffId, principalTable: "Staff", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_StaffStatistics_CalMonthId", table: "StaffStatistics", column: "CalMonthId"); migrationBuilder.CreateIndex( name: "IX_StaffStatistics_StaffId", table: "StaffStatistics", column: "StaffId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "StaffStatistics"); } } }