From 509f2b5d3ee9208ea6b86aae5d29194c654d67f5 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期三, 06 八月 2025 16:59:33 +0800 Subject: [PATCH] Merge branch 'master' of http://120.26.58.240:8888/r/ApiFlexJob --- FlexJobApi.Database.Migrations/Migrations/20250806082829_UpdateEnterprise.cs | 965 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 965 insertions(+), 0 deletions(-) diff --git a/FlexJobApi.Database.Migrations/Migrations/20250806082829_UpdateEnterprise.cs b/FlexJobApi.Database.Migrations/Migrations/20250806082829_UpdateEnterprise.cs new file mode 100644 index 0000000..282c752 --- /dev/null +++ b/FlexJobApi.Database.Migrations/Migrations/20250806082829_UpdateEnterprise.cs @@ -0,0 +1,965 @@ +锘縰sing 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: "璇佷功姝i潰鐓х墖"); + + 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: "璇佷功姝i潰鐓х墖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: "閾惰鍗$収鐗嘔d"); + + 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: "娉曚汉鎴栫粡鍔炰汉閾惰鍗$収鐗嘔d"); + + 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: "缁熶竴绀句細淇$敤浠g爜"); + + 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); + } + } +} -- Gitblit v1.9.1