using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
#nullable disable
|
|
namespace FlexJobApi.Database.Migrations.Migrations
|
{
|
/// <inheritdoc />
|
public partial class UpdateEnterprise : Migration
|
{
|
/// <inheritdoc />
|
protected override void Up(MigrationBuilder migrationBuilder)
|
{
|
migrationBuilder.DropForeignKey(
|
name: "FK_Enterprise_FileVirtualPath_IdentityBackImgId",
|
table: "Enterprise");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_Enterprise_FileVirtualPath_IdentityImgId",
|
table: "Enterprise");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_Enterprise_FileVirtualPath_LicenseImageId",
|
table: "Enterprise");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_AvatarId",
|
table: "UserAuth");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_BankCardImgId",
|
table: "UserAuth");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_IdentityBackImgId",
|
table: "UserAuth");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_IdentityImgId",
|
table: "UserAuth");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_UserInfoCredential_FileVirtualPath_BackImgId",
|
table: "UserInfoCredential");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_UserInfoCredential_FileVirtualPath_ImgId",
|
table: "UserInfoCredential");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_UserInfoPhoto_FileVirtualPath_ImgId",
|
table: "UserInfoPhoto");
|
|
migrationBuilder.DropTable(
|
name: "FileVirtualPath");
|
|
migrationBuilder.DropTable(
|
name: "FileStore");
|
|
migrationBuilder.DropIndex(
|
name: "IX_UserInfoPhoto_ImgId",
|
table: "UserInfoPhoto");
|
|
migrationBuilder.DropIndex(
|
name: "IX_UserInfoCredential_BackImgId",
|
table: "UserInfoCredential");
|
|
migrationBuilder.DropIndex(
|
name: "IX_UserInfoCredential_ImgId",
|
table: "UserInfoCredential");
|
|
migrationBuilder.DropIndex(
|
name: "IX_UserAuth_AvatarId",
|
table: "UserAuth");
|
|
migrationBuilder.DropIndex(
|
name: "IX_UserAuth_BankCardImgId",
|
table: "UserAuth");
|
|
migrationBuilder.DropIndex(
|
name: "IX_UserAuth_IdentityBackImgId",
|
table: "UserAuth");
|
|
migrationBuilder.DropIndex(
|
name: "IX_UserAuth_IdentityImgId",
|
table: "UserAuth");
|
|
migrationBuilder.DropIndex(
|
name: "IX_Enterprise_IdentityBackImgId",
|
table: "Enterprise");
|
|
migrationBuilder.DropIndex(
|
name: "IX_Enterprise_IdentityImgId",
|
table: "Enterprise");
|
|
migrationBuilder.DropIndex(
|
name: "IX_Enterprise_LicenseImageId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "ImgId",
|
table: "UserInfoPhoto");
|
|
migrationBuilder.DropColumn(
|
name: "BackImgId",
|
table: "UserInfoCredential");
|
|
migrationBuilder.DropColumn(
|
name: "ImgId",
|
table: "UserInfoCredential");
|
|
migrationBuilder.DropColumn(
|
name: "AvatarId",
|
table: "UserAuth");
|
|
migrationBuilder.DropColumn(
|
name: "BankCardImgId",
|
table: "UserAuth");
|
|
migrationBuilder.DropColumn(
|
name: "IdentityBackImgId",
|
table: "UserAuth");
|
|
migrationBuilder.DropColumn(
|
name: "IdentityImgId",
|
table: "UserAuth");
|
|
migrationBuilder.DropColumn(
|
name: "BankCardImgId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "ContactNumber",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "EnterpriseName",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "EnterpriseRealMethod",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "Identity",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "IdentityBackImgId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "IdentityImgId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "IsReal",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "LegalPerson",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "LicenseImageId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "Name",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "PersonalRealMethod",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "PhoneNumber",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "Proxy",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "ProxyPowerAttorneyUrl",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "SocietyCreditCode",
|
table: "Enterprise");
|
|
migrationBuilder.AddColumn<string>(
|
name: "Img",
|
table: "UserInfoPhoto",
|
type: "nvarchar(max)",
|
nullable: true,
|
comment: "照片");
|
|
migrationBuilder.AddColumn<string>(
|
name: "BackImg",
|
table: "UserInfoCredential",
|
type: "nvarchar(max)",
|
nullable: true,
|
comment: "证书反面照片");
|
|
migrationBuilder.AddColumn<string>(
|
name: "Img",
|
table: "UserInfoCredential",
|
type: "nvarchar(max)",
|
nullable: true,
|
comment: "证书正面照片");
|
|
migrationBuilder.AddColumn<string>(
|
name: "Avatar",
|
table: "UserInfo",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "ProvinceId",
|
table: "UserInfo",
|
type: "uniqueidentifier",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "BankCardImg",
|
table: "UserAuth",
|
type: "nvarchar(max)",
|
nullable: true,
|
comment: "银行卡照片");
|
|
migrationBuilder.AddColumn<string>(
|
name: "IdentityBackImg",
|
table: "UserAuth",
|
type: "nvarchar(max)",
|
nullable: true,
|
comment: "身份证国徽面");
|
|
migrationBuilder.AddColumn<string>(
|
name: "IdentityImg",
|
table: "UserAuth",
|
type: "nvarchar(max)",
|
nullable: true,
|
comment: "身份证人像面");
|
|
migrationBuilder.AddColumn<string>(
|
name: "BankBranchName",
|
table: "Enterprise",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "BankName",
|
table: "Enterprise",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "CityId",
|
table: "Enterprise",
|
type: "uniqueidentifier",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "ContactEmail",
|
table: "Enterprise",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "ContactPhoneNumber",
|
table: "Enterprise",
|
type: "nvarchar(11)",
|
maxLength: 11,
|
nullable: true);
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "EnterpriseAuthId",
|
table: "Enterprise",
|
type: "uniqueidentifier",
|
nullable: false,
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "IndustryTypeId",
|
table: "Enterprise",
|
type: "uniqueidentifier",
|
nullable: true);
|
|
migrationBuilder.AddColumn<bool>(
|
name: "IsCheckedBankCard",
|
table: "Enterprise",
|
type: "bit",
|
nullable: false,
|
defaultValue: false);
|
|
migrationBuilder.AddColumn<string>(
|
name: "MainBusiness",
|
table: "Enterprise",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<decimal>(
|
name: "MergeSignCost",
|
table: "Enterprise",
|
type: "decimal(18,2)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<int>(
|
name: "PayAccess",
|
table: "Enterprise",
|
type: "int",
|
nullable: true);
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "ProvinceId",
|
table: "Enterprise",
|
type: "uniqueidentifier",
|
nullable: true);
|
|
migrationBuilder.AddColumn<decimal>(
|
name: "RealVerifyCost",
|
table: "Enterprise",
|
type: "decimal(18,2)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<decimal>(
|
name: "SignCost",
|
table: "Enterprise",
|
type: "decimal(18,2)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<int>(
|
name: "SmsAccess",
|
table: "Enterprise",
|
type: "int",
|
nullable: true);
|
|
migrationBuilder.AddColumn<decimal>(
|
name: "SmsCost",
|
table: "Enterprise",
|
type: "decimal(18,2)",
|
nullable: false,
|
defaultValue: 0m);
|
|
migrationBuilder.CreateTable(
|
name: "EnterpriseAuth",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
EnterpriseRealMethod = table.Column<int>(type: "int", nullable: true),
|
EnterpriseName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
SocietyCreditCode = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: false),
|
LicenseImage = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
LegalPerson = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
|
LegalIdentity = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
PersonalRealMethod = table.Column<int>(type: "int", nullable: true),
|
Name = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
|
Identity = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
IdentityImg = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
IdentityBackImg = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
BankCard = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
|
BankCardImg = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
PhoneNumber = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
|
Proxy = table.Column<bool>(type: "bit", nullable: true),
|
ProxyPowerAttorneyUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
IsReal = table.Column<bool>(type: "bit", nullable: false),
|
CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
|
TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
|
CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
|
UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
|
},
|
constraints: table =>
|
{
|
table.PrimaryKey("PK_EnterpriseAuth", x => x.Id);
|
});
|
|
migrationBuilder.UpdateData(
|
table: "UserAuth",
|
keyColumn: "Id",
|
keyValue: new Guid("11111111-1111-1111-1111-111111111111"),
|
columns: new[] { "BankCardImg", "IdentityBackImg", "IdentityImg" },
|
values: new object[] { null, null, null });
|
|
migrationBuilder.UpdateData(
|
table: "UserInfo",
|
keyColumn: "Id",
|
keyValue: new Guid("11111111-1111-1111-1111-111111111112"),
|
columns: new[] { "Avatar", "ProvinceId" },
|
values: new object[] { null, null });
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfo_ProvinceId",
|
table: "UserInfo",
|
column: "ProvinceId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_Enterprise_CityId",
|
table: "Enterprise",
|
column: "CityId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_Enterprise_EnterpriseAuthId",
|
table: "Enterprise",
|
column: "EnterpriseAuthId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_Enterprise_IndustryTypeId",
|
table: "Enterprise",
|
column: "IndustryTypeId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_Enterprise_ProvinceId",
|
table: "Enterprise",
|
column: "ProvinceId");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_Enterprise_DictionaryData_CityId",
|
table: "Enterprise",
|
column: "CityId",
|
principalTable: "DictionaryData",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_Enterprise_DictionaryData_IndustryTypeId",
|
table: "Enterprise",
|
column: "IndustryTypeId",
|
principalTable: "DictionaryData",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_Enterprise_DictionaryData_ProvinceId",
|
table: "Enterprise",
|
column: "ProvinceId",
|
principalTable: "DictionaryData",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_Enterprise_EnterpriseAuth_EnterpriseAuthId",
|
table: "Enterprise",
|
column: "EnterpriseAuthId",
|
principalTable: "EnterpriseAuth",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_UserInfo_DictionaryData_ProvinceId",
|
table: "UserInfo",
|
column: "ProvinceId",
|
principalTable: "DictionaryData",
|
principalColumn: "Id");
|
}
|
|
/// <inheritdoc />
|
protected override void Down(MigrationBuilder migrationBuilder)
|
{
|
migrationBuilder.DropForeignKey(
|
name: "FK_Enterprise_DictionaryData_CityId",
|
table: "Enterprise");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_Enterprise_DictionaryData_IndustryTypeId",
|
table: "Enterprise");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_Enterprise_DictionaryData_ProvinceId",
|
table: "Enterprise");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_Enterprise_EnterpriseAuth_EnterpriseAuthId",
|
table: "Enterprise");
|
|
migrationBuilder.DropForeignKey(
|
name: "FK_UserInfo_DictionaryData_ProvinceId",
|
table: "UserInfo");
|
|
migrationBuilder.DropTable(
|
name: "EnterpriseAuth");
|
|
migrationBuilder.DropIndex(
|
name: "IX_UserInfo_ProvinceId",
|
table: "UserInfo");
|
|
migrationBuilder.DropIndex(
|
name: "IX_Enterprise_CityId",
|
table: "Enterprise");
|
|
migrationBuilder.DropIndex(
|
name: "IX_Enterprise_EnterpriseAuthId",
|
table: "Enterprise");
|
|
migrationBuilder.DropIndex(
|
name: "IX_Enterprise_IndustryTypeId",
|
table: "Enterprise");
|
|
migrationBuilder.DropIndex(
|
name: "IX_Enterprise_ProvinceId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "Img",
|
table: "UserInfoPhoto");
|
|
migrationBuilder.DropColumn(
|
name: "BackImg",
|
table: "UserInfoCredential");
|
|
migrationBuilder.DropColumn(
|
name: "Img",
|
table: "UserInfoCredential");
|
|
migrationBuilder.DropColumn(
|
name: "Avatar",
|
table: "UserInfo");
|
|
migrationBuilder.DropColumn(
|
name: "ProvinceId",
|
table: "UserInfo");
|
|
migrationBuilder.DropColumn(
|
name: "BankCardImg",
|
table: "UserAuth");
|
|
migrationBuilder.DropColumn(
|
name: "IdentityBackImg",
|
table: "UserAuth");
|
|
migrationBuilder.DropColumn(
|
name: "IdentityImg",
|
table: "UserAuth");
|
|
migrationBuilder.DropColumn(
|
name: "BankBranchName",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "BankName",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "CityId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "ContactEmail",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "ContactPhoneNumber",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "EnterpriseAuthId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "IndustryTypeId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "IsCheckedBankCard",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "MainBusiness",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "MergeSignCost",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "PayAccess",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "ProvinceId",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "RealVerifyCost",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "SignCost",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "SmsAccess",
|
table: "Enterprise");
|
|
migrationBuilder.DropColumn(
|
name: "SmsCost",
|
table: "Enterprise");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "ImgId",
|
table: "UserInfoPhoto",
|
type: "uniqueidentifier",
|
nullable: false,
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
comment: "照片Id");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "BackImgId",
|
table: "UserInfoCredential",
|
type: "uniqueidentifier",
|
nullable: true,
|
comment: "证书反面照片Id");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "ImgId",
|
table: "UserInfoCredential",
|
type: "uniqueidentifier",
|
nullable: false,
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
comment: "证书正面照片Id");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "AvatarId",
|
table: "UserAuth",
|
type: "uniqueidentifier",
|
nullable: true,
|
comment: "头像Id");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "BankCardImgId",
|
table: "UserAuth",
|
type: "uniqueidentifier",
|
nullable: true,
|
comment: "银行卡照片Id");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "IdentityBackImgId",
|
table: "UserAuth",
|
type: "uniqueidentifier",
|
nullable: true,
|
comment: "身份证国徽面Id");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "IdentityImgId",
|
table: "UserAuth",
|
type: "uniqueidentifier",
|
nullable: true,
|
comment: "身份证人像面Id");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "BankCardImgId",
|
table: "Enterprise",
|
type: "uniqueidentifier",
|
nullable: true,
|
comment: "法人或经办人银行卡照片Id");
|
|
migrationBuilder.AddColumn<string>(
|
name: "ContactNumber",
|
table: "Enterprise",
|
type: "nvarchar(11)",
|
maxLength: 11,
|
nullable: true,
|
comment: "联系电话");
|
|
migrationBuilder.AddColumn<string>(
|
name: "EnterpriseName",
|
table: "Enterprise",
|
type: "nvarchar(128)",
|
maxLength: 128,
|
nullable: false,
|
defaultValue: "",
|
comment: "企业全称");
|
|
migrationBuilder.AddColumn<int>(
|
name: "EnterpriseRealMethod",
|
table: "Enterprise",
|
type: "int",
|
nullable: true,
|
comment: "企业认证方式");
|
|
migrationBuilder.AddColumn<string>(
|
name: "Identity",
|
table: "Enterprise",
|
type: "nvarchar(18)",
|
maxLength: 18,
|
nullable: true,
|
comment: "法人或经办人身份证号");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "IdentityBackImgId",
|
table: "Enterprise",
|
type: "uniqueidentifier",
|
nullable: true,
|
comment: "法人或经办人身份证国徽面Id");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "IdentityImgId",
|
table: "Enterprise",
|
type: "uniqueidentifier",
|
nullable: true,
|
comment: "法人或经办人身份证人像面Id");
|
|
migrationBuilder.AddColumn<bool>(
|
name: "IsReal",
|
table: "Enterprise",
|
type: "bit",
|
nullable: false,
|
defaultValue: false,
|
comment: "是否实名");
|
|
migrationBuilder.AddColumn<string>(
|
name: "LegalPerson",
|
table: "Enterprise",
|
type: "nvarchar(32)",
|
maxLength: 32,
|
nullable: true,
|
comment: "法人姓名");
|
|
migrationBuilder.AddColumn<Guid>(
|
name: "LicenseImageId",
|
table: "Enterprise",
|
type: "uniqueidentifier",
|
nullable: true,
|
comment: "营业执照照片Id");
|
|
migrationBuilder.AddColumn<string>(
|
name: "Name",
|
table: "Enterprise",
|
type: "nvarchar(32)",
|
maxLength: 32,
|
nullable: true,
|
comment: "法人或经办人姓名");
|
|
migrationBuilder.AddColumn<int>(
|
name: "PersonalRealMethod",
|
table: "Enterprise",
|
type: "int",
|
nullable: true,
|
comment: "法人或经办人实名方式");
|
|
migrationBuilder.AddColumn<string>(
|
name: "PhoneNumber",
|
table: "Enterprise",
|
type: "nvarchar(11)",
|
maxLength: 11,
|
nullable: true,
|
comment: "法人或经办人手机号");
|
|
migrationBuilder.AddColumn<bool>(
|
name: "Proxy",
|
table: "Enterprise",
|
type: "bit",
|
nullable: true,
|
comment: "是否委托经办人");
|
|
migrationBuilder.AddColumn<string>(
|
name: "ProxyPowerAttorneyUrl",
|
table: "Enterprise",
|
type: "nvarchar(max)",
|
nullable: true,
|
comment: "企业授权书");
|
|
migrationBuilder.AddColumn<string>(
|
name: "SocietyCreditCode",
|
table: "Enterprise",
|
type: "nvarchar(18)",
|
maxLength: 18,
|
nullable: false,
|
defaultValue: "",
|
comment: "统一社会信用代码");
|
|
migrationBuilder.CreateTable(
|
name: "FileStore",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
AbsolutePath = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "绝对路径"),
|
Access = table.Column<int>(type: "int", nullable: false, comment: "通道"),
|
ContentType = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "内容类型"),
|
CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
|
Extension = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "扩展名"),
|
FileType = table.Column<int>(type: "int", nullable: false, comment: "文件类型"),
|
Hash = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "哈希"),
|
ImageHeight = table.Column<int>(type: "int", nullable: true, comment: "高度(像素)"),
|
ImageWidth = table.Column<int>(type: "int", nullable: true, comment: "宽度(像素)"),
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除"),
|
Length = table.Column<long>(type: "bigint", nullable: false, comment: "文件大小(字节)"),
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "名称"),
|
RelativePath = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "相对路径"),
|
Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
|
TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
|
UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人")
|
},
|
constraints: table =>
|
{
|
table.PrimaryKey("PK_FileStore", x => x.Id);
|
},
|
comment: "文件存储");
|
|
migrationBuilder.CreateTable(
|
name: "FileVirtualPath",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
StoreId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "文件存储Id"),
|
CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除"),
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "名称"),
|
Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
|
TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
|
UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
|
VirtualPath = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "虚拟路径")
|
},
|
constraints: table =>
|
{
|
table.PrimaryKey("PK_FileVirtualPath", x => x.Id);
|
table.ForeignKey(
|
name: "FK_FileVirtualPath_FileStore_StoreId",
|
column: x => x.StoreId,
|
principalTable: "FileStore",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "文件虚拟路径");
|
|
migrationBuilder.UpdateData(
|
table: "UserAuth",
|
keyColumn: "Id",
|
keyValue: new Guid("11111111-1111-1111-1111-111111111111"),
|
columns: new[] { "AvatarId", "BankCardImgId", "IdentityBackImgId", "IdentityImgId" },
|
values: new object[] { null, null, null, null });
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoPhoto_ImgId",
|
table: "UserInfoPhoto",
|
column: "ImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoCredential_BackImgId",
|
table: "UserInfoCredential",
|
column: "BackImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoCredential_ImgId",
|
table: "UserInfoCredential",
|
column: "ImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserAuth_AvatarId",
|
table: "UserAuth",
|
column: "AvatarId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserAuth_BankCardImgId",
|
table: "UserAuth",
|
column: "BankCardImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserAuth_IdentityBackImgId",
|
table: "UserAuth",
|
column: "IdentityBackImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserAuth_IdentityImgId",
|
table: "UserAuth",
|
column: "IdentityImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_Enterprise_IdentityBackImgId",
|
table: "Enterprise",
|
column: "IdentityBackImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_Enterprise_IdentityImgId",
|
table: "Enterprise",
|
column: "IdentityImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_Enterprise_LicenseImageId",
|
table: "Enterprise",
|
column: "LicenseImageId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_FileVirtualPath_StoreId",
|
table: "FileVirtualPath",
|
column: "StoreId");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_Enterprise_FileVirtualPath_IdentityBackImgId",
|
table: "Enterprise",
|
column: "IdentityBackImgId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_Enterprise_FileVirtualPath_IdentityImgId",
|
table: "Enterprise",
|
column: "IdentityImgId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_Enterprise_FileVirtualPath_LicenseImageId",
|
table: "Enterprise",
|
column: "LicenseImageId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_AvatarId",
|
table: "UserAuth",
|
column: "AvatarId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_BankCardImgId",
|
table: "UserAuth",
|
column: "BankCardImgId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_IdentityBackImgId",
|
table: "UserAuth",
|
column: "IdentityBackImgId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_IdentityImgId",
|
table: "UserAuth",
|
column: "IdentityImgId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_UserInfoCredential_FileVirtualPath_BackImgId",
|
table: "UserInfoCredential",
|
column: "BackImgId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_UserInfoCredential_FileVirtualPath_ImgId",
|
table: "UserInfoCredential",
|
column: "ImgId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
|
migrationBuilder.AddForeignKey(
|
name: "FK_UserInfoPhoto_FileVirtualPath_ImgId",
|
table: "UserInfoPhoto",
|
column: "ImgId",
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
}
|
}
|
}
|