using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
#nullable disable
|
|
namespace FlexJobApi.Database.Migrations.Migrations
|
{
|
/// <inheritdoc />
|
public partial class UpdateEnterpriseEmployee0828 : Migration
|
{
|
/// <inheritdoc />
|
protected override void Up(MigrationBuilder migrationBuilder)
|
{
|
migrationBuilder.AddColumn<string>(
|
name: "EnterpriseSignContractErrorMessage",
|
table: "EnterpriseEmployeeContract",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "UserSignContractErrorMessage",
|
table: "EnterpriseEmployeeContract",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "EnterpriseSignContractErrorMessage",
|
table: "EnterpriseEmployee",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "UserSignContractErrorMessage",
|
table: "EnterpriseEmployee",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.CreateTable(
|
name: "EnterpriseCost",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
EnterpriseId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Type = table.Column<int>(type: "int", nullable: false),
|
EnterpriseEmployeeContractId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
Status = table.Column<int>(type: "int", nullable: true),
|
Amount = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
|
Sort = table.Column<int>(type: "int", nullable: false),
|
TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
CreatedUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
CreatedEnterpriseId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
UpdatedUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
},
|
constraints: table =>
|
{
|
table.PrimaryKey("PK_EnterpriseCost", x => x.Id);
|
table.ForeignKey(
|
name: "FK_EnterpriseCost_EnterpriseEmployeeContract_EnterpriseEmployeeContractId",
|
column: x => x.EnterpriseEmployeeContractId,
|
principalTable: "EnterpriseEmployeeContract",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_EnterpriseCost_Enterprise_EnterpriseId",
|
column: x => x.EnterpriseId,
|
principalTable: "Enterprise",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
});
|
|
migrationBuilder.CreateIndex(
|
name: "IX_EnterpriseCost_EnterpriseEmployeeContractId",
|
table: "EnterpriseCost",
|
column: "EnterpriseEmployeeContractId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_EnterpriseCost_EnterpriseId",
|
table: "EnterpriseCost",
|
column: "EnterpriseId");
|
}
|
|
/// <inheritdoc />
|
protected override void Down(MigrationBuilder migrationBuilder)
|
{
|
migrationBuilder.DropTable(
|
name: "EnterpriseCost");
|
|
migrationBuilder.DropColumn(
|
name: "EnterpriseSignContractErrorMessage",
|
table: "EnterpriseEmployeeContract");
|
|
migrationBuilder.DropColumn(
|
name: "UserSignContractErrorMessage",
|
table: "EnterpriseEmployeeContract");
|
|
migrationBuilder.DropColumn(
|
name: "EnterpriseSignContractErrorMessage",
|
table: "EnterpriseEmployee");
|
|
migrationBuilder.DropColumn(
|
name: "UserSignContractErrorMessage",
|
table: "EnterpriseEmployee");
|
}
|
}
|
}
|