From 1c86475c9caa099e4f641207d628a0dcb55c32ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=9B=8A?= Date: Sun, 7 Dec 2025 20:12:02 +0800 Subject: [PATCH] MySQL.Pomelo --- .../configs/appsettings.Development.json | 2 +- src/JiShe.IoT.DbMigrator/appsettings.json | 2 +- .../IoTEntityFrameworkCoreModule.cs | 2 +- .../IoTMigrationsDbContextFactory.cs | 6 +- .../JiShe.IoT.EntityFrameworkCore.csproj | 2 +- ... 20251207055002_InitialCreate.Designer.cs} | 11 +- ...ate.cs => 20251207055002_InitialCreate.cs} | 1262 ++++++++++------- .../Migrations/IoTDbContextModelSnapshot.cs | 9 +- 8 files changed, 795 insertions(+), 501 deletions(-) rename src/JiShe.IoT.EntityFrameworkCore/Migrations/{20251207050159_InitialCreate.Designer.cs => 20251207055002_InitialCreate.Designer.cs} (99%) rename src/JiShe.IoT.EntityFrameworkCore/Migrations/{20251207050159_InitialCreate.cs => 20251207055002_InitialCreate.cs} (71%) diff --git a/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Development.json b/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Development.json index 2e492ec..d898646 100644 --- a/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Development.json +++ b/host/JiShe.IoT.HttpApi.Host/configs/appsettings.Development.json @@ -4,7 +4,7 @@ "CorsOrigins": "https://*.IoT.com,http://localhost:4200,http://localhost:3100,http://localhost:80,http://10.10.90.3:4200" }, "ConnectionStrings": { - "Default": "Data Source=localhost;Port=33306;Database=JiSheIoTProDB4;uid=root;pwd=123456789;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;" + "Default": "Data Source=localhost;Port=33306;Database=JiSheIoTProDB54;uid=root;pwd=123456789;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;" }, "Hangfire": { "Redis": { diff --git a/src/JiShe.IoT.DbMigrator/appsettings.json b/src/JiShe.IoT.DbMigrator/appsettings.json index 64b4512..7c0296d 100644 --- a/src/JiShe.IoT.DbMigrator/appsettings.json +++ b/src/JiShe.IoT.DbMigrator/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "Default": "Data Source=localhost;Port=33306;Database=JiSheIoTProDB4;uid=root;pwd=123456789;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;" + "Default": "Data Source=localhost;Port=33306;Database=JiSheIoTProDB54;uid=root;pwd=123456789;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true;TreatTinyAsBoolean=false;SslMode=None;Pooling=true;" }, "IoTDBOptions": { "UserName": "root", diff --git a/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTEntityFrameworkCoreModule.cs b/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTEntityFrameworkCoreModule.cs index da78f5c..58b3cf7 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTEntityFrameworkCoreModule.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTEntityFrameworkCoreModule.cs @@ -10,7 +10,7 @@ namespace JiShe.IoT.EntityFrameworkCore { [DependsOn( typeof(IoTDomainModule), - typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpEntityFrameworkCoreMySQLPomeloModule), typeof(BasicManagementEntityFrameworkCoreModule), typeof(DataDictionaryManagementEntityFrameworkCoreModule), typeof(NotificationManagementEntityFrameworkCoreModule), diff --git a/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTMigrationsDbContextFactory.cs b/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTMigrationsDbContextFactory.cs index b6f8181..b50a207 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTMigrationsDbContextFactory.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/EntityFrameworkCore/IoTMigrationsDbContextFactory.cs @@ -1,3 +1,5 @@ +using Microsoft.EntityFrameworkCore; + namespace JiShe.IoT.EntityFrameworkCore { /* This class is needed for EF Core console commands @@ -9,9 +11,9 @@ namespace JiShe.IoT.EntityFrameworkCore IoTEfCoreEntityExtensionMappings.Configure(); var configuration = BuildConfiguration(); - + var serverVersion = new MySqlServerVersion(new Version(8, 4, 6)); var builder = new DbContextOptionsBuilder() - .UseMySQL(configuration.GetConnectionString("Default") ?? string.Empty); + .UseMySql(configuration.GetConnectionString("Default") , serverVersion); return new IoTDbContext(builder.Options); } diff --git a/src/JiShe.IoT.EntityFrameworkCore/JiShe.IoT.EntityFrameworkCore.csproj b/src/JiShe.IoT.EntityFrameworkCore/JiShe.IoT.EntityFrameworkCore.csproj index 859cbd3..c927580 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/JiShe.IoT.EntityFrameworkCore.csproj +++ b/src/JiShe.IoT.EntityFrameworkCore/JiShe.IoT.EntityFrameworkCore.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207050159_InitialCreate.Designer.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207055002_InitialCreate.Designer.cs similarity index 99% rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207050159_InitialCreate.Designer.cs rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207055002_InitialCreate.Designer.cs index fff8c85..920b50e 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207050159_InitialCreate.Designer.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207055002_InitialCreate.Designer.cs @@ -3,15 +3,17 @@ using System; using JiShe.IoT.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; #nullable disable namespace JiShe.IoT.Migrations { [DbContext(typeof(IoTDbContext))] - [Migration("20251207050159_InitialCreate")] + [Migration("20251207055002_InitialCreate")] partial class InitialCreate { /// @@ -19,9 +21,12 @@ namespace JiShe.IoT.Migrations { #pragma warning disable 612, 618 modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) .HasAnnotation("ProductVersion", "9.0.6") .HasAnnotation("Relational:MaxIdentifierLength", 64); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("JiShe.ServicePro.BasicManagement.UserRefreshTokens.UserRefreshToken", b => { b.Property("Id") @@ -3019,7 +3024,7 @@ namespace JiShe.IoT.Migrations .HasColumnName("LastModifierId"); b.Property("LastPasswordChangeTime") - .HasColumnType("datetime"); + .HasColumnType("datetime(6)"); b.Property("LockoutEnabled") .ValueGeneratedOnAdd() @@ -3028,7 +3033,7 @@ namespace JiShe.IoT.Migrations .HasColumnName("LockoutEnabled"); b.Property("LockoutEnd") - .HasColumnType("datetime"); + .HasColumnType("datetime(6)"); b.Property("Name") .HasMaxLength(64) diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207050159_InitialCreate.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207055002_InitialCreate.cs similarity index 71% rename from src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207050159_InitialCreate.cs rename to src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207055002_InitialCreate.cs index cdc6fa4..af5cd42 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207050159_InitialCreate.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/20251207055002_InitialCreate.cs @@ -12,121 +12,154 @@ namespace JiShe.IoT.Migrations protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpAuditLogExcelFiles", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - FileName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + FileName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true) + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_AbpAuditLogExcelFiles", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpAuditLogs", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - ApplicationName = table.Column(type: "varchar(96)", maxLength: 96, nullable: true), - UserId = table.Column(type: "char(36)", nullable: true), - UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true), - TenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - ImpersonatorUserId = table.Column(type: "char(36)", nullable: true), - ImpersonatorUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), - ImpersonatorTenantId = table.Column(type: "char(36)", nullable: true), - ImpersonatorTenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ApplicationName = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ImpersonatorUserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ImpersonatorUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ImpersonatorTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ImpersonatorTenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ExecutionTime = table.Column(type: "datetime(6)", nullable: false), ExecutionDuration = table.Column(type: "int", nullable: false), - ClientIpAddress = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - ClientName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true), - ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - CorrelationId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - BrowserInfo = table.Column(type: "varchar(512)", maxLength: 512, nullable: true), - HttpMethod = table.Column(type: "varchar(16)", maxLength: 16, nullable: true), - Url = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), - Exceptions = table.Column(type: "longtext", nullable: true), - Comments = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), + ClientIpAddress = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CorrelationId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + BrowserInfo = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + HttpMethod = table.Column(type: "varchar(16)", maxLength: 16, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Url = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Exceptions = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Comments = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), HttpStatusCode = table.Column(type: "int", nullable: true), - ExtraProperties = table.Column(type: "longtext", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpBackgroundJobs", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - ApplicationName = table.Column(type: "varchar(96)", maxLength: 96, nullable: true), - JobName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - JobArgs = table.Column(type: "longtext", maxLength: 1048576, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ApplicationName = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + JobName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + JobArgs = table.Column(type: "longtext", maxLength: 1048576, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), TryCount = table.Column(type: "smallint", nullable: false, defaultValue: (short)0), CreationTime = table.Column(type: "datetime(6)", nullable: false), NextTryTime = table.Column(type: "datetime(6)", nullable: false), LastTryTime = table.Column(type: "datetime(6)", nullable: true), IsAbandoned = table.Column(type: "bit(1)", nullable: false, defaultValue: false), Priority = table.Column(type: "tinyint unsigned", nullable: false, defaultValue: (byte)15), - ExtraProperties = table.Column(type: "longtext", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpClaimTypes", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), Required = table.Column(type: "bit(1)", nullable: false), IsStatic = table.Column(type: "bit(1)", nullable: false), - Regex = table.Column(type: "varchar(512)", maxLength: 512, nullable: true), - RegexDescription = table.Column(type: "varchar(128)", maxLength: 128, nullable: true), - Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), + Regex = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RegexDescription = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ValueType = table.Column(type: "int", nullable: false), CreationTime = table.Column(type: "datetime(6)", nullable: false), - ExtraProperties = table.Column(type: "longtext", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpDataDictionaries", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - Code = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), - DisplayText = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), - Description = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Code = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayText = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -134,79 +167,99 @@ namespace JiShe.IoT.Migrations table.PrimaryKey("PK_AbpDataDictionaries", x => x.Id); }, comment: "数据字典") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpFeatureGroups", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpFeatures", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - GroupName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - ParentName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true), - DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), - Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), - DefaultValue = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + GroupName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ParentName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DefaultValue = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), IsVisibleToClients = table.Column(type: "bit(1)", nullable: false), IsAvailableToHost = table.Column(type: "bit(1)", nullable: false), - AllowedProviders = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), - ValueType = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true), + AllowedProviders = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ValueType = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpFeatures", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpFeatureValues", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - Value = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ProviderKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpFeatureValues", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpFileObjects", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - FileName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "文件名称"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + FileName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "文件名称") + .Annotation("MySql:CharSet", "utf8mb4"), FileSize = table.Column(type: "bigint", nullable: false, comment: "文件大小"), - ContentType = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "文件名称"), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ContentType = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "文件名称") + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -214,28 +267,34 @@ namespace JiShe.IoT.Migrations table.PrimaryKey("PK_AbpFileObjects", x => x.Id); }, comment: "文件管理") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpLanguages", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - CultureName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "语言名称"), - UiCultureName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "Ui语言名称"), - DisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "显示名称"), - FlagIcon = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "图标"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + CultureName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "语言名称") + .Annotation("MySql:CharSet", "utf8mb4"), + UiCultureName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "Ui语言名称") + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "显示名称") + .Annotation("MySql:CharSet", "utf8mb4"), + FlagIcon = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "图标") + .Annotation("MySql:CharSet", "utf8mb4"), IsEnabled = table.Column(type: "bit(1)", nullable: false), IsDefault = table.Column(type: "bit(1)", nullable: false), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -243,26 +302,32 @@ namespace JiShe.IoT.Migrations table.PrimaryKey("PK_AbpLanguages", x => x.Id); }, comment: "语言管理") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpLanguageTexts", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - CultureName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "语言名称"), - ResourceName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "资源名称"), - Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false, comment: "名称"), - Value = table.Column(type: "varchar(256)", maxLength: 256, nullable: false, comment: "值"), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + CultureName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "语言名称") + .Annotation("MySql:CharSet", "utf8mb4"), + ResourceName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "资源名称") + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false, comment: "名称") + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(256)", maxLength: 256, nullable: false, comment: "值") + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -270,48 +335,54 @@ namespace JiShe.IoT.Migrations table.PrimaryKey("PK_AbpLanguageTexts", x => x.Id); }, comment: "语言文本管理") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpLinkUsers", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - SourceUserId = table.Column(type: "char(36)", nullable: false), - SourceTenantId = table.Column(type: "char(36)", nullable: true), - TargetUserId = table.Column(type: "char(36)", nullable: false), - TargetTenantId = table.Column(type: "char(36)", nullable: true) + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SourceUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SourceTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TargetUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TargetTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpNotifications", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - Title = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - Content = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Title = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Content = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), MessageType = table.Column(type: "int", nullable: false), MessageLevel = table.Column(type: "int", nullable: false), - SenderUserId = table.Column(type: "char(36)", nullable: false), - SenderUserName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - ReceiveUserId = table.Column(type: "char(36)", nullable: true), - ReceiveUserName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true), + SenderUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SenderUserName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ReceiveUserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ReceiveUserName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), Read = table.Column(type: "bit(1)", nullable: false), ReadTime = table.Column(type: "datetime(6)", nullable: true), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -319,27 +390,30 @@ namespace JiShe.IoT.Migrations table.PrimaryKey("PK_AbpNotifications", x => x.Id); }, comment: "消息通知管理") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpNotificationSubscriptions", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - NotificationId = table.Column(type: "char(36)", nullable: false), - ReceiveUserId = table.Column(type: "char(36)", nullable: false), - ReceiveUserName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + NotificationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ReceiveUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ReceiveUserName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), Read = table.Column(type: "bit(1)", nullable: false), ReadTime = table.Column(type: "datetime(6)", nullable: false), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -347,26 +421,30 @@ namespace JiShe.IoT.Migrations table.PrimaryKey("PK_AbpNotificationSubscriptions", x => x.Id); }, comment: "消息订阅者") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpOrganizationUnits", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - ParentId = table.Column(type: "char(36)", nullable: true), - Code = table.Column(type: "varchar(95)", maxLength: 95, nullable: false), - DisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Code = table.Column(type: "varchar(95)", maxLength: 95, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), EntityVersion = table.Column(type: "int", nullable: false), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -378,199 +456,247 @@ namespace JiShe.IoT.Migrations principalTable: "AbpOrganizationUnits", principalColumn: "Id"); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpPermissionGrants", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ProviderKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpPermissionGroups", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpPermissions", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - GroupName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - ParentName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true), - DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + GroupName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ParentName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), IsEnabled = table.Column(type: "bit(1)", nullable: false), MultiTenancySide = table.Column(type: "tinyint unsigned", nullable: false), - Providers = table.Column(type: "varchar(128)", maxLength: 128, nullable: true), - StateCheckers = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), + Providers = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + StateCheckers = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpPermissions", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), - NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), IsDefault = table.Column(type: "bit(1)", nullable: false), IsStatic = table.Column(type: "bit(1)", nullable: false), IsPublic = table.Column(type: "bit(1)", nullable: false), EntityVersion = table.Column(type: "int", nullable: false), CreationTime = table.Column(type: "datetime(6)", nullable: false), - ExtraProperties = table.Column(type: "longtext", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpRoles", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpSecurityLogs", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - ApplicationName = table.Column(type: "varchar(96)", maxLength: 96, nullable: true), - Identity = table.Column(type: "varchar(96)", maxLength: 96, nullable: true), - Action = table.Column(type: "varchar(96)", maxLength: 96, nullable: true), - UserId = table.Column(type: "char(36)", nullable: true), - UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), - TenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - CorrelationId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - ClientIpAddress = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - BrowserInfo = table.Column(type: "varchar(512)", maxLength: 512, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ApplicationName = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Identity = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Action = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CorrelationId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClientIpAddress = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + BrowserInfo = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - ExtraProperties = table.Column(type: "longtext", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpSessions", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - SessionId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - Device = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), - DeviceInfo = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true), - UserId = table.Column(type: "char(36)", nullable: false), - ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - IpAddresses = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SessionId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Device = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceInfo = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IpAddresses = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), SignedIn = table.Column(type: "datetime(6)", nullable: false), LastAccessed = table.Column(type: "datetime(6)", nullable: true), ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpSessions", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpSettingDefinitions", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), - Description = table.Column(type: "varchar(512)", maxLength: 512, nullable: true), - DefaultValue = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DefaultValue = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), IsVisibleToClients = table.Column(type: "bit(1)", nullable: false), - Providers = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true), + Providers = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), IsInherited = table.Column(type: "bit(1)", nullable: false), IsEncrypted = table.Column(type: "bit(1)", nullable: false), ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpSettings", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - Value = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: false), - ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ProviderKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpSettings", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpTenants", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), - NormalizedName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), EntityVersion = table.Column(type: "int", nullable: false), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AbpTenants", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserDelegations", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - SourceUserId = table.Column(type: "char(36)", nullable: false), - TargetUserId = table.Column(type: "char(36)", nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + SourceUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TargetUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), StartTime = table.Column(type: "datetime(6)", nullable: false), EndTime = table.Column(type: "datetime(6)", nullable: false) }, @@ -578,103 +704,137 @@ namespace JiShe.IoT.Migrations { table.PrimaryKey("PK_AbpUserDelegations", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUsers", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), - NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - Surname = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - Email = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), - NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Surname = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Email = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), EmailConfirmed = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - PasswordHash = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), - SecurityStamp = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), + PasswordHash = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SecurityStamp = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), IsExternal = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - PhoneNumber = table.Column(type: "varchar(16)", maxLength: 16, nullable: true), + PhoneNumber = table.Column(type: "varchar(16)", maxLength: 16, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), PhoneNumberConfirmed = table.Column(type: "bit(1)", nullable: false, defaultValue: false), IsActive = table.Column(type: "bit(1)", nullable: false), TwoFactorEnabled = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - LockoutEnd = table.Column(type: "datetime", nullable: true), + LockoutEnd = table.Column(type: "datetime(6)", nullable: true), LockoutEnabled = table.Column(type: "bit(1)", nullable: false, defaultValue: false), AccessFailedCount = table.Column(type: "int", nullable: false, defaultValue: 0), ShouldChangePasswordOnNextLogin = table.Column(type: "bit(1)", nullable: false), EntityVersion = table.Column(type: "int", nullable: false), - LastPasswordChangeTime = table.Column(type: "datetime", nullable: true), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + LastPasswordChangeTime = table.Column(type: "datetime(6)", nullable: true), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AbpUsers", x => x.Id); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProCTWingAccountInfo", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - AccountName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "账号名称"), - AccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账号ID"), - AppId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "应用 ID"), - AppKey = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "应用 AppKey"), - AppSecret = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "应用 AppSecret"), - PlatformTenantId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "平台租户ID"), - CommunicationAddress = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "通讯服务地址"), - PhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "手机号码"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AccountName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "账号名称") + .Annotation("MySql:CharSet", "utf8mb4"), + AccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账号ID") + .Annotation("MySql:CharSet", "utf8mb4"), + AppId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "应用 ID") + .Annotation("MySql:CharSet", "utf8mb4"), + AppKey = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "应用 AppKey") + .Annotation("MySql:CharSet", "utf8mb4"), + AppSecret = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "应用 AppSecret") + .Annotation("MySql:CharSet", "utf8mb4"), + PlatformTenantId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "平台租户ID") + .Annotation("MySql:CharSet", "utf8mb4"), + CommunicationAddress = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "通讯服务地址") + .Annotation("MySql:CharSet", "utf8mb4"), + PhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "手机号码") + .Annotation("MySql:CharSet", "utf8mb4"), ProductCount = table.Column(type: "int", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID"), - Remark = table.Column(type: "longtext", nullable: true, comment: "备注"), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_ServiceProCTWingAccountInfo", x => x.Id); }, comment: "CTWing账号信息") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProCTWingPrivateProductInfo", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - CTWingAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账号ID"), - AccountPhoneNumber = table.Column(type: "longtext", nullable: true), - CommunicationAddress = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "通讯服务地址"), - MasterKey = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "OpenAPI 通信主密钥"), - FeatureAccesskey = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备访问密钥"), - IoTPlatformProductId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "产品ID"), - ProductName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "产品名称"), - Protocol = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "通讯协议"), - ProductDesc = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "必填,产品描述"), - ProductType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "一级分类名"), - SecondaryType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "二级分类名"), - ThirdType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "三级分类名"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CTWingAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账号ID") + .Annotation("MySql:CharSet", "utf8mb4"), + AccountPhoneNumber = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CommunicationAddress = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "通讯服务地址") + .Annotation("MySql:CharSet", "utf8mb4"), + MasterKey = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "OpenAPI 通信主密钥") + .Annotation("MySql:CharSet", "utf8mb4"), + FeatureAccesskey = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备访问密钥") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformProductId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "产品ID") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "产品名称") + .Annotation("MySql:CharSet", "utf8mb4"), + Protocol = table.Column(type: "varchar(20)", maxLength: 20, nullable: true, comment: "通讯协议") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductDesc = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "必填,产品描述") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "一级分类名") + .Annotation("MySql:CharSet", "utf8mb4"), + SecondaryType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "二级分类名") + .Annotation("MySql:CharSet", "utf8mb4"), + ThirdType = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "三级分类名") + .Annotation("MySql:CharSet", "utf8mb4"), NodeType = table.Column(type: "int", nullable: false), AccessType = table.Column(type: "int", nullable: false), NetworkType = table.Column(type: "int", nullable: false), @@ -682,248 +842,309 @@ namespace JiShe.IoT.Migrations AuthType = table.Column(type: "int", nullable: false), DataEncryption = table.Column(type: "int", nullable: false), TupIsThrough = table.Column(type: "int", nullable: false), - TupDeviceModel = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "设备型号"), + TupDeviceModel = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "设备型号") + .Annotation("MySql:CharSet", "utf8mb4"), DeviceCount = table.Column(type: "int", nullable: false), - DeviceThingModelFileId = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "设备物模型文件Id"), - DeviceThingModelFileName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备物模型文件名称"), + DeviceThingModelFileId = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "设备物模型文件Id") + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceThingModelFileName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备物模型文件名称") + .Annotation("MySql:CharSet", "utf8mb4"), IsEnabled = table.Column(type: "bit(1)", nullable: false, comment: "是否启用"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID"), - Remark = table.Column(type: "longtext", nullable: true, comment: "备注"), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_ServiceProCTWingPrivateProductInfo", x => x.Id); }, comment: "CTWing产品信息") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProDeviceInfo", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - DeviceName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "设备名称"), - DeviceAddress = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "设备地址"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DeviceName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "设备名称") + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceAddress = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "设备地址") + .Annotation("MySql:CharSet", "utf8mb4"), IoTPlatform = table.Column(type: "int", nullable: false, comment: "物联网平台类型,默认没有指定"), DeviceType = table.Column(type: "int", nullable: false, comment: "设备类型,与业务系统无关,主要区分是网关设备、直连设备"), - IoTPlatformDeviceOpenInfo = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台中对应的设备Id或者名称"), - PlatformPassword = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台设备密码"), - IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"), - IoTPlatformProductName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台中对应的产品Name"), - IoTPlatformAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的账号Id"), - AccountPhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账户手机号"), - IoTPlatformResponse = table.Column(type: "text", nullable: true, comment: "物联网平台返回的响应信息"), + IoTPlatformDeviceOpenInfo = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台中对应的设备Id或者名称") + .Annotation("MySql:CharSet", "utf8mb4"), + PlatformPassword = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台设备密码") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformProductName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物联网平台中对应的产品Name") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的账号Id") + .Annotation("MySql:CharSet", "utf8mb4"), + AccountPhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账户手机号") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformResponse = table.Column(type: "text", nullable: true, comment: "物联网平台返回的响应信息") + .Annotation("MySql:CharSet", "utf8mb4"), IsPlatformPushSuccess = table.Column(type: "tinyint(1)", nullable: false, comment: "物联网平台推送是否成功"), DeviceOnlineStatus = table.Column(type: "int", nullable: true, comment: "设备在线状态"), LastOnlineTime = table.Column(type: "datetime(6)", nullable: true, comment: "最后在线时间"), LastOfflineTime = table.Column(type: "datetime(6)", nullable: true, comment: "最后离线时间"), DeviceSource = table.Column(type: "int", nullable: false, comment: "设备来源类型"), IsNeedConfigDevicMdoel = table.Column(type: "bit(1)", nullable: false, comment: "是否需要配置设备模型"), - DeviceThingModelDataId = table.Column(type: "char(36)", nullable: true, comment: "设备物模型数据Id"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + DeviceThingModelDataId = table.Column(type: "char(36)", nullable: true, comment: "设备物模型数据Id", collation: "ascii_general_ci"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID"), - Remark = table.Column(type: "longtext", nullable: true, comment: "备注"), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_ServiceProDeviceInfo", x => x.Id); }, comment: "设备信息") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProDeviceThingModelCommandInfo", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - DeviceThingModelId = table.Column(type: "char(36)", nullable: false, comment: "设备端物模型Id"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DeviceThingModelId = table.Column(type: "char(36)", nullable: false, comment: "设备端物模型Id", collation: "ascii_general_ci"), IoTPlatform = table.Column(type: "int", nullable: false, comment: "物联网平台类型"), - IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"), - CommandName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false, comment: "指令名称"), - IssueCommand = table.Column(type: "varchar(512)", maxLength: 512, nullable: false, comment: "完整的单个下发指令"), - PropertyArray = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "指令设备端物模型的属性名称集合,JSON格式字符串数组"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id") + .Annotation("MySql:CharSet", "utf8mb4"), + CommandName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false, comment: "指令名称") + .Annotation("MySql:CharSet", "utf8mb4"), + IssueCommand = table.Column(type: "varchar(512)", maxLength: 512, nullable: false, comment: "完整的单个下发指令") + .Annotation("MySql:CharSet", "utf8mb4"), + PropertyArray = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "指令设备端物模型的属性名称集合,JSON格式字符串数组") + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID"), - Remark = table.Column(type: "longtext", nullable: true, comment: "备注"), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_ServiceProDeviceThingModelCommandInfo", x => x.Id); }, comment: "设备端透传指令详情") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProDeviceThingModelManagement", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - DeviceModelName = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "设备端物模型名称"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DeviceModelName = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "设备端物模型名称") + .Annotation("MySql:CharSet", "utf8mb4"), IoTPlatform = table.Column(type: "int", nullable: false, comment: "物联网平台类型,默认没有指定"), - IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"), - ScriptName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "脚本函数名称"), - FunctionScript = table.Column(type: "text", nullable: false, comment: "脚本函数体"), + IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id") + .Annotation("MySql:CharSet", "utf8mb4"), + ScriptName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "脚本函数名称") + .Annotation("MySql:CharSet", "utf8mb4"), + FunctionScript = table.Column(type: "text", nullable: false, comment: "脚本函数体") + .Annotation("MySql:CharSet", "utf8mb4"), ParsingSequence = table.Column(type: "int", nullable: false, comment: "解析顺序,1234或者3412(高低位反转)"), FunctionAnalysisFlag = table.Column(type: "tinyint(1)", nullable: false, comment: "函数解析标记,默认为false, 不能解析"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID"), - Remark = table.Column(type: "longtext", nullable: true, comment: "备注"), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_ServiceProDeviceThingModelManagement", x => x.Id); }, comment: "设备端物模型管理") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProDeviceThingModelPropertylInfo", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - DeviceThingModelId = table.Column(type: "char(36)", nullable: false, comment: "设备端物模型Id"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DeviceThingModelId = table.Column(type: "char(36)", nullable: false, comment: "设备端物模型Id", collation: "ascii_general_ci"), IoTPlatform = table.Column(type: "int", nullable: false, comment: "物联网平台类型"), - IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"), - FiledType = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型"), - IoTPlatformRawFieldName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称"), - IoTPlatformRawFieldDataType = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件数据类型"), - StandardFieldName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称"), - StandardFieldValueType = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "标准物模型字段值类型"), - StandardFieldDisplayName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称"), + IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id") + .Annotation("MySql:CharSet", "utf8mb4"), + FiledType = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformRawFieldName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformRawFieldDataType = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件数据类型") + .Annotation("MySql:CharSet", "utf8mb4"), + StandardFieldName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称") + .Annotation("MySql:CharSet", "utf8mb4"), + StandardFieldValueType = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "标准物模型字段值类型") + .Annotation("MySql:CharSet", "utf8mb4"), + StandardFieldDisplayName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称") + .Annotation("MySql:CharSet", "utf8mb4"), IsValueNeedConvert = table.Column(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"), SkipNumber = table.Column(type: "int", nullable: false, comment: "跳过数量"), TakeNumber = table.Column(type: "int", nullable: false, comment: "获取数量"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID"), - Remark = table.Column(type: "longtext", nullable: true, comment: "备注"), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_ServiceProDeviceThingModelPropertylInfo", x => x.Id); }, comment: "设备端物模型属性信息,是指设备端支持的属性或者事件") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProIoTPlatformThingModelInfo", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), IoTPlatform = table.Column(type: "int", nullable: false, comment: "物联网平台类型,默认没有指定"), - IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"), - FiledType = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型"), - IoTPlatformRawFieldName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称"), - StandardFieldName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称"), - StandardFieldValueType = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "标准物模型字段值类型"), - StandardFieldDisplayName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称"), + IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id") + .Annotation("MySql:CharSet", "utf8mb4"), + FiledType = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformRawFieldName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称") + .Annotation("MySql:CharSet", "utf8mb4"), + StandardFieldName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称") + .Annotation("MySql:CharSet", "utf8mb4"), + StandardFieldValueType = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, comment: "标准物模型字段值类型") + .Annotation("MySql:CharSet", "utf8mb4"), + StandardFieldDisplayName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称") + .Annotation("MySql:CharSet", "utf8mb4"), IsValueNeedConvert = table.Column(type: "tinyint(1)", nullable: false, comment: "是否需要值类型转换"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID"), - Remark = table.Column(type: "longtext", nullable: true, comment: "备注"), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_ServiceProIoTPlatformThingModelInfo", x => x.Id); }, comment: "平台端物模型信息") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProMenus", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - ParentId = table.Column(type: "char(36)", nullable: true), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "唯一编码"), - Title = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "标题"), - DisplayTitle = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "标准多语言"), - Icon = table.Column(type: "longtext", nullable: true, comment: "图标"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "唯一编码") + .Annotation("MySql:CharSet", "utf8mb4"), + Title = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "标题") + .Annotation("MySql:CharSet", "utf8mb4"), + DisplayTitle = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "标准多语言") + .Annotation("MySql:CharSet", "utf8mb4"), + Icon = table.Column(type: "longtext", nullable: true, comment: "图标") + .Annotation("MySql:CharSet", "utf8mb4"), KeepAlive = table.Column(type: "bit(1)", nullable: false, comment: "是否缓存"), HideInMenu = table.Column(type: "bit(1)", nullable: false, comment: "是否显示"), Order = table.Column(type: "int", nullable: false, comment: "排序"), - Path = table.Column(type: "varchar(512)", maxLength: 512, nullable: false, comment: "路由/接口地址"), + Path = table.Column(type: "varchar(512)", maxLength: 512, nullable: false, comment: "路由/接口地址") + .Annotation("MySql:CharSet", "utf8mb4"), MenuType = table.Column(type: "int", nullable: false, comment: "菜单类型"), OpenType = table.Column(type: "int", nullable: false, comment: "打开类型"), - Url = table.Column(type: "longtext", nullable: true, comment: "内外链地址"), - Component = table.Column(type: "varchar(512)", maxLength: 512, nullable: true, comment: "组件地址"), - Policy = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "授权策略名称"), + Url = table.Column(type: "longtext", nullable: true, comment: "内外链地址") + .Annotation("MySql:CharSet", "utf8mb4"), + Component = table.Column(type: "varchar(512)", maxLength: 512, nullable: true, comment: "组件地址") + .Annotation("MySql:CharSet", "utf8mb4"), + Policy = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "授权策略名称") + .Annotation("MySql:CharSet", "utf8mb4"), Enabled = table.Column(type: "bit(1)", nullable: false), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -931,110 +1152,140 @@ namespace JiShe.IoT.Migrations table.PrimaryKey("PK_ServiceProMenus", x => x.Id); }, comment: "动态菜单管理") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProOneNETAccountInfo", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - AccountName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "账号名称"), - OneNETAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账户Id"), - PhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "手机号码"), - AccountAccesskey = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "账户通信密钥,平台可以重置密钥"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AccountName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "账号名称") + .Annotation("MySql:CharSet", "utf8mb4"), + OneNETAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账户Id") + .Annotation("MySql:CharSet", "utf8mb4"), + PhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "手机号码") + .Annotation("MySql:CharSet", "utf8mb4"), + AccountAccesskey = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "账户通信密钥,平台可以重置密钥") + .Annotation("MySql:CharSet", "utf8mb4"), ProductCount = table.Column(type: "int", nullable: false, comment: "产品数量"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID"), - Remark = table.Column(type: "longtext", nullable: true, comment: "备注"), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_ServiceProOneNETAccountInfo", x => x.Id); }, comment: "OneNET账号管理") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProOneNETProductInfo", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - OneNETAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账户Id"), - AccountPhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "账户手机号"), - IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台对应的产品Id"), - ProductName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "产品名称"), - ProductAccesskey = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "产品访问密钥"), - DeviceThingModelFileId = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "设备物模型文件Id"), - DeviceThingModelFileName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备物模型文件名称"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OneNETAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "账户Id") + .Annotation("MySql:CharSet", "utf8mb4"), + AccountPhoneNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "账户手机号") + .Annotation("MySql:CharSet", "utf8mb4"), + IoTPlatformProductId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台对应的产品Id") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "产品名称") + .Annotation("MySql:CharSet", "utf8mb4"), + ProductAccesskey = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "产品访问密钥") + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceThingModelFileId = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, comment: "设备物模型文件Id") + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceThingModelFileName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备物模型文件名称") + .Annotation("MySql:CharSet", "utf8mb4"), IsEnabled = table.Column(type: "bit(1)", nullable: false), AccessProtocol = table.Column(type: "int", nullable: false, comment: "接入协议"), DataProtocol = table.Column(type: "int", nullable: false, comment: "数据协议"), NodeType = table.Column(type: "int", nullable: false, comment: "节点类型"), ProductCreateTime = table.Column(type: "datetime(6)", nullable: false, comment: "产品创建时间"), ProductUpdateTime = table.Column(type: "datetime(6)", nullable: false, comment: "最近修改时间"), - Network = table.Column(type: "longtext", nullable: true, comment: "联网方式"), - Manufacturer = table.Column(type: "longtext", nullable: true, comment: "产品厂商"), - Model = table.Column(type: "longtext", nullable: true, comment: "产品型号"), - Brand = table.Column(type: "longtext", nullable: true, comment: "产品品牌"), + Network = table.Column(type: "longtext", nullable: true, comment: "联网方式") + .Annotation("MySql:CharSet", "utf8mb4"), + Manufacturer = table.Column(type: "longtext", nullable: true, comment: "产品厂商") + .Annotation("MySql:CharSet", "utf8mb4"), + Model = table.Column(type: "longtext", nullable: true, comment: "产品型号") + .Annotation("MySql:CharSet", "utf8mb4"), + Brand = table.Column(type: "longtext", nullable: true, comment: "产品品牌") + .Annotation("MySql:CharSet", "utf8mb4"), Status = table.Column(type: "int", nullable: false, comment: "开发状态"), OwnDeviceCount = table.Column(type: "int", nullable: false, comment: "自有设备总数"), OnlineDeviceCount = table.Column(type: "int", nullable: false, comment: "在线设备总数"), OfflineDeviceCount = table.Column(type: "int", nullable: false, comment: "离线设备数"), NotActiveDeviceCount = table.Column(type: "int", nullable: false, comment: "未激活设备数"), - CommunicationAddress = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "通讯服务地址"), - CommunicationAddressTLS = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "TLS通讯服务地址"), - ThingModelInfos = table.Column(type: "longtext", nullable: true, comment: "平台物模型信息"), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + CommunicationAddress = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "通讯服务地址") + .Annotation("MySql:CharSet", "utf8mb4"), + CommunicationAddressTLS = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "TLS通讯服务地址") + .Annotation("MySql:CharSet", "utf8mb4"), + ThingModelInfos = table.Column(type: "longtext", nullable: true, comment: "平台物模型信息") + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID"), - Remark = table.Column(type: "longtext", nullable: true, comment: "备注"), + TenantId = table.Column(type: "char(36)", nullable: true, comment: "租户ID", collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), OSACreatorId = table.Column(type: "int", nullable: true, comment: "旧系统授权创建者Id"), OSALastModifierId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后修改者Id"), OSADeleterId = table.Column(type: "int", nullable: true, comment: "旧系统授权最后删除者Id"), ExtraProperties = table.Column(type: "longtext", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式") + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_ServiceProOneNETProductInfo", x => x.Id); }, comment: "OneNET产品管理") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProTextTemplates", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "名称"), - Code = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "编码"), - Content = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "内容"), - CultureName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "语言"), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "名称") + .Annotation("MySql:CharSet", "utf8mb4"), + Code = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "编码") + .Annotation("MySql:CharSet", "utf8mb4"), + Content = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "内容") + .Annotation("MySql:CharSet", "utf8mb4"), + CultureName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "语言") + .Annotation("MySql:CharSet", "utf8mb4"), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -1042,27 +1293,31 @@ namespace JiShe.IoT.Migrations table.PrimaryKey("PK_ServiceProTextTemplates", x => x.Id); }, comment: "模板管理") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProUserRefreshTokens", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - UserId = table.Column(type: "char(36)", nullable: false, comment: "用户id"), - TenantId = table.Column(type: "char(36)", nullable: true), - RefreshToken = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "刷新token"), - Token = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "Token"), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, comment: "用户id", collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + RefreshToken = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "刷新token") + .Annotation("MySql:CharSet", "utf8mb4"), + Token = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false, comment: "Token") + .Annotation("MySql:CharSet", "utf8mb4"), IsUsed = table.Column(type: "bit(1)", nullable: false, comment: "是否使用"), ExpirationTime = table.Column(type: "datetime(6)", nullable: false, comment: "过期时间"), - ExtraProperties = table.Column(type: "longtext", nullable: false), - ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true), + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "bit(1)", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "char(36)", nullable: true), + DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => @@ -1070,21 +1325,25 @@ namespace JiShe.IoT.Migrations table.PrimaryKey("PK_ServiceProUserRefreshTokens", x => x.Id); }, comment: "刷新Token") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpAuditLogActions", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - AuditLogId = table.Column(type: "char(36)", nullable: false), - ServiceName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true), - MethodName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true), - Parameters = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + AuditLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ServiceName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + MethodName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Parameters = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), ExecutionTime = table.Column(type: "datetime(6)", nullable: false), ExecutionDuration = table.Column(type: "int", nullable: false), ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { @@ -1096,21 +1355,24 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpEntityChanges", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - AuditLogId = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AuditLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ChangeTime = table.Column(type: "datetime(6)", nullable: false), ChangeType = table.Column(type: "tinyint unsigned", nullable: false), - EntityTenantId = table.Column(type: "char(36)", nullable: true), - EntityId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true), - EntityTypeFullName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), + EntityTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + EntityId = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EntityTypeFullName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ExtraProperties = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { @@ -1122,24 +1384,28 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpDataDictionaryDetails", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - DataDictionaryId = table.Column(type: "char(36)", nullable: false), - Code = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DataDictionaryId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Code = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), Order = table.Column(type: "int", nullable: false), - DisplayText = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), - Description = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true), + DisplayText = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), IsEnabled = table.Column(type: "bit(1)", nullable: false), - ExtendedAttribute = table.Column(type: "varchar(64)", maxLength: 64, nullable: true), + ExtendedAttribute = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true), + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), - LastModifierId = table.Column(type: "char(36)", nullable: true) + LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { @@ -1152,17 +1418,17 @@ namespace JiShe.IoT.Migrations onDelete: ReferentialAction.Cascade); }, comment: "数据字典详情") - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpOrganizationUnitRoles", columns: table => new { - RoleId = table.Column(type: "char(36)", nullable: false), - OrganizationUnitId = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OrganizationUnitId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true) + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { @@ -1180,17 +1446,19 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpRoleClaims", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - RoleId = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - ClaimType = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ClaimType = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ClaimValue = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { @@ -1202,15 +1470,17 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpTenantConnectionStrings", columns: table => new { - TenantId = table.Column(type: "char(36)", nullable: false), - Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { @@ -1222,17 +1492,19 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserClaims", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - UserId = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - ClaimType = table.Column(type: "varchar(256)", maxLength: 256, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ClaimType = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ClaimValue = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { @@ -1244,17 +1516,20 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserLogins", columns: table => new { - UserId = table.Column(type: "char(36)", nullable: false), - LoginProvider = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - ProviderKey = table.Column(type: "varchar(196)", maxLength: 196, nullable: false), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + LoginProvider = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + ProviderKey = table.Column(type: "varchar(196)", maxLength: 196, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), ProviderDisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { @@ -1266,17 +1541,17 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserOrganizationUnits", columns: table => new { - UserId = table.Column(type: "char(36)", nullable: false), - OrganizationUnitId = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OrganizationUnitId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreationTime = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "char(36)", nullable: true) + CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { @@ -1294,15 +1569,15 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserRoles", columns: table => new { - UserId = table.Column(type: "char(36)", nullable: false), - RoleId = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true) + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { @@ -1320,17 +1595,20 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserTokens", columns: table => new { - UserId = table.Column(type: "char(36)", nullable: false), - LoginProvider = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), - Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + LoginProvider = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Value = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { @@ -1342,19 +1620,23 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpEntityPropertyChanges", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false), - TenantId = table.Column(type: "char(36)", nullable: true), - EntityChangeId = table.Column(type: "char(36)", nullable: false), - NewValue = table.Column(type: "varchar(512)", maxLength: 512, nullable: true), - OriginalValue = table.Column(type: "varchar(512)", maxLength: 512, nullable: true), - PropertyName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + EntityChangeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + NewValue = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OriginalValue = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PropertyName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), PropertyTypeFullName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { @@ -1366,7 +1648,7 @@ namespace JiShe.IoT.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) - .Annotation("MySQL:Charset", "utf8mb4"); + .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_AuditLogId", diff --git a/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs b/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs index a596df8..823dfbf 100644 --- a/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs +++ b/src/JiShe.IoT.EntityFrameworkCore/Migrations/IoTDbContextModelSnapshot.cs @@ -3,7 +3,9 @@ using System; using JiShe.IoT.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; #nullable disable @@ -16,9 +18,12 @@ namespace JiShe.IoT.Migrations { #pragma warning disable 612, 618 modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) .HasAnnotation("ProductVersion", "9.0.6") .HasAnnotation("Relational:MaxIdentifierLength", 64); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("JiShe.ServicePro.BasicManagement.UserRefreshTokens.UserRefreshToken", b => { b.Property("Id") @@ -3016,7 +3021,7 @@ namespace JiShe.IoT.Migrations .HasColumnName("LastModifierId"); b.Property("LastPasswordChangeTime") - .HasColumnType("datetime"); + .HasColumnType("datetime(6)"); b.Property("LockoutEnabled") .ValueGeneratedOnAdd() @@ -3025,7 +3030,7 @@ namespace JiShe.IoT.Migrations .HasColumnName("LockoutEnabled"); b.Property("LockoutEnd") - .HasColumnType("datetime"); + .HasColumnType("datetime(6)"); b.Property("Name") .HasMaxLength(64)