修复删除文件某些情况下未删除文件或删除多文件问题,完善菜单功能种子数据

This commit is contained in:
lemon
2025-04-07 16:40:51 +08:00
parent 6e72152f3a
commit b61a6c33bc
18 changed files with 2542 additions and 27965 deletions

View File

@@ -9,6 +9,7 @@
<ItemGroup>
<PackageReference Include="FreeSql" Version="3.2.833" />
<PackageReference Include="FreeSql.Provider.MySql" Version="3.2.833" />
<PackageReference Include="FreeSql.Provider.Odbc" Version="3.2.833" />
<PackageReference Include="FreeSql.Provider.PostgreSQL" Version="3.2.833" />
<PackageReference Include="FreeSql.Provider.SqlServer" Version="3.2.833" />

View File

@@ -2,13 +2,13 @@
using System.Text;
var connectionString =
"Server=.;Database=hzy_microservices_sqlserver_20230227;User ID=sa;Password=123456;MultipleActiveResultSets=true;Encrypt=True;TrustServerCertificate=True;";
"Server=localhost; port=3306; Database=hzy_admin_mysql_20230227; uid=root; pwd=123456; Convert Zero Datetime=False";
//EnableLegacyTimestampBehavior 启动旧行为,避免时区问题,存储时间报错
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
IFreeSql fsql = new FreeSql.FreeSqlBuilder()
.UseConnectionString(FreeSql.DataType.PostgreSQL, connectionString)
.UseConnectionString(FreeSql.DataType.MySql, connectionString)
.UseAutoSyncStructure(false) //自动同步实体结构到数据库
.Build(); //请务必定义成 Singleton 单例模式

View File

@@ -76,8 +76,8 @@ public class FileManager : IFileManager, ITransientDependency
{
dir = RemoveStartWith(dir);
_fileManagerContext.FileDir += dir;
_fileManagerContext.RequestPath += dir;
_fileManagerContext.FileDir = $"{RemoveEndWith(GetFilePath(_fileOptions.DirectoryUrl))}/{dir}";
_fileManagerContext.RequestPath = $"{RemoveEndWith(_fileOptions.RequestPath)}/{dir}";
if (!Directory.Exists(_fileManagerContext.FileDir))
{
Directory.CreateDirectory(_fileManagerContext.FileDir);
@@ -173,4 +173,14 @@ public class FileManager : IFileManager, ITransientDependency
return str;
}
private static string RemoveEndWith(string str)
{
if (str.EndsWith('/') || str.EndsWith('\\'))
{
return str[0..^1];
}
return str;
}
}

View File

