using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace FlexJobApi.Database.Migrations.Migrations
{
///
public partial class UpdateUser0801 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DictionaryCategory",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Code = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "编号"),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "名称"),
FieldNames = table.Column(type: "nvarchar(max)", nullable: true, comment: "字段名(逗号隔开)"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
Access = table.Column(type: "int", nullable: false, comment: "通道"),
AbsolutePath = table.Column(type: "nvarchar(max)", nullable: false, comment: "绝对路径"),
RelativePath = table.Column(type: "nvarchar(max)", nullable: true, comment: "相对路径"),
Name = table.Column(type: "nvarchar(max)", nullable: false, comment: "名称"),
Extension = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "扩展名"),
ContentType = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "内容类型"),
FileType = table.Column(type: "int", nullable: false, comment: "文件类型"),
Length = table.Column(type: "bigint", nullable: false, comment: "文件大小(字节)"),
Hash = table.Column(type: "nvarchar(max)", nullable: false, comment: "哈希"),
ImageWidth = table.Column(type: "int", nullable: true, comment: "宽度(像素)"),
ImageHeight = table.Column(type: "int", nullable: true, comment: "高度(像素)"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
ParentId = table.Column(type: "uniqueidentifier", nullable: true, comment: "上级Id"),
Path = table.Column(type: "nvarchar(max)", nullable: true, comment: "菜单路径"),
Code = table.Column(type: "nvarchar(max)", nullable: false, comment: "编号"),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "名称"),
Type = table.Column(type: "int", nullable: false, comment: "类型"),
VisitLevel = table.Column(type: "int", nullable: false, comment: "访问级别"),
Icon = table.Column(type: "nvarchar(max)", nullable: true, comment: "图标"),
Url = table.Column(type: "nvarchar(max)", nullable: true, comment: "链接地址"),
Group = table.Column(type: "nvarchar(max)", nullable: true, comment: "分组名称(用于按钮/字段)"),
Location = table.Column(type: "nvarchar(max)", nullable: true, comment: "位置(用于按钮)"),
Width = table.Column(type: "nvarchar(max)", nullable: true, comment: "列宽(用于按钮/列/元素)"),
IsDisabled = table.Column(type: "bit", nullable: false, comment: "是否禁用"),
IsHidden = table.Column(type: "bit", nullable: false, comment: "是否隐藏"),
IsCache = table.Column(type: "bit", nullable: false, comment: "是否缓存"),
Remark = table.Column(type: "nvarchar(max)", nullable: true, comment: "备注"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
Service = table.Column(type: "nvarchar(max)", nullable: false),
Code = table.Column(type: "nvarchar(max)", nullable: false),
Name = table.Column(type: "nvarchar(max)", nullable: false),
Method = table.Column(type: "int", nullable: false),
Route = table.Column(type: "nvarchar(max)", nullable: false),
RequestTypeName = table.Column(type: "nvarchar(max)", nullable: false),
ResponseTypeName = table.Column(type: "nvarchar(max)", nullable: false),
IsExpired = table.Column(type: "bit", nullable: false),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(type: "bit", nullable: false, comment: "是否删除")
},
constraints: table =>
{
table.PrimaryKey("PK_Resource", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Role",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "名称"),
UserType = table.Column(type: "int", nullable: false, comment: "用户类型"),
ClientType = table.Column(type: "int", nullable: false, comment: "客户端类型"),
MinLevel = table.Column(type: "int", nullable: false, comment: "最低级别"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
CategoryId = table.Column(type: "uniqueidentifier", nullable: false, comment: "类别Id"),
ParentId = table.Column(type: "uniqueidentifier", nullable: true, comment: "上级Id"),
Path = table.Column(type: "nvarchar(max)", nullable: true, comment: "字典路径"),
Code = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true, comment: "编号"),
Content = table.Column(type: "nvarchar(max)", nullable: false, comment: "显示内容"),
Field1 = table.Column(type: "nvarchar(max)", nullable: true, comment: "字段1"),
Field2 = table.Column(type: "nvarchar(max)", nullable: true, comment: "字段2"),
Field3 = table.Column(type: "nvarchar(max)", nullable: true, comment: "字段3"),
Field4 = table.Column(type: "nvarchar(max)", nullable: true, comment: "字段4"),
Field5 = table.Column(type: "nvarchar(max)", nullable: true, comment: "字段5"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
StoreId = table.Column(type: "uniqueidentifier", nullable: false, comment: "文件存储Id"),
Name = table.Column(type: "nvarchar(max)", nullable: false, comment: "名称"),
VirtualPath = table.Column(type: "nvarchar(max)", nullable: false, comment: "虚拟路径"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
RoleId = table.Column(type: "uniqueidentifier", nullable: false, comment: "角色Id"),
MenuId = table.Column(type: "uniqueidentifier", nullable: false, comment: "菜单Id"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
RoleId = table.Column(type: "uniqueidentifier", nullable: false),
MenuId = table.Column(type: "uniqueidentifier", nullable: false),
DataPower = table.Column(type: "int", nullable: true),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
EnterpriseRealMethod = table.Column(type: "int", nullable: true, comment: "企业认证方式"),
EnterpriseName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "企业全称"),
SocietyCreditCode = table.Column(type: "nvarchar(18)", maxLength: 18, nullable: false, comment: "统一社会信用代码"),
LicenseImageId = table.Column(type: "uniqueidentifier", nullable: true, comment: "营业执照照片Id"),
LegalPerson = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "法人姓名"),
PersonalRealMethod = table.Column(type: "int", nullable: true, comment: "法人或经办人实名方式"),
Name = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "法人或经办人姓名"),
Identity = table.Column(type: "nvarchar(18)", maxLength: 18, nullable: true, comment: "法人或经办人身份证号"),
IdentityImgId = table.Column(type: "uniqueidentifier", nullable: true, comment: "法人或经办人身份证人像面Id"),
IdentityBackImgId = table.Column(type: "uniqueidentifier", nullable: true, comment: "法人或经办人身份证国徽面Id"),
BankCard = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "法人或经办人银行卡号"),
BankCardImgId = table.Column(type: "uniqueidentifier", nullable: true, comment: "法人或经办人银行卡照片Id"),
PhoneNumber = table.Column(type: "nvarchar(11)", maxLength: 11, nullable: true, comment: "法人或经办人手机号"),
Proxy = table.Column(type: "bit", nullable: true, comment: "是否委托经办人"),
ProxyPowerAttorneyUrl = table.Column(type: "nvarchar(max)", nullable: true, comment: "企业授权书"),
RealAccess = table.Column(type: "int", nullable: true, comment: "实名通道"),
IsReal = table.Column(type: "bit", nullable: false, comment: "是否实名"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
AvatarId = table.Column(type: "uniqueidentifier", nullable: true, comment: "头像Id"),
Name = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "姓名"),
UserName = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "用户名"),
PhoneNumber = table.Column(type: "nvarchar(11)", maxLength: 11, nullable: true, comment: "手机号"),
IsCheckPhoneNumber = table.Column(type: "bit", nullable: false, comment: "是否已校验手机号"),
Password = table.Column(type: "nvarchar(max)", nullable: true, comment: "密码"),
Identity = table.Column(type: "nvarchar(max)", nullable: true, comment: "身份证号"),
IdentityImgId = table.Column(type: "uniqueidentifier", nullable: true, comment: "身份证人像面Id"),
IdentityBackImgId = table.Column(type: "uniqueidentifier", nullable: true, comment: "身份证国徽面Id"),
BankCard = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "银行卡号"),
BankCardImgId = table.Column(type: "uniqueidentifier", nullable: true, comment: "银行卡照片Id"),
RealAccess = table.Column(type: "int", nullable: true, comment: "实名通道"),
IsReal = table.Column(type: "bit", nullable: false, comment: "是否实名"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
ParentId = table.Column(type: "uniqueidentifier", nullable: true, comment: "上级Id"),
Path = table.Column(type: "nvarchar(max)", nullable: true, comment: "部门路径"),
EnterpriseId = table.Column(type: "uniqueidentifier", nullable: false, comment: "企业Id"),
Name = table.Column(type: "nvarchar(max)", nullable: false, comment: "名称"),
Remark = table.Column(type: "nvarchar(max)", nullable: true, comment: "备注"),
IsDisabled = table.Column(type: "bit", nullable: false, comment: "是否禁用"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
EnterpriseId = table.Column(type: "uniqueidentifier", nullable: false, comment: "企业Id"),
Name = table.Column(type: "nvarchar(max)", nullable: false, comment: "任务名称"),
BillingMethod = table.Column(type: "int", nullable: false, comment: "计费方式"),
ServiceFee = table.Column(type: "decimal(18,2)", nullable: false, comment: "服务费"),
SettlementCycle = table.Column(type: "int", nullable: false, comment: "结算方式"),
AgeMinLimit = table.Column(type: "int", nullable: false, comment: "年龄范围最小"),
AgeMaxLimit = table.Column(type: "int", nullable: false, comment: "年龄范围大"),
GenderLimit = table.Column(type: "int", nullable: false, comment: "性别要求"),
CityId = table.Column(type: "uniqueidentifier", nullable: false, comment: "任务地点所属区域Id"),
Address = table.Column(type: "nvarchar(max)", nullable: true, comment: "任务地点详细地址"),
BeginTime = table.Column(type: "datetime2", nullable: false, comment: "任务开始时间"),
EndTime = table.Column(type: "datetime2", nullable: false, comment: "任务结束时间"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
UserAuthId = table.Column(type: "uniqueidentifier", nullable: false, comment: "用户Id"),
Type = table.Column(type: "int", nullable: false, comment: "用户类型"),
EnterpriseId = table.Column(type: "uniqueidentifier", nullable: true, comment: "企业Id"),
WxmpOpenId = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "微信开放Id"),
Level = table.Column(type: "int", nullable: false, comment: "级别"),
PersonalIdentityId = table.Column(type: "uniqueidentifier", nullable: true, comment: "身份Id"),
EducationalBackgroundId = table.Column(type: "uniqueidentifier", nullable: true, comment: "学历Id"),
CityId = table.Column(type: "uniqueidentifier", nullable: true, comment: "常驻城市Id"),
FreeTime = table.Column(type: "int", nullable: true, comment: "空闲时间"),
JobSeekingStatus = table.Column(type: "int", nullable: true, comment: "求职状态"),
WorkSeniority = table.Column(type: "nvarchar(max)", nullable: true, comment: "工作资历"),
WorkExperience = table.Column(type: "nvarchar(max)", nullable: true, comment: "工作经验"),
Height = table.Column(type: "int", nullable: true, comment: "身高"),
Weight = table.Column(type: "int", nullable: true, comment: "体重"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
TaskInfoId = table.Column(type: "uniqueidentifier", nullable: false, comment: "任务Id"),
BenefitId = table.Column(type: "uniqueidentifier", nullable: false, comment: "福利Id"),
BenefitId1 = table.Column(type: "uniqueidentifier", nullable: false),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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(type: "uniqueidentifier", nullable: false),
TaskInfoId = table.Column(type: "uniqueidentifier", nullable: false, comment: "任务Id"),
TypeId = table.Column(type: "uniqueidentifier", nullable: true, comment: "证书类型Id"),
CreatedTime = table.Column(type: "datetimeoffset", nullable: false),
UpdatedTime = table.Column(type: "datetimeoffset", nullable: true),
Sort = table.Column(type: "int", nullable: false, comment: "排序"),
TraceId = table.Column(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
CreatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
UpdatedUserInfoId = table.Column(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
IsDeleted = table.Column(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