using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace FlexJobApi.Database.Migrations.Migrations { /// public partial class UpdateElectronSignSetting : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "MergeSignCost", table: "Enterprise"); migrationBuilder.DropColumn( name: "RealVerifyCost", table: "Enterprise"); migrationBuilder.DropColumn( name: "SignCost", table: "Enterprise"); migrationBuilder.CreateTable( name: "ElectronSignSetting", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), Access = table.Column(type: "int", nullable: false), RealVerifyCost = table.Column(type: "decimal(18,2)", nullable: true), SignCost = table.Column(type: "decimal(18,2)", nullable: true), MergeSignCost = table.Column(type: "decimal(18,2)", nullable: true), Sort = table.Column(type: "int", nullable: false), TraceId = table.Column(type: "nvarchar(max)", nullable: true), CreatedTime = table.Column(type: "datetimeoffset", nullable: false), CreatedUserId = table.Column(type: "uniqueidentifier", nullable: true), CreatedEnterpriseId = table.Column(type: "uniqueidentifier", nullable: true), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true), UpdatedUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ElectronSignSetting", x => x.Id); }); migrationBuilder.CreateTable( name: "EnterpriseElectronSignSetting", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), EnterpriseId = table.Column(type: "uniqueidentifier", nullable: false), ElectronSignAccess = table.Column(type: "int", nullable: false), Sort = table.Column(type: "int", nullable: false), TraceId = table.Column(type: "nvarchar(max)", nullable: true), CreatedTime = table.Column(type: "datetimeoffset", nullable: false), CreatedUserId = table.Column(type: "uniqueidentifier", nullable: true), CreatedEnterpriseId = table.Column(type: "uniqueidentifier", nullable: true), UpdatedTime = table.Column(type: "datetimeoffset", nullable: true), UpdatedUserId = table.Column(type: "uniqueidentifier", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_EnterpriseElectronSignSetting", x => x.Id); table.ForeignKey( name: "FK_EnterpriseElectronSignSetting_Enterprise_EnterpriseId", column: x => x.EnterpriseId, principalTable: "Enterprise", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_EnterpriseElectronSignSetting_EnterpriseId", table: "EnterpriseElectronSignSetting", column: "EnterpriseId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ElectronSignSetting"); migrationBuilder.DropTable( name: "EnterpriseElectronSignSetting"); migrationBuilder.AddColumn( name: "MergeSignCost", table: "Enterprise", type: "decimal(18,2)", nullable: true); migrationBuilder.AddColumn( name: "RealVerifyCost", table: "Enterprise", type: "decimal(18,2)", nullable: true); migrationBuilder.AddColumn( name: "SignCost", table: "Enterprise", type: "decimal(18,2)", nullable: true); } } }