@@ -15,28 +15,29 @@ public static class FileManagerContextExtensions
return Path.Combine(context.FileDir, fileName);
}
public static (List<string> deleteFiles, Exception? ex) FileDelete(this FileManagerContext context, IEnumerable<string?> fileNames)
public static (List<Guid> deleteFiles, Exception? ex) FileDelete(this FileManagerContext context, IEnumerable<(Guid, string)> fileNames)
{
if (string.IsNullOrWhiteSpace(context.FileDir))
{
throw new Exception("文件保存路径不能为空!");
}
var deleteFiles = new List<string>();
var deleteFiles = new List<Guid>();
try
{
foreach (var fileName in fileNames)
{
if (string.IsNullOrWhiteSpace(fileName))
if (string.IsNullOrWhiteSpace(fileName.Item2))
{
deleteFiles.Add(fileName.Item1);
continue;
}
var filePath = Path.Combine(context.FileDir, fileName);
var filePath = Path.Combine(context.FileDir, fileName.Item2);
File.Delete(filePath);
deleteFiles.Add(fileName);
deleteFiles.Add(fileName.Item1);
}
}
catch (Exception e)

View File

@@ -98,46 +98,46 @@
</member>
<member name="M:HZY.Core.UploadFile.IFileManager.AddFileExtensions(System.String[])">
<summary>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><EFBFBD>
添加文件扩展名
</summary>
<param name="fileExtensions"></param>
<returns></returns>
</member>
<member name="M:HZY.Core.UploadFile.IFileManager.AddMaxLength(System.Int64)">
<summary>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD><EFBFBD>󳤶<EFBFBD>
设置上传最大长度
</summary>
<param name="maxLength"></param>
<returns></returns>
</member>
<member name="M:HZY.Core.UploadFile.IFileManager.AddSaveFolder(System.String)">
<summary>
<EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
设置保存文件夹
</summary>
<param name="dir"></param>
<returns></returns>
</member>
<member name="M:HZY.Core.UploadFile.IFileManager.AllowAnyFileExtensions">
<summary>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ʽ
允许所有文件格式
</summary>
<returns></returns>
</member>
<member name="M:HZY.Core.UploadFile.IFileManager.BuildFileManagerContext">
<summary>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
构建文件上传上下文
</summary>
<returns></returns>
</member>
<member name="M:HZY.Core.UploadFile.IFileManager.ResetFileExtensions">
<summary>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD>)<29>ļ<EFBFBD><C4BC><EFBFBD>չ<EFBFBD><D5B9>
重置(清空)文件扩展名
</summary>
<returns></returns>
</member>
<member name="M:HZY.Core.UploadFile.IFileManager.GetServerUrl">
<summary>
<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>õķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
获取配置的服务器地址
</summary>
<returns></returns>
</member>

View File

@@ -1,4 +1,5 @@
using HZY.Host.Admin.Models.Dtos.Systems;
using System.Linq;
namespace HZY.Host.Admin.ApplicationServices.Systems;
@@ -65,20 +66,19 @@ public class SysFileService : ApplicationService<SysFile, Guid, SysFileSearchDto
.ToListAsync();
// 查找不是引用同一个文件的,文件地址
var fileNames = new List<string?>();
var deleteFileInfos = new List<(Guid, string)>();
foreach (var item in sysFiles)
{
var fileInfo = duplicateFiles.Find(w => w.Sha == item.Sha && w.Url?.ToLower() != item.Url?.ToLower());
if(fileInfo != null)
var fileInfo = duplicateFiles.Find(w => w.Sha == item.Sha && string.Equals(w.Url, item.Url, StringComparison.OrdinalIgnoreCase));
if (fileInfo == null)
{
fileNames.Add($"{item.RelativePath}{item.FileName}");
deleteFileInfos.Add((item.Id, $"{item.RelativePath}{item.FileName}".TrimStart('/')));
}
}
// 删除文件
var (deleteFiles, ex) = _fileManager
var (deleteFileIds, ex) = _fileManager
.BuildFileManagerContext()
.FileDelete(fileNames);
.FileDelete(deleteFileInfos);
// 如果删除没有报错,删除数据库记录
if (ex == null)
@@ -88,11 +88,9 @@ public class SysFileService : ApplicationService<SysFile, Guid, SysFileSearchDto
}
// 如果删除文件失败,只把删除成功的文件从数据库删除
var fileIds = sysFiles.Where(w => string.IsNullOrWhiteSpace(w.FileName) || deleteFiles.Contains(w.FileName)).Select(s => s.Id).ToList();
await Repository.SelectNoTracking.Where(w => deleteFileIds.Contains(w.Id)).ExecuteDeleteAsync();
await Repository.SelectNoTracking.Where(w => fileIds.Contains(w.Id)).ExecuteDeleteAsync();
return fileIds;
return deleteFileIds;
}
/// <summary>

View File

