using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
#nullable disable
|
|
namespace FlexJobApi.Database.Migrations.Migrations
|
{
|
/// <inheritdoc />
|
public partial class UpdateUser0801 : Migration
|
{
|
/// <inheritdoc />
|
protected override void Up(MigrationBuilder migrationBuilder)
|
{
|
migrationBuilder.CreateTable(
|
name: "DictionaryCategory",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Code = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "编号"),
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "名称"),
|
FieldNames = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段名(逗号隔开)"),
|
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_DictionaryCategory", x => x.Id);
|
},
|
comment: "字典类别");
|
|
migrationBuilder.CreateTable(
|
name: "FileStore",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Access = table.Column<int>(type: "int", nullable: false, comment: "通道"),
|
AbsolutePath = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "绝对路径"),
|
RelativePath = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "相对路径"),
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "名称"),
|
Extension = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "扩展名"),
|
ContentType = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "内容类型"),
|
FileType = table.Column<int>(type: "int", nullable: false, comment: "文件类型"),
|
Length = table.Column<long>(type: "bigint", nullable: false, comment: "文件大小(字节)"),
|
Hash = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "哈希"),
|
ImageWidth = table.Column<int>(type: "int", nullable: true, comment: "宽度(像素)"),
|
ImageHeight = table.Column<int>(type: "int", nullable: true, comment: "高度(像素)"),
|
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_FileStore", x => x.Id);
|
},
|
comment: "文件存储");
|
|
migrationBuilder.CreateTable(
|
name: "Menu",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "上级Id"),
|
Path = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "菜单路径"),
|
Code = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "编号"),
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "名称"),
|
Type = table.Column<int>(type: "int", nullable: false, comment: "类型"),
|
VisitLevel = table.Column<int>(type: "int", nullable: false, comment: "访问级别"),
|
Icon = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "图标"),
|
Url = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "链接地址"),
|
Group = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "分组名称(用于按钮/字段)"),
|
Location = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "位置(用于按钮)"),
|
Width = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "列宽(用于按钮/列/元素)"),
|
IsDisabled = table.Column<bool>(type: "bit", nullable: false, comment: "是否禁用"),
|
IsHidden = table.Column<bool>(type: "bit", nullable: false, comment: "是否隐藏"),
|
IsCache = table.Column<bool>(type: "bit", nullable: false, comment: "是否缓存"),
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注"),
|
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_Menu", x => x.Id);
|
table.ForeignKey(
|
name: "FK_Menu_Menu_ParentId",
|
column: x => x.ParentId,
|
principalTable: "Menu",
|
principalColumn: "Id");
|
},
|
comment: "菜单");
|
|
migrationBuilder.CreateTable(
|
name: "Resource",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Service = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
Code = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
Method = table.Column<int>(type: "int", nullable: false),
|
Route = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
RequestTypeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
ResponseTypeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
IsExpired = 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_Resource", x => x.Id);
|
});
|
|
migrationBuilder.CreateTable(
|
name: "Role",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "名称"),
|
UserType = table.Column<int>(type: "int", nullable: false, comment: "用户类型"),
|
ClientType = table.Column<int>(type: "int", nullable: false, comment: "客户端类型"),
|
MinLevel = table.Column<int>(type: "int", nullable: false, comment: "最低级别"),
|
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_Role", x => x.Id);
|
},
|
comment: "角色");
|
|
migrationBuilder.CreateTable(
|
name: "DictionaryData",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
CategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "类别Id"),
|
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "上级Id"),
|
Path = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字典路径"),
|
Code = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true, comment: "编号"),
|
Content = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "显示内容"),
|
Field1 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段1"),
|
Field2 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段2"),
|
Field3 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段3"),
|
Field4 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段4"),
|
Field5 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段5"),
|
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_DictionaryData", x => x.Id);
|
table.ForeignKey(
|
name: "FK_DictionaryData_DictionaryCategory_CategoryId",
|
column: x => x.CategoryId,
|
principalTable: "DictionaryCategory",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_DictionaryData_DictionaryData_ParentId",
|
column: x => x.ParentId,
|
principalTable: "DictionaryData",
|
principalColumn: "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"),
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "名称"),
|
VirtualPath = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "虚拟路径"),
|
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_FileVirtualPath", x => x.Id);
|
table.ForeignKey(
|
name: "FK_FileVirtualPath_FileStore_StoreId",
|
column: x => x.StoreId,
|
principalTable: "FileStore",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "文件虚拟路径");
|
|
migrationBuilder.CreateTable(
|
name: "RoleMenu",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "角色Id"),
|
MenuId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "菜单Id"),
|
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_RoleMenu", x => x.Id);
|
table.ForeignKey(
|
name: "FK_RoleMenu_Menu_MenuId",
|
column: x => x.MenuId,
|
principalTable: "Menu",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_RoleMenu_Role_RoleId",
|
column: x => x.RoleId,
|
principalTable: "Role",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "角色菜单");
|
|
migrationBuilder.CreateTable(
|
name: "RoleResource",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
MenuId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
DataPower = table.Column<int>(type: "int", nullable: true),
|
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_RoleResource", x => x.Id);
|
table.ForeignKey(
|
name: "FK_RoleResource_Menu_MenuId",
|
column: x => x.MenuId,
|
principalTable: "Menu",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_RoleResource_Role_RoleId",
|
column: x => x.RoleId,
|
principalTable: "Role",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
});
|
|
migrationBuilder.CreateTable(
|
name: "Enterprise",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
EnterpriseRealMethod = table.Column<int>(type: "int", nullable: true, comment: "企业认证方式"),
|
EnterpriseName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "企业全称"),
|
SocietyCreditCode = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: false, comment: "统一社会信用代码"),
|
LicenseImageId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "营业执照照片Id"),
|
LegalPerson = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "法人姓名"),
|
PersonalRealMethod = table.Column<int>(type: "int", nullable: true, comment: "法人或经办人实名方式"),
|
Name = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "法人或经办人姓名"),
|
Identity = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true, comment: "法人或经办人身份证号"),
|
IdentityImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "法人或经办人身份证人像面Id"),
|
IdentityBackImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "法人或经办人身份证国徽面Id"),
|
BankCard = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "法人或经办人银行卡号"),
|
BankCardImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "法人或经办人银行卡照片Id"),
|
PhoneNumber = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true, comment: "法人或经办人手机号"),
|
Proxy = table.Column<bool>(type: "bit", nullable: true, comment: "是否委托经办人"),
|
ProxyPowerAttorneyUrl = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "企业授权书"),
|
RealAccess = table.Column<int>(type: "int", nullable: true, comment: "实名通道"),
|
IsReal = table.Column<bool>(type: "bit", nullable: false, comment: "是否实名"),
|
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_Enterprise", x => x.Id);
|
table.ForeignKey(
|
name: "FK_Enterprise_FileVirtualPath_IdentityBackImgId",
|
column: x => x.IdentityBackImgId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_Enterprise_FileVirtualPath_IdentityImgId",
|
column: x => x.IdentityImgId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_Enterprise_FileVirtualPath_LicenseImageId",
|
column: x => x.LicenseImageId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
},
|
comment: "企业");
|
|
migrationBuilder.CreateTable(
|
name: "UserAuth",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
AvatarId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "头像Id"),
|
Name = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "姓名"),
|
UserName = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "用户名"),
|
PhoneNumber = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true, comment: "手机号"),
|
IsCheckPhoneNumber = table.Column<bool>(type: "bit", nullable: false, comment: "是否已校验手机号"),
|
Password = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "密码"),
|
Identity = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "身份证号"),
|
IdentityImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "身份证人像面Id"),
|
IdentityBackImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "身份证国徽面Id"),
|
BankCard = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "银行卡号"),
|
BankCardImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "银行卡照片Id"),
|
RealAccess = table.Column<int>(type: "int", nullable: true, comment: "实名通道"),
|
IsReal = table.Column<bool>(type: "bit", nullable: false, comment: "是否实名"),
|
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_UserAuth", x => x.Id);
|
table.ForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_AvatarId",
|
column: x => x.AvatarId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_BankCardImgId",
|
column: x => x.BankCardImgId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_IdentityBackImgId",
|
column: x => x.IdentityBackImgId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_UserAuth_FileVirtualPath_IdentityImgId",
|
column: x => x.IdentityImgId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
},
|
comment: "用户");
|
|
migrationBuilder.CreateTable(
|
name: "Department",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "上级Id"),
|
Path = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "部门路径"),
|
EnterpriseId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "企业Id"),
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "名称"),
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注"),
|
IsDisabled = table.Column<bool>(type: "bit", nullable: false, comment: "是否禁用"),
|
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_Department", x => x.Id);
|
table.ForeignKey(
|
name: "FK_Department_Department_ParentId",
|
column: x => x.ParentId,
|
principalTable: "Department",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_Department_Enterprise_EnterpriseId",
|
column: x => x.EnterpriseId,
|
principalTable: "Enterprise",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "部门");
|
|
migrationBuilder.CreateTable(
|
name: "TaskInfo",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
EnterpriseId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "企业Id"),
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "任务名称"),
|
BillingMethod = table.Column<int>(type: "int", nullable: false, comment: "计费方式"),
|
ServiceFee = table.Column<decimal>(type: "decimal(18,2)", nullable: false, comment: "服务费"),
|
SettlementCycle = table.Column<int>(type: "int", nullable: false, comment: "结算方式"),
|
AgeMinLimit = table.Column<int>(type: "int", nullable: false, comment: "年龄范围最小"),
|
AgeMaxLimit = table.Column<int>(type: "int", nullable: false, comment: "年龄范围大"),
|
GenderLimit = table.Column<int>(type: "int", nullable: false, comment: "性别要求"),
|
CityId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "任务地点所属区域Id"),
|
Address = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "任务地点详细地址"),
|
BeginTime = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "任务开始时间"),
|
EndTime = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "任务结束时间"),
|
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_TaskInfo", x => x.Id);
|
table.ForeignKey(
|
name: "FK_TaskInfo_DictionaryData_CityId",
|
column: x => x.CityId,
|
principalTable: "DictionaryData",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_TaskInfo_Enterprise_EnterpriseId",
|
column: x => x.EnterpriseId,
|
principalTable: "Enterprise",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "任务信息");
|
|
migrationBuilder.CreateTable(
|
name: "UserInfo",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
UserAuthId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户Id"),
|
Type = table.Column<int>(type: "int", nullable: false, comment: "用户类型"),
|
EnterpriseId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "企业Id"),
|
WxmpOpenId = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "微信开放Id"),
|
Level = table.Column<int>(type: "int", nullable: false, comment: "级别"),
|
PersonalIdentityId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "身份Id"),
|
EducationalBackgroundId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "学历Id"),
|
CityId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "常驻城市Id"),
|
FreeTime = table.Column<int>(type: "int", nullable: true, comment: "空闲时间"),
|
JobSeekingStatus = table.Column<int>(type: "int", nullable: true, comment: "求职状态"),
|
WorkSeniority = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "工作资历"),
|
WorkExperience = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "工作经验"),
|
Height = table.Column<int>(type: "int", nullable: true, comment: "身高"),
|
Weight = table.Column<int>(type: "int", nullable: true, comment: "体重"),
|
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_UserInfo", x => x.Id);
|
table.ForeignKey(
|
name: "FK_UserInfo_DictionaryData_CityId",
|
column: x => x.CityId,
|
principalTable: "DictionaryData",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_UserInfo_DictionaryData_EducationalBackgroundId",
|
column: x => x.EducationalBackgroundId,
|
principalTable: "DictionaryData",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_UserInfo_DictionaryData_PersonalIdentityId",
|
column: x => x.PersonalIdentityId,
|
principalTable: "DictionaryData",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_UserInfo_Enterprise_EnterpriseId",
|
column: x => x.EnterpriseId,
|
principalTable: "Enterprise",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_UserInfo_UserAuth_UserAuthId",
|
column: x => x.UserAuthId,
|
principalTable: "UserAuth",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "用户信息");
|
|
migrationBuilder.CreateTable(
|
name: "TaskInfoBenefit",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
TaskInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "任务Id"),
|
BenefitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "福利Id"),
|
BenefitId1 = table.Column<Guid>(type: "uniqueidentifier", 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_TaskInfoBenefit", x => x.Id);
|
table.ForeignKey(
|
name: "FK_TaskInfoBenefit_DictionaryData_BenefitId1",
|
column: x => x.BenefitId1,
|
principalTable: "DictionaryData",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_TaskInfoBenefit_TaskInfo_BenefitId",
|
column: x => x.BenefitId,
|
principalTable: "TaskInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Restrict);
|
},
|
comment: "任务福利");
|
|
migrationBuilder.CreateTable(
|
name: "TaskInfoCredentialLimit",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
TaskInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "任务Id"),
|
TypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "证书类型Id"),
|
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_TaskInfoCredentialLimit", x => x.Id);
|
table.ForeignKey(
|
name: "FK_TaskInfoCredentialLimit_DictionaryData_TypeId",
|
column: x => x.TypeId,
|
principalTable: "DictionaryData",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_TaskInfoCredentialLimit_TaskInfo_TaskInfoId",
|
column: x => x.TaskInfoId,
|
principalTable: "TaskInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
});
|
|
migrationBuilder.CreateTable(
|
name: "TaskInfoUser",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
TaskInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "任务Id"),
|
UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
|
HireStatus = table.Column<int>(type: "int", nullable: false, comment: "录用状态"),
|
HireTime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "录用时间"),
|
SignContractStatus = table.Column<int>(type: "int", nullable: true, comment: "签约状态"),
|
SignContractTime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "签约时间"),
|
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_TaskInfoUser", x => x.Id);
|
table.ForeignKey(
|
name: "FK_TaskInfoUser_TaskInfo_TaskInfoId",
|
column: x => x.TaskInfoId,
|
principalTable: "TaskInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_TaskInfoUser_UserInfo_UserInfoId",
|
column: x => x.UserInfoId,
|
principalTable: "UserInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "任务用户信息");
|
|
migrationBuilder.CreateTable(
|
name: "UserInfoBankCard",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
|
Code = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "银行卡号"),
|
Bank = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "开户行"),
|
PhoneNumber = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: false, comment: "银行预留手机号"),
|
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_UserInfoBankCard", x => x.Id);
|
table.ForeignKey(
|
name: "FK_UserInfoBankCard_UserInfo_UserInfoId",
|
column: x => x.UserInfoId,
|
principalTable: "UserInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "用户银行卡信息");
|
|
migrationBuilder.CreateTable(
|
name: "UserInfoCredential",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
|
TypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "证书类型Id"),
|
Code = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "证书编号"),
|
IsForever = table.Column<bool>(type: "bit", nullable: false, comment: "永久证书"),
|
StartDate = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "开始日期"),
|
EndDate = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "结束日期"),
|
IssueUnit = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "发证单位"),
|
ImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "证书正面照片Id"),
|
BackImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "证书反面照片Id"),
|
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_UserInfoCredential", x => x.Id);
|
table.ForeignKey(
|
name: "FK_UserInfoCredential_DictionaryData_TypeId",
|
column: x => x.TypeId,
|
principalTable: "DictionaryData",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_UserInfoCredential_FileVirtualPath_BackImgId",
|
column: x => x.BackImgId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id");
|
table.ForeignKey(
|
name: "FK_UserInfoCredential_FileVirtualPath_ImgId",
|
column: x => x.ImgId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_UserInfoCredential_UserInfo_UserInfoId",
|
column: x => x.UserInfoId,
|
principalTable: "UserInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "用户信息资格证书");
|
|
migrationBuilder.CreateTable(
|
name: "UserInfoDepartment",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
|
DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "部门Id"),
|
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_UserInfoDepartment", x => x.Id);
|
table.ForeignKey(
|
name: "FK_UserInfoDepartment_Department_DepartmentId",
|
column: x => x.DepartmentId,
|
principalTable: "Department",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_UserInfoDepartment_UserInfo_UserInfoId",
|
column: x => x.UserInfoId,
|
principalTable: "UserInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "用户信息部门");
|
|
migrationBuilder.CreateTable(
|
name: "UserInfoExpectJob",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
|
PersonalIdentityId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "期望岗位Id"),
|
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_UserInfoExpectJob", x => x.Id);
|
table.ForeignKey(
|
name: "FK_UserInfoExpectJob_DictionaryData_PersonalIdentityId",
|
column: x => x.PersonalIdentityId,
|
principalTable: "DictionaryData",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_UserInfoExpectJob_UserInfo_UserInfoId",
|
column: x => x.UserInfoId,
|
principalTable: "UserInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "用户信息期望岗位");
|
|
migrationBuilder.CreateTable(
|
name: "UserInfoPhoto",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
|
ImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "照片Id"),
|
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_UserInfoPhoto", x => x.Id);
|
table.ForeignKey(
|
name: "FK_UserInfoPhoto_FileVirtualPath_ImgId",
|
column: x => x.ImgId,
|
principalTable: "FileVirtualPath",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_UserInfoPhoto_UserInfo_UserInfoId",
|
column: x => x.UserInfoId,
|
principalTable: "UserInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "用户信息生活照");
|
|
migrationBuilder.CreateTable(
|
name: "UserInfoRole",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "角色Id"),
|
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_UserInfoRole", x => x.Id);
|
table.ForeignKey(
|
name: "FK_UserInfoRole_Role_RoleId",
|
column: x => x.RoleId,
|
principalTable: "Role",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
table.ForeignKey(
|
name: "FK_UserInfoRole_UserInfo_UserInfoId",
|
column: x => x.UserInfoId,
|
principalTable: "UserInfo",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
},
|
comment: "用户信息角色");
|
|
migrationBuilder.InsertData(
|
table: "UserAuth",
|
columns: new[] { "Id", "AvatarId", "BankCard", "BankCardImgId", "CreatedTime", "CreatedUserInfoId", "Identity", "IdentityBackImgId", "IdentityImgId", "IsCheckPhoneNumber", "IsDeleted", "IsReal", "Name", "Password", "PhoneNumber", "RealAccess", "Sort", "TraceId", "UpdatedTime", "UpdatedUserInfoId", "UserName" },
|
values: new object[] { new Guid("11111111-1111-1111-1111-111111111111"), null, null, null, new DateTimeOffset(new DateTime(2000, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), null, null, null, null, false, false, false, "管理员", null, null, null, 0, null, null, null, "admin" });
|
|
migrationBuilder.InsertData(
|
table: "UserInfo",
|
columns: new[] { "Id", "CityId", "CreatedTime", "CreatedUserInfoId", "EducationalBackgroundId", "EnterpriseId", "FreeTime", "Height", "IsDeleted", "JobSeekingStatus", "Level", "PersonalIdentityId", "Sort", "TraceId", "Type", "UpdatedTime", "UpdatedUserInfoId", "UserAuthId", "Weight", "WorkExperience", "WorkSeniority", "WxmpOpenId" },
|
values: new object[] { new Guid("11111111-1111-1111-1111-111111111112"), null, new DateTimeOffset(new DateTime(2000, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), null, null, null, null, null, false, null, 999, null, 0, null, 100, null, null, new Guid("11111111-1111-1111-1111-111111111111"), null, null, null, null });
|
|
migrationBuilder.CreateIndex(
|
name: "IX_Department_EnterpriseId",
|
table: "Department",
|
column: "EnterpriseId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_Department_ParentId",
|
table: "Department",
|
column: "ParentId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_DictionaryData_CategoryId",
|
table: "DictionaryData",
|
column: "CategoryId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_DictionaryData_ParentId",
|
table: "DictionaryData",
|
column: "ParentId");
|
|
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.CreateIndex(
|
name: "IX_Menu_ParentId",
|
table: "Menu",
|
column: "ParentId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_RoleMenu_MenuId",
|
table: "RoleMenu",
|
column: "MenuId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_RoleMenu_RoleId",
|
table: "RoleMenu",
|
column: "RoleId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_RoleResource_MenuId",
|
table: "RoleResource",
|
column: "MenuId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_RoleResource_RoleId",
|
table: "RoleResource",
|
column: "RoleId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_TaskInfo_CityId",
|
table: "TaskInfo",
|
column: "CityId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_TaskInfo_EnterpriseId",
|
table: "TaskInfo",
|
column: "EnterpriseId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_TaskInfoBenefit_BenefitId",
|
table: "TaskInfoBenefit",
|
column: "BenefitId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_TaskInfoBenefit_BenefitId1",
|
table: "TaskInfoBenefit",
|
column: "BenefitId1");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_TaskInfoCredentialLimit_TaskInfoId",
|
table: "TaskInfoCredentialLimit",
|
column: "TaskInfoId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_TaskInfoCredentialLimit_TypeId",
|
table: "TaskInfoCredentialLimit",
|
column: "TypeId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_TaskInfoUser_TaskInfoId",
|
table: "TaskInfoUser",
|
column: "TaskInfoId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_TaskInfoUser_UserInfoId",
|
table: "TaskInfoUser",
|
column: "UserInfoId");
|
|
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_UserInfo_CityId",
|
table: "UserInfo",
|
column: "CityId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfo_EducationalBackgroundId",
|
table: "UserInfo",
|
column: "EducationalBackgroundId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfo_EnterpriseId",
|
table: "UserInfo",
|
column: "EnterpriseId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfo_PersonalIdentityId",
|
table: "UserInfo",
|
column: "PersonalIdentityId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfo_UserAuthId",
|
table: "UserInfo",
|
column: "UserAuthId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoBankCard_UserInfoId",
|
table: "UserInfoBankCard",
|
column: "UserInfoId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoCredential_BackImgId",
|
table: "UserInfoCredential",
|
column: "BackImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoCredential_ImgId",
|
table: "UserInfoCredential",
|
column: "ImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoCredential_TypeId",
|
table: "UserInfoCredential",
|
column: "TypeId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoCredential_UserInfoId",
|
table: "UserInfoCredential",
|
column: "UserInfoId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoDepartment_DepartmentId",
|
table: "UserInfoDepartment",
|
column: "DepartmentId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoDepartment_UserInfoId",
|
table: "UserInfoDepartment",
|
column: "UserInfoId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoExpectJob_PersonalIdentityId",
|
table: "UserInfoExpectJob",
|
column: "PersonalIdentityId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoExpectJob_UserInfoId",
|
table: "UserInfoExpectJob",
|
column: "UserInfoId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoPhoto_ImgId",
|
table: "UserInfoPhoto",
|
column: "ImgId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoPhoto_UserInfoId",
|
table: "UserInfoPhoto",
|
column: "UserInfoId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoRole_RoleId",
|
table: "UserInfoRole",
|
column: "RoleId");
|
|
migrationBuilder.CreateIndex(
|
name: "IX_UserInfoRole_UserInfoId",
|
table: "UserInfoRole",
|
column: "UserInfoId");
|
}
|
|
/// <inheritdoc />
|
protected override void Down(MigrationBuilder migrationBuilder)
|
{
|
migrationBuilder.DropTable(
|
name: "Resource");
|
|
migrationBuilder.DropTable(
|
name: "RoleMenu");
|
|
migrationBuilder.DropTable(
|
name: "RoleResource");
|
|
migrationBuilder.DropTable(
|
name: "TaskInfoBenefit");
|
|
migrationBuilder.DropTable(
|
name: "TaskInfoCredentialLimit");
|
|
migrationBuilder.DropTable(
|
name: "TaskInfoUser");
|
|
migrationBuilder.DropTable(
|
name: "UserInfoBankCard");
|
|
migrationBuilder.DropTable(
|
name: "UserInfoCredential");
|
|
migrationBuilder.DropTable(
|
name: "UserInfoDepartment");
|
|
migrationBuilder.DropTable(
|
name: "UserInfoExpectJob");
|
|
migrationBuilder.DropTable(
|
name: "UserInfoPhoto");
|
|
migrationBuilder.DropTable(
|
name: "UserInfoRole");
|
|
migrationBuilder.DropTable(
|
name: "Menu");
|
|
migrationBuilder.DropTable(
|
name: "TaskInfo");
|
|
migrationBuilder.DropTable(
|
name: "Department");
|
|
migrationBuilder.DropTable(
|
name: "Role");
|
|
migrationBuilder.DropTable(
|
name: "UserInfo");
|
|
migrationBuilder.DropTable(
|
name: "DictionaryData");
|
|
migrationBuilder.DropTable(
|
name: "Enterprise");
|
|
migrationBuilder.DropTable(
|
name: "UserAuth");
|
|
migrationBuilder.DropTable(
|
name: "DictionaryCategory");
|
|
migrationBuilder.DropTable(
|
name: "FileVirtualPath");
|
|
migrationBuilder.DropTable(
|
name: "FileStore");
|
}
|
}
|
}
|