//
using System;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "5.0.7")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("IoTSharp.Data.AuditLog", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("ActionData")
.HasColumnType("jsonb");
b.Property("ActionName")
.HasColumnType("text");
b.Property("ActionResult")
.HasColumnType("jsonb");
b.Property("ActiveDateTime")
.HasColumnType("timestamp without time zone");
b.Property("CustomerId")
.HasColumnType("uuid");
b.Property("ObjectID")
.HasColumnType("uuid");
b.Property("ObjectName")
.HasColumnType("text");
b.Property("ObjectType")
.HasColumnType("integer");
b.Property("TenantId")
.HasColumnType("uuid");
b.Property("UserId")
.HasColumnType("text");
b.Property("UserName")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("CustomerId");
b.HasIndex("TenantId");
b.ToTable("AuditLog");
});
modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AuthToken")
.HasColumnType("text");
b.Property("CustomerId")
.HasColumnType("uuid");
b.Property("Name")
.HasColumnType("text");
b.Property("TenantId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CustomerId");
b.HasIndex("TenantId");
b.ToTable("AuthorizedKeys");
});
modelBuilder.Entity("IoTSharp.Data.BaseDictionary", b =>
{
b.Property("DictionaryId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("Dictionary18NKeyName")
.HasColumnType("text");
b.Property("DictionaryColor")
.HasColumnType("text");
b.Property("DictionaryDesc")
.HasColumnType("text");
b.Property("DictionaryGroupId")
.HasColumnType("bigint");
b.Property("DictionaryIcon")
.HasColumnType("text");
b.Property("DictionaryName")
.HasColumnType("text");
b.Property("DictionaryPattern")
.HasColumnType("text");
b.Property("DictionaryStatus")
.HasColumnType("integer");
b.Property("DictionaryTag")
.HasColumnType("text");
b.Property("DictionaryValue")
.HasColumnType("text");
b.Property("DictionaryValueType")
.HasColumnType("integer");
b.Property("DictionaryValueTypeName")
.HasColumnType("text");
b.HasKey("DictionaryId");
b.ToTable("BaseDictionaries");
});
modelBuilder.Entity("IoTSharp.Data.BaseDictionaryGroup", b =>
{
b.Property("DictionaryGroupId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("DictionaryGroup18NKeyName")
.HasColumnType("text");
b.Property("DictionaryGroupDesc")
.HasColumnType("text");
b.Property("DictionaryGroupKey")
.HasColumnType("text");
b.Property("DictionaryGroupName")
.HasColumnType("text");
b.Property("DictionaryGroupStatus")
.HasColumnType("integer");
b.Property("DictionaryGroupValueType")
.HasColumnType("integer");
b.Property("DictionaryGroupValueTypeName")
.HasColumnType("text");
b.HasKey("DictionaryGroupId");
b.ToTable("BaseDictionaryGroups");
});
modelBuilder.Entity("IoTSharp.Data.BaseEvent", b =>
{
b.Property("EventId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("Bizid")
.HasColumnType("text");
b.Property("CreaterDateTime")
.HasColumnType("timestamp without time zone");
b.Property("Creator")
.HasColumnType("uuid");
b.Property("EventDesc")
.HasColumnType("text");
b.Property("EventName")
.HasColumnType("text");
b.Property("EventStaus")
.HasColumnType("integer");
b.Property("MataData")
.HasColumnType("text");
b.Property("RuleId")
.HasColumnType("bigint");
b.Property("Type")
.HasColumnType("integer");
b.HasKey("EventId");
b.ToTable("BaseEvents");
});
modelBuilder.Entity("IoTSharp.Data.BaseI18N", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("AddDate")
.HasColumnType("timestamp without time zone");
b.Property("KeyName")
.HasColumnType("text");
b.Property("ResouceDesc")
.HasColumnType("text");
b.Property("ResouceGroupId")
.HasColumnType("integer");
b.Property("ResourceId")
.HasColumnType("bigint");
b.Property("ResourceKey")
.HasColumnType("text");
b.Property("ResourceTag")
.HasColumnType("text");
b.Property("ResourceType")
.HasColumnType("integer");
b.Property("Status")
.HasColumnType("integer");
b.Property("UserId")
.HasColumnType("uuid");
b.Property("ValueBG")
.HasColumnType("text");
b.Property("ValueCS")
.HasColumnType("text");
b.Property("ValueDA")
.HasColumnType("text");
b.Property("ValueDEDE")
.HasColumnType("text");
b.Property("ValueELGR")
.HasColumnType("text");
b.Property("ValueENGR")
.HasColumnType("text");
b.Property("ValueENUS")
.HasColumnType("text");
b.Property("ValueESES")
.HasColumnType("text");
b.Property("ValueFI")
.HasColumnType("text");
b.Property("ValueFRFR")
.HasColumnType("text");
b.Property("ValueHE")
.HasColumnType("text");
b.Property("ValueHRHR")
.HasColumnType("text");
b.Property("ValueHU")
.HasColumnType("text");
b.Property("ValueITIT")
.HasColumnType("text");
b.Property("ValueJAJP")
.HasColumnType("text");
b.Property("ValueKOKR")
.HasColumnType("text");
b.Property("ValueNL")
.HasColumnType("text");
b.Property("ValuePLPL")
.HasColumnType("text");
b.Property("ValuePT")
.HasColumnType("text");
b.Property("ValueSLSL")
.HasColumnType("text");
b.Property("ValueSR")
.HasColumnType("text");
b.Property("ValueSV")
.HasColumnType("text");
b.Property("ValueTRTR")
.HasColumnType("text");
b.Property("ValueUK")
.HasColumnType("text");
b.Property("ValueVI")
.HasColumnType("text");
b.Property("ValueZHCN")
.HasColumnType("text");
b.Property("ValueZHTW")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("BaseI18Ns");
});
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("Address")
.HasColumnType("text");
b.Property("City")
.HasColumnType("text");
b.Property("Country")
.HasColumnType("text");
b.Property("Email")
.HasColumnType("text");
b.Property("Name")
.HasColumnType("text");
b.Property("Phone")
.HasColumnType("text");
b.Property("Province")
.HasColumnType("text");
b.Property("Street")
.HasColumnType("text");
b.Property("TenantId")
.HasColumnType("uuid");
b.Property("ZipCode")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("TenantId");
b.ToTable("Customer");
});
modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
{
b.Property("Catalog")
.HasColumnType("integer");
b.Property("DeviceId")
.HasColumnType("uuid");
b.Property("KeyName")
.HasColumnType("text");
b.Property("DataSide")
.HasColumnType("integer");
b.Property("DateTime")
.HasColumnType("timestamp with time zone");
b.Property("Type")
.HasColumnType("integer");
b.Property("Value_Binary")
.HasColumnType("bytea");
b.Property("Value_Boolean")
.HasColumnType("boolean");
b.Property("Value_DateTime")
.HasColumnType("timestamp with time zone");
b.Property("Value_Double")
.HasColumnType("double precision");
b.Property("Value_Json")
.HasColumnType("jsonb");
b.Property("Value_Long")
.HasColumnType("bigint");
b.Property("Value_String")
.HasColumnType("text");
b.Property("Value_XML")
.HasColumnType("xml");
b.HasKey("Catalog", "DeviceId", "KeyName");
b.HasIndex("Catalog");
b.HasIndex("Catalog", "DeviceId");
b.ToTable("DataStorage");
b.HasDiscriminator("Catalog").HasValue(0);
});
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AuthorizedKeyId")
.HasColumnType("uuid");
b.Property("CustomerId")
.HasColumnType("uuid");
b.Property("DeviceType")
.HasColumnType("integer");
b.Property("LastActive")
.HasColumnType("timestamp without time zone");
b.Property("Name")
.HasColumnType("text");
b.Property("Online")
.HasColumnType("boolean");
b.Property("OwnerId")
.HasColumnType("uuid");
b.Property("TenantId")
.HasColumnType("uuid");
b.Property("Timeout")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("AuthorizedKeyId");
b.HasIndex("CustomerId");
b.HasIndex("OwnerId");
b.HasIndex("TenantId");
b.ToTable("Device");
b.HasDiscriminator("DeviceType").HasValue(0);
});
modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("DeviceId")
.HasColumnType("uuid");
b.Property("IdentityId")
.IsRequired()
.HasColumnType("text");
b.Property("IdentityType")
.HasColumnType("integer");
b.Property("IdentityValue")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("DeviceId");
b.ToTable("DeviceIdentities");
});
modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldInfo", b =>
{
b.Property("FieldId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("Creator")
.HasColumnType("uuid");
b.Property("FieldCode")
.HasColumnType("text");
b.Property("FieldCreateDate")
.HasColumnType("timestamp without time zone");
b.Property("FieldEditDate")
.HasColumnType("timestamp without time zone");
b.Property("FieldI18nKey")
.HasColumnType("text");
b.Property("FieldMaxLength")
.HasColumnType("integer");
b.Property("FieldName")
.HasColumnType("text");
b.Property("FieldPattern")
.HasColumnType("text");
b.Property("FieldPocoTypeName")
.HasColumnType("text");
b.Property("FieldStatus")
.HasColumnType("integer");
b.Property("FieldUIElement")
.HasColumnType("bigint");
b.Property("FieldUIElementSchema")
.HasColumnType("text");
b.Property("FieldUnit")
.HasColumnType("text");
b.Property("FieldValue")
.HasColumnType("text");
b.Property("FieldValueDataSource")
.HasColumnType("text");
b.Property("FieldValueLocalDataSource")
.HasColumnType("text");
b.Property("FieldValueType")
.HasColumnType("integer");
b.Property("FieldValueTypeName")
.HasColumnType("text");
b.Property("FormId")
.HasColumnType("bigint");
b.Property("IsEnabled")
.HasColumnType("boolean");
b.Property("IsRequired")
.HasColumnType("boolean");
b.HasKey("FieldId");
b.ToTable("DynamicFormFieldInfos");
});
modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldValueInfo", b =>
{
b.Property("FieldValueId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("BizId")
.HasColumnType("bigint");
b.Property("Creator")
.HasColumnType("uuid");
b.Property("FieldCode")
.HasColumnType("text");
b.Property("FieldCreateDate")
.HasColumnType("timestamp without time zone");
b.Property("FieldId")
.HasColumnType("bigint");
b.Property("FieldName")
.HasColumnType("text");
b.Property("FieldUnit")
.HasColumnType("text");
b.Property("FieldValue")
.HasColumnType("text");
b.Property("FieldValueType")
.HasColumnType("bigint");
b.Property("FromId")
.HasColumnType("bigint");
b.HasKey("FieldValueId");
b.ToTable("DynamicFormFieldValueInfos");
});
modelBuilder.Entity("IoTSharp.Data.DynamicFormInfo", b =>
{
b.Property("FormId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("BizId")
.HasColumnType("bigint");
b.Property("Creator")
.HasColumnType("uuid");
b.Property("FormCreator")
.HasColumnType("bigint");
b.Property("FormDesc")
.HasColumnType("text");
b.Property("FormLayout")
.HasColumnType("text");
b.Property("FormName")
.HasColumnType("text");
b.Property("FormSchame")
.HasColumnType("text");
b.Property("FormStatus")
.HasColumnType("integer");
b.Property("FromCreateDate")
.HasColumnType("timestamp without time zone");
b.Property("IsCompact")
.HasColumnType("boolean");
b.Property("ModelClass")
.HasColumnType("text");
b.Property("Url")
.HasColumnType("text");
b.HasKey("FormId");
b.ToTable("DynamicFormInfos");
});
modelBuilder.Entity("IoTSharp.Data.Flow", b =>
{
b.Property("FlowId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("Conditionexpression")
.HasColumnType("text");
b.Property("FlowType")
.HasColumnType("text");
b.Property("Flowdesc")
.HasColumnType("text");
b.Property("Flowname")
.HasColumnType("text");
b.Property("Incoming")
.HasColumnType("text");
b.Property("NodeProcessClass")
.HasColumnType("text");
b.Property("NodeProcessMethod")
.HasColumnType("text");
b.Property("NodeProcessParams")
.HasColumnType("text");
b.Property("NodeProcessScript")
.HasColumnType("text");
b.Property("NodeProcessScriptType")
.HasColumnType("text");
b.Property("NodeProcessType")
.HasColumnType("text");
b.Property("ObjectId")
.HasColumnType("text");
b.Property("Outgoing")
.HasColumnType("text");
b.Property("RuleId")
.HasColumnType("bigint");
b.Property("SourceId")
.HasColumnType("text");
b.Property("TargetId")
.HasColumnType("text");
b.Property("bpmnid")
.HasColumnType("text");
b.HasKey("FlowId");
b.ToTable("Flows");
});
modelBuilder.Entity("IoTSharp.Data.FlowOperation", b =>
{
b.Property("OperationId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("AddDate")
.HasColumnType("timestamp without time zone");
b.Property("BizId")
.HasColumnType("text");
b.Property("Data")
.HasColumnType("text");
b.Property("EventId")
.HasColumnType("bigint");
b.Property("FlowId")
.HasColumnType("bigint");
b.Property("NodeStatus")
.HasColumnType("integer");
b.Property("OperationDesc")
.HasColumnType("text");
b.Property("RuleId")
.HasColumnType("bigint");
b.Property("Step")
.HasColumnType("integer");
b.Property("Tag")
.HasColumnType("text");
b.Property("bpmnid")
.HasColumnType("text");
b.HasKey("OperationId");
b.ToTable("FlowOperations");
});
modelBuilder.Entity("IoTSharp.Data.FlowRule", b =>
{
b.Property("RuleId")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("CreatTime")
.HasColumnType("timestamp without time zone");
b.Property("Creator")
.HasColumnType("text");
b.Property("DefinitionsXml")
.HasColumnType("text");
b.Property("Describes")
.HasColumnType("text");
b.Property("ExecutableCode")
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("RuleDesc")
.HasColumnType("text");
b.Property("RuleStatus")
.HasColumnType("integer");
b.Property("RuleType")
.HasColumnType("integer");
b.Property("Runner")
.HasColumnType("text");
b.HasKey("RuleId");
b.ToTable("FlowRules");
});
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CustomerId")
.HasColumnType("uuid");
b.Property("IdentityUserId")
.HasColumnType("text");
b.Property("TenantId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CustomerId");
b.HasIndex("IdentityUserId");
b.HasIndex("TenantId");
b.ToTable("Relationship");
});
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.Property("DeviceId")
.HasColumnType("uuid");
b.Property("KeyName")
.HasColumnType("text");
b.Property("DateTime")
.HasColumnType("timestamp with time zone");
b.Property("DataSide")
.HasColumnType("integer");
b.Property("Type")
.HasColumnType("integer");
b.Property("Value_Binary")
.HasColumnType("bytea");
b.Property("Value_Boolean")
.HasColumnType("boolean");
b.Property("Value_DateTime")
.HasColumnType("timestamp with time zone");
b.Property("Value_Double")
.HasColumnType("double precision");
b.Property("Value_Json")
.HasColumnType("jsonb");
b.Property("Value_Long")
.HasColumnType("bigint");
b.Property("Value_String")
.HasColumnType("text");
b.Property("Value_XML")
.HasColumnType("xml");
b.HasKey("DeviceId", "KeyName", "DateTime");
b.HasIndex("DeviceId");
b.HasIndex("KeyName");
b.HasIndex("DeviceId", "KeyName");
b.ToTable("TelemetryData");
});
modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("Address")
.HasColumnType("text");
b.Property("City")
.HasColumnType("text");
b.Property("Country")
.HasColumnType("text");
b.Property("EMail")
.HasColumnType("text");
b.Property("Name")
.HasColumnType("text");
b.Property("Phone")
.HasColumnType("text");
b.Property("Province")
.HasColumnType("text");
b.Property("Street")
.HasColumnType("text");
b.Property("ZipCode")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Tenant");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property("Id")
.HasColumnType("text");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property("ClaimType")
.HasColumnType("text");
b.Property("ClaimValue")
.HasColumnType("text");
b.Property("RoleId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property("Id")
.HasColumnType("text");
b.Property("AccessFailedCount")
.HasColumnType("integer");
b.Property("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property