@@ -49,7 +49,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.5">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -1,4 +1,6 @@
namespace HZY.Repository.Admin;
using HZY.Repository.Admin.Migrations.SeedsDatas;
namespace HZY.Repository.Admin;
/// <summary>
/// 后台管理系统数据库上下文
@@ -99,5 +101,8 @@ public class AdminDbContext : DbContext, IBaseDbContext
{
var dbContextConfigAttribute = GetType().GetCustomAttribute<DbContextConfigAttribute>()!;
dbContextConfigAttribute!.OnModelCreating(modelBuilder, dbContextConfigAttribute.GetModelTypes(GetType()));
// 生成迁移文件时取消这个注释可以生成种子数据
// ModelBuilderExtensions.Seed(modelBuilder);
}
}

View File

@@ -56,20 +56,21 @@ public class AdminRepositoryStartup : StartupModule<AdminRepositoryStartup>
//if (webApplication.Environment.IsDevelopment())
//{
// // 自动迁移 (如果迁移文件有变动)
//using var scope = webApplication.Services.CreateScope();
//using var adminDbContext = scope.ServiceProvider.GetService<AdminDbContext>();
//if (adminDbContext!.Database.GetPendingMigrations().Count() > 0)
//{
// try
// using var scope = webApplication.Services.CreateScope();
// using var adminDbContext = scope.ServiceProvider.GetService<AdminDbContext>();
// if (adminDbContext!.Database.GetPendingMigrations().Count() > 0)
// {
// adminDbContext.Database.Migrate();
// }
// catch (Exception ex)
// {
// //LogUtil.Log.Error(ex.Message, ex);
// try
// {
// adminDbContext.Database.Migrate();
// }
// catch (Exception ex)
// {
// //LogUtil.Log.Error(ex.Message, ex);
// }
// }
//}
}
#endregion
#endregion
}
}

View File

