2026-03-25 22:10:28 +08:00

2162 lines
139 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Newtonsoft.Json.Linq;
#nullable disable
namespace JiShe.IoT.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpAuditLogExcelFiles",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
FileName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogExcelFiles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpAuditLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
ApplicationName = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
UserId = table.Column<Guid>(type: "uuid", nullable: true),
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
TenantName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
ImpersonatorUserId = table.Column<Guid>(type: "uuid", nullable: true),
ImpersonatorUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ImpersonatorTenantId = table.Column<Guid>(type: "uuid", nullable: true),
ImpersonatorTenantName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
ExecutionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
ExecutionDuration = table.Column<int>(type: "integer", nullable: false),
ClientIpAddress = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
ClientName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
ClientId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
CorrelationId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
BrowserInfo = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
HttpMethod = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: true),
Url = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
Exceptions = table.Column<string>(type: "text", nullable: true),
Comments = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
HttpStatusCode = table.Column<int>(type: "integer", nullable: true),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpBackgroundJobs",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
ApplicationName = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
JobName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
JobArgs = table.Column<string>(type: "character varying(1048576)", maxLength: 1048576, nullable: false),
TryCount = table.Column<short>(type: "smallint", nullable: false, defaultValue: (short)0),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
NextTryTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
LastTryTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
IsAbandoned = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
Priority = table.Column<byte>(type: "smallint", nullable: false, defaultValue: (byte)15),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Required = table.Column<bool>(type: "boolean", nullable: false),
IsStatic = table.Column<bool>(type: "boolean", nullable: false),
Regex = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
RegexDescription = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
Description = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ValueType = table.Column<int>(type: "integer", nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpDataDictionaries",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
Code = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
DisplayText = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpDataDictionaries", x => x.Id);
},
comment: "数据字典");
migrationBuilder.CreateTable(
name: "AbpFeatureGroups",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpFeatures",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
GroupName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ParentName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
DefaultValue = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
IsVisibleToClients = table.Column<bool>(type: "boolean", nullable: false),
IsAvailableToHost = table.Column<bool>(type: "boolean", nullable: false),
AllowedProviders = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ValueType = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatures", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpFeatureValues",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Value = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ProviderName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpFileObjects",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
FileName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "文件名称"),
FileSize = table.Column<long>(type: "bigint", nullable: false, comment: "文件大小"),
ContentType = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "文件名称"),
Md5Hash = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "文件MD5"),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFileObjects", x => x.Id);
},
comment: "文件管理");
migrationBuilder.CreateTable(
name: "AbpLanguages",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
CultureName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "语言名称"),
UiCultureName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "Ui语言名称"),
DisplayName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "显示名称"),
FlagIcon = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "图标"),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
IsDefault = table.Column<bool>(type: "boolean", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpLanguages", x => x.Id);
},
comment: "语言管理");
migrationBuilder.CreateTable(
name: "AbpLanguageTexts",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
CultureName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "语言名称"),
ResourceName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "资源名称"),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false, comment: "名称"),
Value = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false, comment: "值"),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpLanguageTexts", x => x.Id);
},
comment: "语言文本管理");
migrationBuilder.CreateTable(
name: "AbpLinkUsers",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
SourceUserId = table.Column<Guid>(type: "uuid", nullable: false),
SourceTenantId = table.Column<Guid>(type: "uuid", nullable: true),
TargetUserId = table.Column<Guid>(type: "uuid", nullable: false),
TargetTenantId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpLinkUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpNotifications",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
Title = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Content = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
MessageType = table.Column<int>(type: "integer", nullable: false),
MessageLevel = table.Column<int>(type: "integer", nullable: false),
SenderUserId = table.Column<Guid>(type: "uuid", nullable: false),
SenderUserName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ReceiveUserId = table.Column<Guid>(type: "uuid", nullable: true),
ReceiveUserName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
Read = table.Column<bool>(type: "boolean", nullable: false),
ReadTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpNotifications", x => x.Id);
},
comment: "消息通知管理");
migrationBuilder.CreateTable(
name: "AbpNotificationSubscriptions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
NotificationId = table.Column<Guid>(type: "uuid", nullable: false),
ReceiveUserId = table.Column<Guid>(type: "uuid", nullable: false),
ReceiveUserName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
Read = table.Column<bool>(type: "boolean", nullable: false),
ReadTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpNotificationSubscriptions", x => x.Id);
},
comment: "消息订阅者");
migrationBuilder.CreateTable(
name: "AbpOrganizationUnits",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
ParentId = table.Column<Guid>(type: "uuid", nullable: true),
Code = table.Column<string>(type: "character varying(95)", maxLength: 95, nullable: false),
DisplayName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
EntityVersion = table.Column<int>(type: "integer", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", 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");
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ProviderName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGroups",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
GroupName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ResourceName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ManagementPermissionName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
ParentName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
MultiTenancySide = table.Column<byte>(type: "smallint", nullable: false),
Providers = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
StateCheckers = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpResourcePermissionGrants",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ProviderName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
ResourceName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
ResourceKey = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpResourcePermissionGrants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
IsDefault = table.Column<bool>(type: "boolean", nullable: false),
IsStatic = table.Column<bool>(type: "boolean", nullable: false),
IsPublic = table.Column<bool>(type: "boolean", nullable: false),
EntityVersion = table.Column<int>(type: "integer", nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSecurityLogs",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
ApplicationName = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
Identity = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
Action = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
UserId = table.Column<Guid>(type: "uuid", nullable: true),
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
TenantName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
ClientId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
CorrelationId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
ClientIpAddress = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
BrowserInfo = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSessions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
SessionId = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Device = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
DeviceInfo = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
ClientId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
IpAddresses = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
SignedIn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
LastAccessed = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSessions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettingDefinitions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
DefaultValue = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
IsVisibleToClients = table.Column<bool>(type: "boolean", nullable: false),
Providers = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
IsInherited = table.Column<bool>(type: "boolean", nullable: false),
IsEncrypted = table.Column<bool>(type: "boolean", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettings",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Value = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
ProviderName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpTenants",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
NormalizedName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
EntityVersion = table.Column<int>(type: "integer", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpTenants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUserDelegations",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
SourceUserId = table.Column<Guid>(type: "uuid", nullable: false),
TargetUserId = table.Column<Guid>(type: "uuid", nullable: false),
StartTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
EndTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserDelegations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUsers",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
Surname = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
PasswordHash = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
SecurityStamp = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
IsExternal = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
PhoneNumber = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
IsActive = table.Column<bool>(type: "boolean", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
AccessFailedCount = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
ShouldChangePasswordOnNextLogin = table.Column<bool>(type: "boolean", nullable: false),
EntityVersion = table.Column<int>(type: "integer", nullable: false),
LastPasswordChangeTime = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LastSignInTime = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ServiceProCTWingAccountInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
AccountName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "账号名称"),
AccountId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "账号ID"),
AppId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "应用 ID"),
AppKey = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "应用 AppKey"),
AppSecret = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "应用 AppSecret"),
PlatformTenantId = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "平台租户ID"),
CommunicationAddress = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "通讯服务地址"),
PhoneNumber = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "手机号码"),
ProductCount = table.Column<int>(type: "integer", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProCTWingAccountInfo", x => x.Id);
},
comment: "CTWing账号信息");
migrationBuilder.CreateTable(
name: "ServiceProCTWingPrivateProductInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CTWingAccountId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "账号ID"),
AccountPhoneNumber = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "账户手机号"),
CommunicationAddress = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "通讯服务地址"),
MasterKey = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "OpenAPI 通信主密钥"),
FeatureAccesskey = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "设备访问密钥"),
IoTPlatformProductId = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "产品ID"),
ProductName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "产品名称"),
Protocol = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: true, comment: "通讯协议"),
ProductDesc = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "必填,产品描述"),
ProductType = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "一级分类名"),
SecondaryType = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "二级分类名"),
ThirdType = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "三级分类名"),
NodeType = table.Column<int>(type: "integer", nullable: false),
AccessType = table.Column<int>(type: "integer", nullable: false),
NetworkType = table.Column<int>(type: "integer", nullable: false),
ProductProtocol = table.Column<int>(type: "integer", nullable: false),
AuthType = table.Column<int>(type: "integer", nullable: false),
DataEncryption = table.Column<int>(type: "integer", nullable: false),
TupIsThrough = table.Column<int>(type: "integer", nullable: false),
TupDeviceModel = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "设备型号"),
DeviceCount = table.Column<int>(type: "integer", nullable: false),
ThingModelFileId = table.Column<Guid>(type: "uuid", nullable: true, comment: "物模型文件Id"),
ThingModelFileName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "物模型文件名称"),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false, comment: "是否启用"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProCTWingPrivateProductInfo", x => x.Id);
},
comment: "CTWing产品信息");
migrationBuilder.CreateTable(
name: "ServiceProDeviceFirmwareInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
IoTPlatform = table.Column<int>(type: "integer", nullable: false, comment: "物联网平台类型"),
IoTPlatformProductId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"),
IoTPlatformProductName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false, comment: "物联网平台中对应的产品名称"),
FirmwareVersion = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "固件版本"),
FirmwareFileId = table.Column<Guid>(type: "uuid", nullable: false, comment: "固件文件Id"),
FirmwareFileName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false, comment: "固件文件名称"),
FirmwareHashCode = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false, comment: "固件哈希值"),
FirmwareLength = table.Column<long>(type: "bigint", nullable: false),
IsEnable = table.Column<bool>(type: "boolean", nullable: false, comment: "是否启用"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProDeviceFirmwareInfo", x => x.Id);
},
comment: "设备固件信息");
migrationBuilder.CreateTable(
name: "ServiceProDeviceInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DeviceName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "设备名称"),
DeviceAddress = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false, comment: "设备地址"),
IoTPlatform = table.Column<int>(type: "integer", nullable: false, comment: "物联网平台类型,默认没有指定"),
DeviceType = table.Column<int>(type: "integer", nullable: false, comment: "设备类型,与业务系统无关,主要区分是网关设备、直连设备"),
IoTPlatformDeviceOpenInfo = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "物联网平台中对应的设备Id或者名称"),
PlatformPassword = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "物联网平台设备密码"),
IoTPlatformProductId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"),
IoTPlatformProductName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "物联网平台中对应的产品Name"),
IoTPlatformAccountId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的账号Id"),
AccountPhoneNumber = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "账户手机号"),
IoTPlatformResponse = table.Column<string>(type: "text", nullable: true, comment: "物联网平台返回的响应信息"),
IsPlatformPushSuccess = table.Column<bool>(type: "boolean", nullable: false, comment: "物联网平台推送是否成功"),
DeviceOnlineStatus = table.Column<int>(type: "integer", nullable: true, comment: "设备在线状态"),
LastOnlineTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "最后在线时间"),
LastOfflineTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "最后离线时间"),
DeviceSource = table.Column<int>(type: "integer", nullable: false, comment: "设备来源类型"),
IsNeedConfigDeviceModel = table.Column<bool>(type: "boolean", nullable: false, comment: "是否需要配置设备模型"),
DeviceThingModelDataId = table.Column<Guid>(type: "uuid", nullable: true, comment: "设备物模型数据Id"),
FirmwareVersion = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true, comment: "固件版本"),
UpgradeDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "升级日期"),
SubDeviceCapacity = table.Column<int>(type: "integer", nullable: false, defaultValue: 64, comment: "子设备容量"),
ReadingMode = table.Column<int>(type: "integer", nullable: false, defaultValue: 1, comment: "抄读模式"),
SimCardInfo = table.Column<string>(type: "jsonb", nullable: false, comment: "SIM卡信息"),
EncryptionType = table.Column<int>(type: "integer", nullable: false, defaultValue: 1, comment: "设备加密类型,类型不同给,鉴权路径资源不同,默认为一型一密"),
EncryptionMethod = table.Column<int>(type: "integer", nullable: false, defaultValue: 1, comment: "设备鉴权加密方式"),
NeedEquipmentProductionPlan = table.Column<int>(type: "integer", nullable: true, comment: "是否需要设备生产计划"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProDeviceInfo", x => x.Id);
},
comment: "设备信息");
migrationBuilder.CreateTable(
name: "ServiceProDeviceThingModelCommandInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DeviceThingModelId = table.Column<Guid>(type: "uuid", nullable: false, comment: "设备端物模型Id"),
IoTPlatform = table.Column<int>(type: "integer", nullable: false, comment: "物联网平台类型"),
CommandType = table.Column<int>(type: "integer", nullable: false, defaultValue: 0, comment: "指令类型"),
IoTPlatformProductId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"),
CommandName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false, comment: "指令名称"),
IssueCommand = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: false, comment: "完整的单个下发指令"),
PropertyArray = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false, comment: "指令设备端物模型的属性名称集合,JSON格式字符串数组"),
IsEnable = table.Column<bool>(type: "boolean", nullable: false, comment: "是否启用"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProDeviceThingModelCommandInfo", x => x.Id);
},
comment: "设备端透传指令详情");
migrationBuilder.CreateTable(
name: "ServiceProDeviceThingModelManagement",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DeviceModelName = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "设备端物模型名称"),
IoTPlatform = table.Column<int>(type: "integer", nullable: false, comment: "物联网平台类型,默认没有指定"),
IoTPlatformProductId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"),
ScriptName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "脚本函数名称"),
FunctionScript = table.Column<string>(type: "text", nullable: true, comment: "脚本函数体"),
FunctionAnalysisFlag = table.Column<bool>(type: "boolean", nullable: false, comment: "函数解析标记默认为false 不能解析"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProDeviceThingModelManagement", x => x.Id);
},
comment: "设备端物模型管理");
migrationBuilder.CreateTable(
name: "ServiceProDeviceThingModelPropertylInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DeviceThingModelId = table.Column<Guid>(type: "uuid", nullable: false, comment: "设备端物模型Id"),
IoTPlatform = table.Column<int>(type: "integer", nullable: false, comment: "物联网平台类型"),
IoTPlatformProductId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"),
IoTPlatformThingModelDataId = table.Column<Guid>(type: "uuid", nullable: false, comment: "系统中平台端物模型数据Id"),
FiledType = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型"),
IoTPlatformRawFieldName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称"),
IoTPlatformRawFieldDataType = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: true, comment: "物联网平台中对应的产品物模型属性或者事件数据类型"),
StandardFieldName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称"),
StandardFieldValueType = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false, comment: "标准物模型字段值类型"),
StandardFieldDisplayName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称"),
IsValueNeedConvert = table.Column<bool>(type: "boolean", nullable: false, comment: "是否需要值类型转换"),
NativeSkipNumber = table.Column<int>(type: "integer", nullable: false, comment: "正序跳过数量"),
NativeTakeNumber = table.Column<int>(type: "integer", nullable: false, comment: "正序获取数量"),
ParsingSequence = table.Column<int>(type: "integer", nullable: false, comment: "解析顺序1234或者3412(高低反转)"),
ReversalSkipNumber = table.Column<int>(type: "integer", nullable: true, comment: "反转跳过数量"),
ReversalTakeNumber = table.Column<int>(type: "integer", nullable: true, comment: "反转获取数量"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProDeviceThingModelPropertylInfo", x => x.Id);
},
comment: "设备端物模型属性信息,是指设备端支持的属性或者事件");
migrationBuilder.CreateTable(
name: "ServiceProDeviceUpgradeRecord",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DeviceDataId = table.Column<Guid>(type: "uuid", nullable: false, comment: "设备数据Id"),
DeviceName = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "设备名称"),
DeviceAddress = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "设备地址"),
OldFirmwareVersion = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "旧的固件版本"),
NowFirmwareVersion = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "当前固件版本"),
UpgradeDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, comment: "升级日期"),
UpgradeSource = table.Column<int>(type: "integer", nullable: false, comment: "升级来源"),
UpgradeMessage = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: false, comment: "升级信息"),
UpgradeStatus = table.Column<int>(type: "integer", nullable: false, comment: "升级状态"),
UpgradeIdentifier = table.Column<long>(type: "bigint", nullable: false, comment: "升级标识符号"),
FirmwareSignature = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "签名校验值"),
UpgradeResult = table.Column<int>(type: "integer", nullable: true, comment: "升级结果"),
UpgradeDescription = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: false, comment: "升级描述"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProDeviceUpgradeRecord", x => x.Id);
},
comment: "设备升级记录");
migrationBuilder.CreateTable(
name: "ServiceProIoTPlatformThingModelInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
IoTPlatform = table.Column<int>(type: "integer", nullable: false, comment: "物联网平台类型,默认没有指定"),
IoTPlatformProductId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应的产品Id"),
FiledType = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台中对应产品物模型属性或者事件类型"),
IoTPlatformRawFieldName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "物联网平台中对应的产品物模型属性或者事件名称"),
IoTPlatformRawFieldDataType = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true, comment: "物联网平台中对应的产品物模型属性或者事件数据类型"),
IoTPlatformRawFieldExtension = table.Column<JToken>(type: "jsonb", nullable: true, comment: "物联网平台中对应产品物模型标识符扩展,结构体或者数组的时候,是参数的名称与长度的键值对,其他类型就是长度或者值范围"),
StandardFieldName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称"),
StandardFieldValueType = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false, comment: "标准物模型字段值类型"),
StandardFieldDisplayName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "管理后台产品标准的物模型属性或者事件名称"),
StandardFieldFieldExtension = table.Column<JToken>(type: "jsonb", nullable: true, comment: "标准物模型字段标识符扩展,数组或者结构体时候的参数或者元素名称集合"),
IsValueNeedConvert = table.Column<bool>(type: "boolean", nullable: false, comment: "是否需要值类型转换"),
IsSpecialIdentifier = table.Column<bool>(type: "boolean", nullable: false, comment: "是否是特殊物模型标识符"),
IsOperableIdentifier = table.Column<bool>(type: "boolean", nullable: false, comment: "是否可操作物模型标识符"),
AccessMode = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: false, defaultValue: "r", comment: "物模型标识符访问模式"),
IdentifierType = table.Column<int>(type: "integer", nullable: false, comment: "物模型标识符类型"),
CallServiceOperateCommand = table.Column<string>(type: "text", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProIoTPlatformThingModelInfo", x => x.Id);
},
comment: "平台端物模型信息");
migrationBuilder.CreateTable(
name: "ServiceProMenus",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
ParentId = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "唯一编码"),
Title = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "标题"),
DisplayTitle = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "标准多语言"),
Icon = table.Column<string>(type: "text", nullable: true, comment: "图标"),
KeepAlive = table.Column<bool>(type: "boolean", nullable: false, comment: "是否缓存"),
HideInMenu = table.Column<bool>(type: "boolean", nullable: false, comment: "是否显示"),
Order = table.Column<int>(type: "integer", nullable: false, comment: "排序"),
Path = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: false, comment: "路由/接口地址"),
MenuType = table.Column<int>(type: "integer", nullable: false, comment: "菜单类型"),
OpenType = table.Column<int>(type: "integer", nullable: false, comment: "打开类型"),
Url = table.Column<string>(type: "text", nullable: true, comment: "内外链地址"),
Component = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true, comment: "组件地址"),
Policy = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "授权策略名称"),
Enabled = table.Column<bool>(type: "boolean", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProMenus", x => x.Id);
},
comment: "动态菜单管理");
migrationBuilder.CreateTable(
name: "ServiceProOneNETAccountInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
AccountName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "账号名称"),
OneNETAccountId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "账户Id"),
PhoneNumber = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "手机号码"),
AccountAccesskey = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false, comment: "账户通信密钥,平台可以重置密钥"),
ProductCount = table.Column<int>(type: "integer", nullable: false, comment: "产品数量"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProOneNETAccountInfo", x => x.Id);
},
comment: "OneNET账号管理");
migrationBuilder.CreateTable(
name: "ServiceProOneNETProductInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
OneNETAccountId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "账户Id"),
AccountPhoneNumber = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true, comment: "账户手机号"),
IoTPlatformProductId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "物联网平台对应的产品Id"),
ProductName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true, comment: "产品名称"),
ProductAccesskey = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false, comment: "产品访问密钥"),
ThingModelFileId = table.Column<Guid>(type: "uuid", nullable: true, comment: "物模型文件Id"),
ThingModelFileName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "物模型文件名称"),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
AccessProtocol = table.Column<int>(type: "integer", nullable: false, comment: "接入协议"),
DataProtocol = table.Column<int>(type: "integer", nullable: false, comment: "数据协议"),
NodeType = table.Column<int>(type: "integer", nullable: false, comment: "节点类型"),
ProductCreateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "产品创建时间"),
ProductUpdateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "最近修改时间"),
Network = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "联网方式"),
Manufacturer = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "产品厂商"),
Model = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "产品型号"),
Brand = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "产品品牌"),
Status = table.Column<int>(type: "integer", nullable: false, comment: "开发状态"),
OwnDeviceCount = table.Column<int>(type: "integer", nullable: false, comment: "自有设备总数"),
OnlineDeviceCount = table.Column<int>(type: "integer", nullable: false, comment: "在线设备总数"),
OfflineDeviceCount = table.Column<int>(type: "integer", nullable: false, comment: "离线设备数"),
NotActiveDeviceCount = table.Column<int>(type: "integer", nullable: false, comment: "未激活设备数"),
CommunicationAddress = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "通讯服务地址"),
CommunicationAddressTLS = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true, comment: "TLS通讯服务地址"),
ThingModelInfos = table.Column<string>(type: "text", nullable: true, comment: "平台物模型信息"),
IsNeedPushData = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false, comment: "是否需要推送数据"),
DataPushType = table.Column<int>(type: "integer", nullable: true, comment: "数据推送类型, 1-HttpPost2-ReisSubscription"),
DataPushServer = table.Column<string>(type: "text", nullable: true, comment: "数据推送服务地址信息例如HTTP地址http://192.168.1.1:8080Redis订阅地址192.168.1.1:6379"),
DataPushInfo = table.Column<string>(type: "text", nullable: true, comment: "数据推送信息,HTTP推送就是推送路径Redis推送主题或者key"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProOneNETProductInfo", x => x.Id);
},
comment: "OneNET产品管理");
migrationBuilder.CreateTable(
name: "ServiceProSubDeviceManagementInfo",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DeviceDataId = table.Column<Guid>(type: "uuid", nullable: false, comment: "网关设备或直连设备数据Id"),
DeviceAddress = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false, comment: "网关设备或直连设备地址"),
SubDeviceName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "子设备名称"),
SubDeviceAddress = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false, comment: "子设备地址"),
SubDeviceIndex = table.Column<int>(type: "integer", nullable: false, comment: "子设备索引,抑或是主设备下唯一标识符、计量代码"),
SubDeviceBrandCode = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false, comment: "子设备品牌编码"),
IsSynced = table.Column<bool>(type: "boolean", nullable: false, comment: "是否同步"),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
TenantId = table.Column<Guid>(type: "uuid", nullable: true, comment: "租户ID"),
Remark = table.Column<string>(type: "text", nullable: true, comment: "备注"),
OSACreatorId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权创建者Id"),
OSALastModifierId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后修改者Id"),
OSADeleterId = table.Column<int>(type: "integer", nullable: true, comment: "旧系统授权最后删除者Id"),
ExtraProperties = table.Column<string>(type: "text", nullable: true, comment: "扩展属性,用于存储自定义字段,JSON格式")
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProSubDeviceManagementInfo", x => x.Id);
},
comment: "子设备信息,需要下发配置的网关设备才用到");
migrationBuilder.CreateTable(
name: "ServiceProTextTemplates",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "名称"),
Code = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "编码"),
Content = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false, comment: "内容"),
CultureName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "语言"),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProTextTemplates", x => x.Id);
},
comment: "模板管理");
migrationBuilder.CreateTable(
name: "ServiceProUserRefreshTokens",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
UserId = table.Column<Guid>(type: "uuid", nullable: false, comment: "用户id"),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
RefreshToken = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false, comment: "刷新token"),
Token = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false, comment: "Token"),
IsUsed = table.Column<bool>(type: "boolean", nullable: false, comment: "是否使用"),
ExpirationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, comment: "过期时间"),
ExtraProperties = table.Column<string>(type: "text", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ServiceProUserRefreshTokens", x => x.Id);
},
comment: "刷新Token");
migrationBuilder.CreateTable(
name: "AbpAuditLogActions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
AuditLogId = table.Column<Guid>(type: "uuid", nullable: false),
ServiceName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
MethodName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
Parameters = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: true),
ExecutionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
ExecutionDuration = table.Column<int>(type: "integer", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpEntityChanges",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
AuditLogId = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
ChangeTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
ChangeType = table.Column<byte>(type: "smallint", nullable: false),
EntityTenantId = table.Column<Guid>(type: "uuid", nullable: true),
EntityId = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
EntityTypeFullName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpDataDictionaryDetails",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DataDictionaryId = table.Column<Guid>(type: "uuid", nullable: false),
Code = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Order = table.Column<int>(type: "integer", nullable: false),
DisplayText = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
Description = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
ExtendedAttribute = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ExtendedAttributeValue = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpDataDictionaryDetails", x => x.Id);
table.ForeignKey(
name: "FK_AbpDataDictionaryDetails_AbpDataDictionaries_DataDictionary~",
column: x => x.DataDictionaryId,
principalTable: "AbpDataDictionaries",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
},
comment: "数据字典详情");
migrationBuilder.CreateTable(
name: "AbpOrganizationUnitRoles",
columns: table => new
{
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
OrganizationUnitId = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId });
table.ForeignKey(
name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationU~",
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);
});
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
ClaimType = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpTenantConnectionStrings",
columns: table => new
{
TenantId = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
Value = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpUserClaims",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
ClaimType = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpUserLogins",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
LoginProvider = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
ProviderKey = table.Column<string>(type: "character varying(196)", maxLength: 196, nullable: false),
ProviderDisplayName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpUserOrganizationUnits",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
OrganizationUnitId = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId });
table.ForeignKey(
name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationU~",
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);
});
migrationBuilder.CreateTable(
name: "AbpUserPasskeys",
columns: table => new
{
CredentialId = table.Column<byte[]>(type: "bytea", maxLength: 1024, nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
Data = table.Column<string>(type: "jsonb", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserPasskeys", x => x.CredentialId);
table.ForeignKey(
name: "FK_AbpUserPasskeys_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserPasswordHistories",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
Password = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserPasswordHistories", x => new { x.UserId, x.Password });
table.ForeignKey(
name: "FK_AbpUserPasswordHistories_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserRoles",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpUserTokens",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
LoginProvider = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
Value = table.Column<string>(type: "text", nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpEntityPropertyChanges",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
EntityChangeId = table.Column<Guid>(type: "uuid", nullable: false),
NewValue = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
OriginalValue = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
PropertyName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
PropertyTypeFullName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false)
},
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);
});
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId",
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Executio~",
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_Targe~",
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_ResourceName_Name",
table: "AbpPermissions",
columns: new[] { "ResourceName", "Name" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Reso~",
table: "AbpResourcePermissionGrants",
columns: new[] { "TenantId", "Name", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" },
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_AbpUserPasskeys_UserId",
table: "AbpUserPasskeys",
column: "UserId");
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_ServiceProDeviceFirmwareInfo_CreationTime",
table: "ServiceProDeviceFirmwareInfo",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceFirmwareInfo_IoTPlatformProductId",
table: "ServiceProDeviceFirmwareInfo",
column: "IoTPlatformProductId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceFirmwareInfo_IsNotUniqueKey",
table: "ServiceProDeviceFirmwareInfo",
columns: new[] { "Id", "IoTPlatformProductId", "FirmwareVersion", "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_ServiceProDeviceThingModelCommandInfo_CreationTime",
table: "ServiceProDeviceThingModelCommandInfo",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelCommandInfo_DeviceThingModelId",
table: "ServiceProDeviceThingModelCommandInfo",
column: "DeviceThingModelId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey",
table: "ServiceProDeviceThingModelCommandInfo",
columns: new[] { "Id", "DeviceThingModelId", "IoTPlatformProductId", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelManagement_CreationTime",
table: "ServiceProDeviceThingModelManagement",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelManagement_IoTPlatformProductId",
table: "ServiceProDeviceThingModelManagement",
column: "IoTPlatformProductId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey1",
table: "ServiceProDeviceThingModelManagement",
columns: new[] { "Id", "DeviceModelName", "IoTPlatformProductId", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelPropertylInfo_CreationTime",
table: "ServiceProDeviceThingModelPropertylInfo",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceThingModelPropertylInfo_IoTPlatformProductId",
table: "ServiceProDeviceThingModelPropertylInfo",
column: "IoTPlatformProductId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey2",
table: "ServiceProDeviceThingModelPropertylInfo",
columns: new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceUpgradeRecord_CreationTime",
table: "ServiceProDeviceUpgradeRecord",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceUpgradeRecord_DeviceAddress",
table: "ServiceProDeviceUpgradeRecord",
column: "DeviceAddress");
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceUpgradeRecord_IsNotUniqueKey",
table: "ServiceProDeviceUpgradeRecord",
columns: new[] { "Id", "DeviceAddress", "UpgradeIdentifier", "NowFirmwareVersion", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProDeviceUpgradeRecord_UpgradeIdentifier",
table: "ServiceProDeviceUpgradeRecord",
column: "UpgradeIdentifier",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_CreationTime",
table: "ServiceProIoTPlatformThingModelInfo",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IoTPlatformProductId",
table: "ServiceProIoTPlatformThingModelInfo",
column: "IoTPlatformProductId");
migrationBuilder.CreateIndex(
name: "IX_ServiceProIoTPlatformThingModelInfo_IsNotUniqueKey3",
table: "ServiceProIoTPlatformThingModelInfo",
columns: new[] { "Id", "IoTPlatformProductId", "IoTPlatformRawFieldName", "StandardFieldName", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_Menus_IsNotUniqueKey",
table: "ServiceProMenus",
columns: new[] { "Id", "Name", "Path", "MenuType", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProMenus_CreationTime",
table: "ServiceProMenus",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProMenus_Name",
table: "ServiceProMenus",
column: "Name");
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_IoTPlatformProductId",
table: "ServiceProOneNETProductInfo",
column: "IoTPlatformProductId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ServiceProOneNETProductInfo_IsNotUniqueKey",
table: "ServiceProOneNETProductInfo",
columns: new[] { "Id", "IoTPlatformProductId", "ProductName", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProSubDeviceManagementInfo_CreationTime",
table: "ServiceProSubDeviceManagementInfo",
column: "CreationTime");
migrationBuilder.CreateIndex(
name: "IX_ServiceProSubDeviceManagementInfo_DeviceAddress",
table: "ServiceProSubDeviceManagementInfo",
column: "DeviceAddress");
migrationBuilder.CreateIndex(
name: "IX_ServiceProSubDeviceManagementInfo_IsNotUniqueKey",
table: "ServiceProSubDeviceManagementInfo",
columns: new[] { "Id", "DeviceAddress", "SubDeviceIndex", "SubDeviceAddress", "CreationTime" },
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_ServiceProSubDeviceManagementInfo_SubDeviceAddress",
table: "ServiceProSubDeviceManagementInfo",
column: "SubDeviceAddress");
migrationBuilder.CreateIndex(
name: "IX_ServiceProSubDeviceManagementInfo_SubDeviceIndex",
table: "ServiceProSubDeviceManagementInfo",
column: "SubDeviceIndex");
migrationBuilder.CreateIndex(
name: "IX_ServiceProTextTemplates_Code",
table: "ServiceProTextTemplates",
column: "Code");
migrationBuilder.CreateIndex(
name: "IX_ServiceProUserRefreshTokens_RefreshToken",
table: "ServiceProUserRefreshTokens",
column: "RefreshToken");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpAuditLogActions");
migrationBuilder.DropTable(
name: "AbpAuditLogExcelFiles");
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: "AbpResourcePermissionGrants");
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: "AbpUserPasskeys");
migrationBuilder.DropTable(
name: "AbpUserPasswordHistories");
migrationBuilder.DropTable(
name: "AbpUserRoles");
migrationBuilder.DropTable(
name: "AbpUserTokens");
migrationBuilder.DropTable(
name: "ServiceProCTWingAccountInfo");
migrationBuilder.DropTable(
name: "ServiceProCTWingPrivateProductInfo");
migrationBuilder.DropTable(
name: "ServiceProDeviceFirmwareInfo");
migrationBuilder.DropTable(
name: "ServiceProDeviceInfo");
migrationBuilder.DropTable(
name: "ServiceProDeviceThingModelCommandInfo");
migrationBuilder.DropTable(
name: "ServiceProDeviceThingModelManagement");
migrationBuilder.DropTable(
name: "ServiceProDeviceThingModelPropertylInfo");
migrationBuilder.DropTable(
name: "ServiceProDeviceUpgradeRecord");
migrationBuilder.DropTable(
name: "ServiceProIoTPlatformThingModelInfo");
migrationBuilder.DropTable(
name: "ServiceProMenus");
migrationBuilder.DropTable(
name: "ServiceProOneNETAccountInfo");
migrationBuilder.DropTable(
name: "ServiceProOneNETProductInfo");
migrationBuilder.DropTable(
name: "ServiceProSubDeviceManagementInfo");
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");
}
}
}