using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace JiShe.IoT.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpAuditLogs", columns: table => new { 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) .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) .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"); migrationBuilder.CreateTable( name: "AbpBackgroundJobs", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), 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: "tinyint(1)", nullable: false, defaultValue: false), Priority = table.Column(type: "tinyint unsigned", nullable: false, defaultValue: (byte)15), 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"); migrationBuilder.CreateTable( name: "AbpClaimTypes", columns: table => new { 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: "tinyint(1)", nullable: false), IsStatic = table.Column(type: "tinyint(1)", nullable: false), 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) .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"); migrationBuilder.CreateTable( name: "AbpDataDictionaries", columns: table => new { 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_AbpDataDictionaries", x => x.Id); }, comment: "数据字典") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpFeatureGroups", columns: table => new { 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"); migrationBuilder.CreateTable( name: "AbpFeatures", columns: table => new { 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: "tinyint(1)", nullable: false), IsAvailableToHost = table.Column(type: "tinyint(1)", nullable: false), 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"); migrationBuilder.CreateTable( name: "AbpFeatureValues", columns: table => new { 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"); migrationBuilder.CreateTable( name: "AbpFileObjects", columns: table => new { 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: "文件名称") .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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_AbpFileObjects", x => x.Id); }, comment: "文件管理") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpLanguages", columns: table => new { 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: "tinyint(1)", nullable: false), IsDefault = table.Column(type: "tinyint(1)", 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_AbpLanguages", x => x.Id); }, comment: "语言管理") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpLanguageTexts", columns: table => new { 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_AbpLanguageTexts", x => x.Id); }, comment: "语言文本管理") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpLinkUsers", columns: table => new { 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"); migrationBuilder.CreateTable( name: "AbpNotifications", columns: table => new { 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, 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: "tinyint(1)", nullable: false), ReadTime = 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_AbpNotifications", x => x.Id); }, comment: "消息通知管理") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpNotificationSubscriptions", columns: table => new { 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: "tinyint(1)", nullable: false), ReadTime = table.Column(type: "datetime(6)", 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_AbpNotificationSubscriptions", x => x.Id); }, comment: "消息订阅者") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpOrganizationUnits", columns: table => new { 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) .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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_AbpOrganizationUnits", x => x.Id); table.ForeignKey( name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", column: x => x.ParentId, principalTable: "AbpOrganizationUnits", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpPermissionGrants", columns: table => new { 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"); migrationBuilder.CreateTable( name: "AbpPermissionGroups", columns: table => new { 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"); migrationBuilder.CreateTable( name: "AbpPermissions", columns: table => new { 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: "tinyint(1)", nullable: false), MultiTenancySide = table.Column(type: "tinyint unsigned", nullable: false), 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"); migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new { 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: "tinyint(1)", nullable: false), IsStatic = table.Column(type: "tinyint(1)", nullable: false), IsPublic = table.Column(type: "tinyint(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) .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"); migrationBuilder.CreateTable( name: "AbpSecurityLogs", columns: table => new { 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) .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"); migrationBuilder.CreateTable( name: "AbpSessions", columns: table => new { 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"); migrationBuilder.CreateTable( name: "AbpSettingDefinitions", columns: table => new { 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: "tinyint(1)", nullable: false), Providers = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsInherited = table.Column(type: "tinyint(1)", nullable: false), IsEncrypted = table.Column(type: "tinyint(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"); migrationBuilder.CreateTable( name: "AbpSettings", columns: table => new { 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"); migrationBuilder.CreateTable( name: "AbpTenants", columns: table => new { 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) .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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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"); migrationBuilder.CreateTable( name: "AbpUserDelegations", columns: table => new { 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) }, constraints: table => { table.PrimaryKey("PK_AbpUserDelegations", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUsers", columns: table => new { 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: "tinyint(1)", nullable: false, defaultValue: 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: "tinyint(1)", nullable: false, defaultValue: false), PhoneNumber = table.Column(type: "varchar(16)", maxLength: 16, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), PhoneNumberConfirmed = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), IsActive = table.Column(type: "tinyint(1)", nullable: false), TwoFactorEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), LockoutEnd = table.Column(type: "datetime(6)", nullable: true), LockoutEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), AccessFailedCount = table.Column(type: "int", nullable: false, defaultValue: 0), ShouldChangePasswordOnNextLogin = table.Column(type: "tinyint(1)", nullable: false), EntityVersion = table.Column(type: "int", 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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"); migrationBuilder.CreateTable( name: "ServiceProCTWingAccountInfo", columns: table => new { 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"), 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) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), 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, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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", 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"); migrationBuilder.CreateTable( name: "ServiceProCTWingPrivateProductInfo", columns: table => new { 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"), CommunicationAddress = table.Column(type: "varchar(128)", maxLength: 128, nullable: false, comment: "通讯服务地址") .Annotation("MySql:CharSet", "utf8mb4"), MasterKey = table.Column(type: "varchar(128)", maxLength: 128, nullable: true, comment: "主密钥") .Annotation("MySql:CharSet", "utf8mb4"), IoTPlatformProductId = table.Column(type: "int", nullable: false), 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), ProductProtocol = table.Column(type: "int", nullable: false), 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: "设备型号") .Annotation("MySql:CharSet", "utf8mb4"), DeviceCount = table.Column(type: "int", nullable: false), DeviceThingModelUrl = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备物模型文件管理地址") .Annotation("MySql:CharSet", "utf8mb4"), IsEnabled = table.Column(type: "tinyint(1)", 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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", 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"); migrationBuilder.CreateTable( name: "ServiceProDeviceInfo", columns: table => new { 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: "物联网平台类型,默认没有指定"), 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"), IoTPlatformAccountId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的账号Id") .Annotation("MySql:CharSet", "utf8mb4"), IoTPlatformResponse = table.Column(type: "varchar(512)", maxLength: 512, nullable: false, 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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", 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"); migrationBuilder.CreateTable( name: "ServiceProMenus", columns: table => new { 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: "tinyint(1)", nullable: false, comment: "是否缓存"), HideInMenu = table.Column(type: "tinyint(1)", nullable: false, comment: "是否显示"), Order = table.Column(type: "int", 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: "内外链地址") .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: "tinyint(1)", 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_ServiceProMenus", x => x.Id); }, comment: "动态菜单管理") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProOneNETAccountInfo", columns: table => new { 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"), Accesskey = 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) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), 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, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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", 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"); migrationBuilder.CreateTable( name: "ServiceProOneNETProductInfo", columns: table => new { 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"), 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(128)", maxLength: 128, nullable: false, comment: "产品访问密钥") .Annotation("MySql:CharSet", "utf8mb4"), DeviceThingModelUrl = table.Column(type: "varchar(256)", maxLength: 256, nullable: true, comment: "设备物模型文件管理地址") .Annotation("MySql:CharSet", "utf8mb4"), IsEncrypted = table.Column(type: "tinyint(1)", nullable: false), IsEnabled = table.Column(type: "tinyint(1)", nullable: false), AccessProtocol = table.Column(type: "int", nullable: false), DataProtocol = table.Column(type: "int", nullable: false), NodeType = table.Column(type: "int", nullable: false), ProductCreateTime = table.Column(type: "datetime(6)", nullable: false), ProductUpdateTime = table.Column(type: "datetime(6)", nullable: false), Network = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Manufacturer = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Model = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Brand = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Status = table.Column(type: "int", nullable: false), OwnDeviceCount = table.Column(type: "int", nullable: false), OnlineDeviceCount = table.Column(type: "int", nullable: false), OfflineDeviceCount = table.Column(type: "int", nullable: false), NotActiveDeviceCount = table.Column(type: "int", 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"), 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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", 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"); migrationBuilder.CreateTable( name: "ServiceProTextTemplates", columns: table => new { 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_ServiceProTextTemplates", x => x.Id); }, comment: "模板管理") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServiceProUserRefreshTokens", columns: table => new { 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: "tinyint(1)", nullable: false, comment: "是否使用"), ExpirationTime = table.Column(type: "datetime(6)", nullable: false, comment: "过期时间"), 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, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), 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_ServiceProUserRefreshTokens", x => x.Id); }, comment: "刷新Token") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpAuditLogActions", columns: table => new { 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 => { table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); table.ForeignKey( name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", column: x => x.AuditLogId, principalTable: "AbpAuditLogs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpEntityChanges", columns: table => new { 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, 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 => { table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); table.ForeignKey( name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", column: x => x.AuditLogId, principalTable: "AbpAuditLogs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpDataDictionaryDetails", columns: table => new { 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: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Order = table.Column(type: "int", nullable: false), DisplayText = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsEnabled = table.Column(type: "tinyint(1)", nullable: false), CreationTime = table.Column(type: "datetime(6)", nullable: false), 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, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_AbpDataDictionaryDetails", x => x.Id); table.ForeignKey( name: "FK_AbpDataDictionaryDetails_AbpDataDictionaries_DataDictionaryId", column: x => x.DataDictionaryId, principalTable: "AbpDataDictionaries", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }, comment: "数据字典详情") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpOrganizationUnitRoles", columns: table => new { 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, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); table.ForeignKey( name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUn~", column: x => x.OrganizationUnitId, principalTable: "AbpOrganizationUnits", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", column: x => x.RoleId, principalTable: "AbpRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpRoleClaims", columns: table => new { 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 => { table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); table.ForeignKey( name: "FK_AbpRoleClaims_AbpRoles_RoleId", column: x => x.RoleId, principalTable: "AbpRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpTenantConnectionStrings", columns: table => new { 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 => { table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); table.ForeignKey( name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", column: x => x.TenantId, principalTable: "AbpTenants", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserClaims", columns: table => new { 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 => { table.PrimaryKey("PK_AbpUserClaims", x => x.Id); table.ForeignKey( name: "FK_AbpUserClaims_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserLogins", columns: table => new { 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 => { table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); table.ForeignKey( name: "FK_AbpUserLogins_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserOrganizationUnits", columns: table => new { 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, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); table.ForeignKey( name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUn~", column: x => x.OrganizationUnitId, principalTable: "AbpOrganizationUnits", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserRoles", columns: table => new { 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 => { table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); table.ForeignKey( name: "FK_AbpUserRoles_AbpRoles_RoleId", column: x => x.RoleId, principalTable: "AbpRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AbpUserRoles_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserTokens", columns: table => new { 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 => { table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); table.ForeignKey( name: "FK_AbpUserTokens_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpEntityPropertyChanges", columns: table => new { 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 => { table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); table.ForeignKey( name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", column: x => x.EntityChangeId, principalTable: "AbpEntityChanges", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_AuditLogId", table: "AbpAuditLogActions", column: "AuditLogId"); migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Execution~", table: "AbpAuditLogActions", columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); migrationBuilder.CreateIndex( name: "IX_AbpAuditLogs_TenantId_ExecutionTime", table: "AbpAuditLogs", columns: new[] { "TenantId", "ExecutionTime" }); migrationBuilder.CreateIndex( name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", table: "AbpAuditLogs", columns: new[] { "TenantId", "UserId", "ExecutionTime" }); migrationBuilder.CreateIndex( name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime", table: "AbpBackgroundJobs", columns: new[] { "IsAbandoned", "NextTryTime" }); migrationBuilder.CreateIndex( name: "IX_AbpDataDictionaryDetails_DataDictionaryId", table: "AbpDataDictionaryDetails", column: "DataDictionaryId"); migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_AuditLogId", table: "AbpEntityChanges", column: "AuditLogId"); migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", table: "AbpEntityChanges", columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); migrationBuilder.CreateIndex( name: "IX_AbpEntityPropertyChanges_EntityChangeId", table: "AbpEntityPropertyChanges", column: "EntityChangeId"); migrationBuilder.CreateIndex( name: "IX_AbpFeatureGroups_Name", table: "AbpFeatureGroups", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_AbpFeatures_GroupName", table: "AbpFeatures", column: "GroupName"); migrationBuilder.CreateIndex( name: "IX_AbpFeatures_Name", table: "AbpFeatures", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", table: "AbpFeatureValues", columns: new[] { "Name", "ProviderName", "ProviderKey" }, unique: true); migrationBuilder.CreateIndex( name: "IX_AbpFileObjects_FileName", table: "AbpFileObjects", column: "FileName"); migrationBuilder.CreateIndex( name: "IX_AbpLanguages_CultureName", table: "AbpLanguages", column: "CultureName"); migrationBuilder.CreateIndex( name: "IX_AbpLanguageTexts_TenantId_ResourceName_CultureName", table: "AbpLanguageTexts", columns: new[] { "TenantId", "ResourceName", "CultureName" }); migrationBuilder.CreateIndex( name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Target~", table: "AbpLinkUsers", columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_AbpNotificationSubscriptions_NotificationId", table: "AbpNotificationSubscriptions", column: "NotificationId"); migrationBuilder.CreateIndex( name: "IX_AbpNotificationSubscriptions_ReceiveUserId", table: "AbpNotificationSubscriptions", column: "ReceiveUserId"); migrationBuilder.CreateIndex( name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", table: "AbpOrganizationUnitRoles", columns: new[] { "RoleId", "OrganizationUnitId" }); migrationBuilder.CreateIndex( name: "IX_AbpOrganizationUnits_Code", table: "AbpOrganizationUnits", column: "Code"); migrationBuilder.CreateIndex( name: "IX_AbpOrganizationUnits_ParentId", table: "AbpOrganizationUnits", column: "ParentId"); migrationBuilder.CreateIndex( name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey", table: "AbpPermissionGrants", columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" }, unique: true); migrationBuilder.CreateIndex( name: "IX_AbpPermissionGroups_Name", table: "AbpPermissionGroups", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_AbpPermissions_GroupName", table: "AbpPermissions", column: "GroupName"); migrationBuilder.CreateIndex( name: "IX_AbpPermissions_Name", table: "AbpPermissions", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_AbpRoleClaims_RoleId", table: "AbpRoleClaims", column: "RoleId"); migrationBuilder.CreateIndex( name: "IX_AbpRoles_NormalizedName", table: "AbpRoles", column: "NormalizedName"); migrationBuilder.CreateIndex( name: "IX_AbpSecurityLogs_TenantId_Action", table: "AbpSecurityLogs", columns: new[] { "TenantId", "Action" }); migrationBuilder.CreateIndex( name: "IX_AbpSecurityLogs_TenantId_ApplicationName", table: "AbpSecurityLogs", columns: new[] { "TenantId", "ApplicationName" }); migrationBuilder.CreateIndex( name: "IX_AbpSecurityLogs_TenantId_Identity", table: "AbpSecurityLogs", columns: new[] { "TenantId", "Identity" }); migrationBuilder.CreateIndex( name: "IX_AbpSecurityLogs_TenantId_UserId", table: "AbpSecurityLogs", columns: new[] { "TenantId", "UserId" }); migrationBuilder.CreateIndex( name: "IX_AbpSessions_Device", table: "AbpSessions", column: "Device"); migrationBuilder.CreateIndex( name: "IX_AbpSessions_SessionId", table: "AbpSessions", column: "SessionId"); migrationBuilder.CreateIndex( name: "IX_AbpSessions_TenantId_UserId", table: "AbpSessions", columns: new[] { "TenantId", "UserId" }); migrationBuilder.CreateIndex( name: "IX_AbpSettingDefinitions_Name", table: "AbpSettingDefinitions", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_AbpSettings_Name_ProviderName_ProviderKey", table: "AbpSettings", columns: new[] { "Name", "ProviderName", "ProviderKey" }, unique: true); migrationBuilder.CreateIndex( name: "IX_AbpTenants_Name", table: "AbpTenants", column: "Name"); migrationBuilder.CreateIndex( name: "IX_AbpTenants_NormalizedName", table: "AbpTenants", column: "NormalizedName"); migrationBuilder.CreateIndex( name: "IX_AbpUserClaims_UserId", table: "AbpUserClaims", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_AbpUserLogins_LoginProvider_ProviderKey", table: "AbpUserLogins", columns: new[] { "LoginProvider", "ProviderKey" }); migrationBuilder.CreateIndex( name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", table: "AbpUserOrganizationUnits", columns: new[] { "UserId", "OrganizationUnitId" }); migrationBuilder.CreateIndex( name: "IX_AbpUserRoles_RoleId_UserId", table: "AbpUserRoles", columns: new[] { "RoleId", "UserId" }); migrationBuilder.CreateIndex( name: "IX_AbpUsers_Email", table: "AbpUsers", column: "Email"); migrationBuilder.CreateIndex( name: "IX_AbpUsers_NormalizedEmail", table: "AbpUsers", column: "NormalizedEmail"); migrationBuilder.CreateIndex( name: "IX_AbpUsers_NormalizedUserName", table: "AbpUsers", column: "NormalizedUserName"); migrationBuilder.CreateIndex( name: "IX_AbpUsers_UserName", table: "AbpUsers", column: "UserName"); migrationBuilder.CreateIndex( name: "IX_ServiceProCTWingAccountInfo_CreationTime", table: "ServiceProCTWingAccountInfo", column: "CreationTime"); migrationBuilder.CreateIndex( name: "IX_ServiceProCTWingAccountInfo_IsNotUniqueKey", table: "ServiceProCTWingAccountInfo", columns: new[] { "Id", "AccountId", "AccountName", "CreationTime" }, descending: new bool[0]); migrationBuilder.CreateIndex( name: "IX_ServiceProCTWingPrivateProductInfo_CreationTime", table: "ServiceProCTWingPrivateProductInfo", column: "CreationTime"); migrationBuilder.CreateIndex( name: "IX_ServiceProCTWingPrivateProductInfo_IsNotUniqueKey", table: "ServiceProCTWingPrivateProductInfo", columns: new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, descending: new bool[0]); migrationBuilder.CreateIndex( name: "IX_ServiceProDeviceInfo_CreationTime", table: "ServiceProDeviceInfo", column: "CreationTime"); migrationBuilder.CreateIndex( name: "IX_ServiceProDeviceInfo_DeviceAddress", table: "ServiceProDeviceInfo", column: "DeviceAddress"); migrationBuilder.CreateIndex( name: "IX_ServiceProDeviceInfo_IsNotUniqueKey", table: "ServiceProDeviceInfo", columns: new[] { "Id", "DeviceName", "DeviceAddress", "IoTPlatformProductId", "CreationTime" }, descending: new bool[0]); migrationBuilder.CreateIndex( name: "IX_ServiceProOneNETAccountInfo_CreationTime", table: "ServiceProOneNETAccountInfo", column: "CreationTime"); migrationBuilder.CreateIndex( name: "IX_ServiceProOneNETAccountInfo_IsNotUniqueKey", table: "ServiceProOneNETAccountInfo", columns: new[] { "Id", "OneNETAccountId", "AccountName", "PhoneNumber", "CreationTime" }, descending: new bool[0]); migrationBuilder.CreateIndex( name: "IX_ServiceProOneNETProductInfo_CreationTime", table: "ServiceProOneNETProductInfo", column: "CreationTime"); migrationBuilder.CreateIndex( name: "IX_ServiceProOneNETProductInfo_IsNotUniqueKey", table: "ServiceProOneNETProductInfo", columns: new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" }, descending: new bool[0]); migrationBuilder.CreateIndex( name: "IX_ServiceProTextTemplates_Code", table: "ServiceProTextTemplates", column: "Code"); migrationBuilder.CreateIndex( name: "IX_ServiceProUserRefreshTokens_RefreshToken", table: "ServiceProUserRefreshTokens", column: "RefreshToken"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AbpAuditLogActions"); migrationBuilder.DropTable( name: "AbpBackgroundJobs"); migrationBuilder.DropTable( name: "AbpClaimTypes"); migrationBuilder.DropTable( name: "AbpDataDictionaryDetails"); migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); migrationBuilder.DropTable( name: "AbpFeatureGroups"); migrationBuilder.DropTable( name: "AbpFeatures"); migrationBuilder.DropTable( name: "AbpFeatureValues"); migrationBuilder.DropTable( name: "AbpFileObjects"); migrationBuilder.DropTable( name: "AbpLanguages"); migrationBuilder.DropTable( name: "AbpLanguageTexts"); migrationBuilder.DropTable( name: "AbpLinkUsers"); migrationBuilder.DropTable( name: "AbpNotifications"); migrationBuilder.DropTable( name: "AbpNotificationSubscriptions"); migrationBuilder.DropTable( name: "AbpOrganizationUnitRoles"); migrationBuilder.DropTable( name: "AbpPermissionGrants"); migrationBuilder.DropTable( name: "AbpPermissionGroups"); migrationBuilder.DropTable( name: "AbpPermissions"); migrationBuilder.DropTable( name: "AbpRoleClaims"); migrationBuilder.DropTable( name: "AbpSecurityLogs"); migrationBuilder.DropTable( name: "AbpSessions"); migrationBuilder.DropTable( name: "AbpSettingDefinitions"); migrationBuilder.DropTable( name: "AbpSettings"); migrationBuilder.DropTable( name: "AbpTenantConnectionStrings"); migrationBuilder.DropTable( name: "AbpUserClaims"); migrationBuilder.DropTable( name: "AbpUserDelegations"); migrationBuilder.DropTable( name: "AbpUserLogins"); migrationBuilder.DropTable( name: "AbpUserOrganizationUnits"); migrationBuilder.DropTable( name: "AbpUserRoles"); migrationBuilder.DropTable( name: "AbpUserTokens"); migrationBuilder.DropTable( name: "ServiceProCTWingAccountInfo"); migrationBuilder.DropTable( name: "ServiceProCTWingPrivateProductInfo"); migrationBuilder.DropTable( name: "ServiceProDeviceInfo"); migrationBuilder.DropTable( name: "ServiceProMenus"); migrationBuilder.DropTable( name: "ServiceProOneNETAccountInfo"); migrationBuilder.DropTable( name: "ServiceProOneNETProductInfo"); migrationBuilder.DropTable( name: "ServiceProTextTemplates"); migrationBuilder.DropTable( name: "ServiceProUserRefreshTokens"); migrationBuilder.DropTable( name: "AbpDataDictionaries"); migrationBuilder.DropTable( name: "AbpEntityChanges"); migrationBuilder.DropTable( name: "AbpTenants"); migrationBuilder.DropTable( name: "AbpOrganizationUnits"); migrationBuilder.DropTable( name: "AbpRoles"); migrationBuilder.DropTable( name: "AbpUsers"); migrationBuilder.DropTable( name: "AbpAuditLogs"); } } }