@@ -1107,6 +1107,18 @@
用户与角色绑定
</summary>
</member>
<member name="T:HZY.Repository.Admin.Migrations.SqlServer_init">
<inheritdoc />
</member>
<member name="M:HZY.Repository.Admin.Migrations.SqlServer_init.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
<inheritdoc />
</member>
<member name="M:HZY.Repository.Admin.Migrations.SqlServer_init.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
<inheritdoc />
</member>
<member name="M:HZY.Repository.Admin.Migrations.SqlServer_init.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
<inheritdoc />
</member>
<member name="T:HZY.Repository.Admin.Migrations.SeedsDatas.ModelBuilderExtensions">
<summary>
EFCore 种子数据
@@ -1183,29 +1195,5 @@
父级菜单名称
</summary>
</member>
<member name="T:HZY.Repository.EntityFramework.Admin.Migrations.SqlServer_init">
<inheritdoc />
</member>
<member name="M:HZY.Repository.EntityFramework.Admin.Migrations.SqlServer_init.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
<inheritdoc />
</member>
<member name="M:HZY.Repository.EntityFramework.Admin.Migrations.SqlServer_init.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
<inheritdoc />
</member>
<member name="M:HZY.Repository.EntityFramework.Admin.Migrations.SqlServer_init.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
<inheritdoc />
</member>
<member name="T:HZY.Repository.EntityFramework.Admin.Migrations.mysql_init">
<inheritdoc />
</member>
<member name="M:HZY.Repository.EntityFramework.Admin.Migrations.mysql_init.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
<inheritdoc />
</member>
<member name="M:HZY.Repository.EntityFramework.Admin.Migrations.mysql_init.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
<inheritdoc />
</member>
<member name="M:HZY.Repository.EntityFramework.Admin.Migrations.mysql_init.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
<inheritdoc />
</member>
</members>
</doc>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,826 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace HZY.Repository.Admin.Migrations
{
/// <inheritdoc />
public partial class SqlServer_init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "flow",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Number = table.Column<int>(type: "int", nullable: true),
Code = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Remark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_flow", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "flow_approval",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
LaunchTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
FormId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FlowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FlowCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FlowName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_flow_approval", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "flow_approval_step_history",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Sort = table.Column<int>(type: "int", nullable: false),
FlowNodeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FlowNodeName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
SortMore = table.Column<int>(type: "int", nullable: false),
State = table.Column<int>(type: "int", nullable: false),
Opinions = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ApprovalDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_flow_approval_step_history", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "flow_approval_step_history_user",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FlowApprovalStepHistoryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FlowNodeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FlowNodeName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_flow_approval_step_history_user", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "flow_node",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FlowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Sort = table.Column<int>(type: "int", nullable: true),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Remark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_flow_node", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "low_code_list",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Low_Code_TableId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Low_Code_Table_InfoId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ForeignKeyTableId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ForeignKeyTableFieldName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_low_code_list", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "low_code_search",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Low_Code_TableId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Low_Code_Table_InfoId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_low_code_search", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "low_code_table",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Schema = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TableName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
EntityName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Remark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ModelPath = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ServicePath = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ControllerPath = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientIndexPath = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientInfoPath = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientServicePath = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsCover = table.Column<bool>(type: "tinyint(1)", nullable: true),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_low_code_table", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "low_code_table_info",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Low_Code_TableId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsPrimary = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsIdentity = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsNullable = table.Column<bool>(type: "tinyint(1)", nullable: false),
Position = table.Column<int>(type: "int", nullable: false),
ColumnName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Describe = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DatabaseColumnType = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CsType = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CsField = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MaxLength = table.Column<int>(type: "int", nullable: true),
DisplayName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_low_code_table_info", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "member",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Number = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Phone = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Sex = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Birthday = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Photo = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Introduce = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FilePath = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_member", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "quartz_job_task",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
GroupName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Cron = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExecuteTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
State = table.Column<bool>(type: "tinyint(1)", nullable: false),
Remark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<int>(type: "int", nullable: false),
JobPoint = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RequsetMode = table.Column<int>(type: "int", nullable: true),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_quartz_job_task", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "quartz_job_task_log",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobTaskId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Text = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_quartz_job_task_log", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_data_authority",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PermissionType = table.Column<int>(type: "int", nullable: false),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_data_authority", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_data_authority_custom",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
SysDataAuthorityId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
SysOrganizationId = table.Column<int>(type: "int", nullable: false),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_data_authority_custom", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_dictionary",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Sort = table.Column<int>(type: "int", nullable: false),
Code = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ParentId = table.Column<int>(type: "int", nullable: true),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_dictionary", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_file",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Url = table.Column<string>(type: "longtext", nullable: true, comment: "网络路径")
.Annotation("MySql:CharSet", "utf8mb4"),
RelativePath = table.Column<string>(type: "longtext", nullable: true, comment: "保存相对路径")
.Annotation("MySql:CharSet", "utf8mb4"),
FileName = table.Column<string>(type: "longtext", nullable: true, comment: "文件名称")
.Annotation("MySql:CharSet", "utf8mb4"),
OriginalName = table.Column<string>(type: "longtext", nullable: true, comment: "文件原名")
.Annotation("MySql:CharSet", "utf8mb4"),
FileSize = table.Column<string>(type: "longtext", nullable: false, comment: "文件大小")
.Annotation("MySql:CharSet", "utf8mb4"),
FileType = table.Column<string>(type: "longtext", nullable: true, comment: "文件类型")
.Annotation("MySql:CharSet", "utf8mb4"),
MimeType = table.Column<string>(type: "longtext", nullable: true, comment: "mime类型")
.Annotation("MySql:CharSet", "utf8mb4"),
Sha = table.Column<string>(type: "longtext", nullable: true, comment: "文件 Sha 编码")
.Annotation("MySql:CharSet", "utf8mb4"),
Citations = table.Column<int>(type: "int", nullable: false, comment: "引用次数"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_file", x => x.Id);
},
comment: "附件")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_function",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Number = table.Column<int>(type: "int", nullable: true),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ByName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Remark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_function", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_locale",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Key = table.Column<string>(type: "longtext", nullable: false, comment: "键")
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "longtext", nullable: true, comment: "值")
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_locale", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_menu",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
LevelCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Number = table.Column<int>(type: "int", nullable: true),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ComponentName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Url = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Router = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
JumpUrl = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Icon = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ParentId = table.Column<int>(type: "int", nullable: true),
Show = table.Column<bool>(type: "tinyint(1)", nullable: false),
Close = table.Column<bool>(type: "tinyint(1)", nullable: false),
KeepAlive = table.Column<bool>(type: "tinyint(1)", nullable: false),
State = table.Column<bool>(type: "tinyint(1)", nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
Mode = table.Column<int>(type: "int", nullable: false),
ModuleUrl = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ModuleUrlPro = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_menu", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_menu_function",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Number = table.Column<int>(type: "int", nullable: true),
MenuId = table.Column<int>(type: "int", nullable: false),
FunctionCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FunctionName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Remark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_menu_function", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_operation_log",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Api = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Ip = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Form = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FormBody = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
QueryString = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TakeUpTime = table.Column<long>(type: "bigint", nullable: false),
Browser = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
OS = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ControllerDisplayName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ActionDisplayName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_operation_log", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_organization",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
OrderNumber = table.Column<int>(type: "int", nullable: true),
LevelCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Leader = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Phone = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
State = table.Column<int>(type: "int", nullable: true),
ParentId = table.Column<int>(type: "int", nullable: true),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_organization", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_post",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Number = table.Column<int>(type: "int", nullable: true),
Code = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
State = table.Column<int>(type: "int", nullable: false),
Remarks = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_post", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_role",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Number = table.Column<int>(type: "int", nullable: true),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsAdmin = table.Column<bool>(type: "tinyint(1)", nullable: false),
Remark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DeleteLock = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_role", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_role_menu_function",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
MenuId = table.Column<int>(type: "int", nullable: false),
MenuFunctionId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_role_menu_function", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_user",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
LoginName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Password = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Phone = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
DeleteLock = table.Column<bool>(type: "tinyint(1)", nullable: false),
OrganizationId = table.Column<int>(type: "int", nullable: true),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_user", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_user_post",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PostId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_user_post", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sys_user_role",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatorUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModifierUserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_sys_user_role", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "flow");
migrationBuilder.DropTable(
name: "flow_approval");
migrationBuilder.DropTable(
name: "flow_approval_step_history");
migrationBuilder.DropTable(
name: "flow_approval_step_history_user");
migrationBuilder.DropTable(
name: "flow_node");
migrationBuilder.DropTable(
name: "low_code_list");
migrationBuilder.DropTable(
name: "low_code_search");
migrationBuilder.DropTable(
name: "low_code_table");
migrationBuilder.DropTable(
name: "low_code_table_info");
migrationBuilder.DropTable(
name: "member");
migrationBuilder.DropTable(
name: "quartz_job_task");
migrationBuilder.DropTable(
name: "quartz_job_task_log");
migrationBuilder.DropTable(
name: "sys_data_authority");
migrationBuilder.DropTable(
name: "sys_data_authority_custom");
migrationBuilder.DropTable(
name: "sys_dictionary");
migrationBuilder.DropTable(
name: "sys_file");
migrationBuilder.DropTable(
name: "sys_function");
migrationBuilder.DropTable(
name: "sys_locale");
migrationBuilder.DropTable(
name: "sys_menu");
migrationBuilder.DropTable(
name: "sys_menu_function");
migrationBuilder.DropTable(
name: "sys_operation_log");
migrationBuilder.DropTable(
name: "sys_organization");
migrationBuilder.DropTable(
name: "sys_post");
migrationBuilder.DropTable(
name: "sys_role");
migrationBuilder.DropTable(
name: "sys_role_menu_function");
migrationBuilder.DropTable(
name: "sys_user");
migrationBuilder.DropTable(
name: "sys_user_post");
migrationBuilder.DropTable(
name: "sys_user_role");
}
}
}