From 9dea36c9e855979799a90f753a1f9f1504356759 Mon Sep 17 00:00:00 2001 From: wq1234wq Date: Wed, 9 Feb 2022 13:03:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E8=AE=A2=E9=98=85=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=A4=9A=E4=BD=99=E7=9A=84=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20220208151552_addtelantinfo.cs | 786 ------------------ ... 20220209043947_addtelantinfo.Designer.cs} | 28 +- .../20220209043947_addtelantinfo.cs | 19 + .../ApplicationDbContextModelSnapshot.cs | 26 - IoTSharp.Data/DeviceRule.cs | 3 +- IoTSharp.Data/SubscriptionTask.cs | 6 +- 6 files changed, 22 insertions(+), 846 deletions(-) delete mode 100644 IoTSharp.Data.MySQL/Migrations/20220208151552_addtelantinfo.cs rename IoTSharp.Data.MySQL/Migrations/{20220208151552_addtelantinfo.Designer.cs => 20220209043947_addtelantinfo.Designer.cs} (98%) create mode 100644 IoTSharp.Data.MySQL/Migrations/20220209043947_addtelantinfo.cs diff --git a/IoTSharp.Data.MySQL/Migrations/20220208151552_addtelantinfo.cs b/IoTSharp.Data.MySQL/Migrations/20220208151552_addtelantinfo.cs deleted file mode 100644 index b8e4e294..00000000 --- a/IoTSharp.Data.MySQL/Migrations/20220208151552_addtelantinfo.cs +++ /dev/null @@ -1,786 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace IoTSharp.Data.MySql.Migrations -{ - public partial class addtelantinfo : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - table: "SubscriptionTasks", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "SubscriptionEvents", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "SubscriptionEvents", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "RuleTaskExecutors", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "RuleTaskExecutors", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "Flows", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Flows", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "FlowRules", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "FlowRules", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "Version", - table: "FlowRules", - type: "double", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "DynamicFormInfos", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "DynamicFormInfos", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "DynamicFormFieldValueInfos", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "DynamicFormFieldValueInfos", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "DynamicFormFieldInfos", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "DynamicFormFieldInfos", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "DeviceGraphToolBoxes", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "DeviceGraphToolBoxes", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "DeviceGraphs", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "DeviceGraphs", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "DeviceDiagrams", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "DeviceDiagrams", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "CustomerId", - table: "BaseEvents", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "BaseEvents", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.CreateIndex( - name: "IX_SubscriptionTasks_TenantId", - table: "SubscriptionTasks", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_SubscriptionEvents_CustomerId", - table: "SubscriptionEvents", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_SubscriptionEvents_TenantId", - table: "SubscriptionEvents", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_RuleTaskExecutors_CustomerId", - table: "RuleTaskExecutors", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_RuleTaskExecutors_TenantId", - table: "RuleTaskExecutors", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Flows_CustomerId", - table: "Flows", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_Flows_TenantId", - table: "Flows", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_FlowRules_CustomerId", - table: "FlowRules", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_FlowRules_TenantId", - table: "FlowRules", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_DynamicFormInfos_CustomerId", - table: "DynamicFormInfos", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_DynamicFormInfos_TenantId", - table: "DynamicFormInfos", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_DynamicFormFieldValueInfos_CustomerId", - table: "DynamicFormFieldValueInfos", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_DynamicFormFieldValueInfos_TenantId", - table: "DynamicFormFieldValueInfos", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_DynamicFormFieldInfos_CustomerId", - table: "DynamicFormFieldInfos", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_DynamicFormFieldInfos_TenantId", - table: "DynamicFormFieldInfos", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_DeviceGraphToolBoxes_CustomerId", - table: "DeviceGraphToolBoxes", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_DeviceGraphToolBoxes_TenantId", - table: "DeviceGraphToolBoxes", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_DeviceGraphs_CustomerId", - table: "DeviceGraphs", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_DeviceGraphs_TenantId", - table: "DeviceGraphs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_DeviceDiagrams_CustomerId", - table: "DeviceDiagrams", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_DeviceDiagrams_TenantId", - table: "DeviceDiagrams", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_BaseEvents_CustomerId", - table: "BaseEvents", - column: "CustomerId"); - - migrationBuilder.CreateIndex( - name: "IX_BaseEvents_TenantId", - table: "BaseEvents", - column: "TenantId"); - - migrationBuilder.AddForeignKey( - name: "FK_BaseEvents_Customer_CustomerId", - table: "BaseEvents", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_BaseEvents_Tenant_TenantId", - table: "BaseEvents", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DeviceDiagrams_Customer_CustomerId", - table: "DeviceDiagrams", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DeviceDiagrams_Tenant_TenantId", - table: "DeviceDiagrams", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DeviceGraphs_Customer_CustomerId", - table: "DeviceGraphs", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DeviceGraphs_Tenant_TenantId", - table: "DeviceGraphs", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DeviceGraphToolBoxes_Customer_CustomerId", - table: "DeviceGraphToolBoxes", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DeviceGraphToolBoxes_Tenant_TenantId", - table: "DeviceGraphToolBoxes", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DynamicFormFieldInfos_Customer_CustomerId", - table: "DynamicFormFieldInfos", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DynamicFormFieldInfos_Tenant_TenantId", - table: "DynamicFormFieldInfos", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DynamicFormFieldValueInfos_Customer_CustomerId", - table: "DynamicFormFieldValueInfos", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DynamicFormFieldValueInfos_Tenant_TenantId", - table: "DynamicFormFieldValueInfos", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DynamicFormInfos_Customer_CustomerId", - table: "DynamicFormInfos", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_DynamicFormInfos_Tenant_TenantId", - table: "DynamicFormInfos", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_FlowRules_Customer_CustomerId", - table: "FlowRules", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_FlowRules_Tenant_TenantId", - table: "FlowRules", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Flows_Customer_CustomerId", - table: "Flows", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Flows_Tenant_TenantId", - table: "Flows", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RuleTaskExecutors_Customer_CustomerId", - table: "RuleTaskExecutors", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RuleTaskExecutors_Tenant_TenantId", - table: "RuleTaskExecutors", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_SubscriptionEvents_Customer_CustomerId", - table: "SubscriptionEvents", - column: "CustomerId", - principalTable: "Customer", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_SubscriptionEvents_Tenant_TenantId", - table: "SubscriptionEvents", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_SubscriptionTasks_Tenant_TenantId", - table: "SubscriptionTasks", - column: "TenantId", - principalTable: "Tenant", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_BaseEvents_Customer_CustomerId", - table: "BaseEvents"); - - migrationBuilder.DropForeignKey( - name: "FK_BaseEvents_Tenant_TenantId", - table: "BaseEvents"); - - migrationBuilder.DropForeignKey( - name: "FK_DeviceDiagrams_Customer_CustomerId", - table: "DeviceDiagrams"); - - migrationBuilder.DropForeignKey( - name: "FK_DeviceDiagrams_Tenant_TenantId", - table: "DeviceDiagrams"); - - migrationBuilder.DropForeignKey( - name: "FK_DeviceGraphs_Customer_CustomerId", - table: "DeviceGraphs"); - - migrationBuilder.DropForeignKey( - name: "FK_DeviceGraphs_Tenant_TenantId", - table: "DeviceGraphs"); - - migrationBuilder.DropForeignKey( - name: "FK_DeviceGraphToolBoxes_Customer_CustomerId", - table: "DeviceGraphToolBoxes"); - - migrationBuilder.DropForeignKey( - name: "FK_DeviceGraphToolBoxes_Tenant_TenantId", - table: "DeviceGraphToolBoxes"); - - migrationBuilder.DropForeignKey( - name: "FK_DynamicFormFieldInfos_Customer_CustomerId", - table: "DynamicFormFieldInfos"); - - migrationBuilder.DropForeignKey( - name: "FK_DynamicFormFieldInfos_Tenant_TenantId", - table: "DynamicFormFieldInfos"); - - migrationBuilder.DropForeignKey( - name: "FK_DynamicFormFieldValueInfos_Customer_CustomerId", - table: "DynamicFormFieldValueInfos"); - - migrationBuilder.DropForeignKey( - name: "FK_DynamicFormFieldValueInfos_Tenant_TenantId", - table: "DynamicFormFieldValueInfos"); - - migrationBuilder.DropForeignKey( - name: "FK_DynamicFormInfos_Customer_CustomerId", - table: "DynamicFormInfos"); - - migrationBuilder.DropForeignKey( - name: "FK_DynamicFormInfos_Tenant_TenantId", - table: "DynamicFormInfos"); - - migrationBuilder.DropForeignKey( - name: "FK_FlowRules_Customer_CustomerId", - table: "FlowRules"); - - migrationBuilder.DropForeignKey( - name: "FK_FlowRules_Tenant_TenantId", - table: "FlowRules"); - - migrationBuilder.DropForeignKey( - name: "FK_Flows_Customer_CustomerId", - table: "Flows"); - - migrationBuilder.DropForeignKey( - name: "FK_Flows_Tenant_TenantId", - table: "Flows"); - - migrationBuilder.DropForeignKey( - name: "FK_RuleTaskExecutors_Customer_CustomerId", - table: "RuleTaskExecutors"); - - migrationBuilder.DropForeignKey( - name: "FK_RuleTaskExecutors_Tenant_TenantId", - table: "RuleTaskExecutors"); - - migrationBuilder.DropForeignKey( - name: "FK_SubscriptionEvents_Customer_CustomerId", - table: "SubscriptionEvents"); - - migrationBuilder.DropForeignKey( - name: "FK_SubscriptionEvents_Tenant_TenantId", - table: "SubscriptionEvents"); - - migrationBuilder.DropForeignKey( - name: "FK_SubscriptionTasks_Tenant_TenantId", - table: "SubscriptionTasks"); - - migrationBuilder.DropIndex( - name: "IX_SubscriptionTasks_TenantId", - table: "SubscriptionTasks"); - - migrationBuilder.DropIndex( - name: "IX_SubscriptionEvents_CustomerId", - table: "SubscriptionEvents"); - - migrationBuilder.DropIndex( - name: "IX_SubscriptionEvents_TenantId", - table: "SubscriptionEvents"); - - migrationBuilder.DropIndex( - name: "IX_RuleTaskExecutors_CustomerId", - table: "RuleTaskExecutors"); - - migrationBuilder.DropIndex( - name: "IX_RuleTaskExecutors_TenantId", - table: "RuleTaskExecutors"); - - migrationBuilder.DropIndex( - name: "IX_Flows_CustomerId", - table: "Flows"); - - migrationBuilder.DropIndex( - name: "IX_Flows_TenantId", - table: "Flows"); - - migrationBuilder.DropIndex( - name: "IX_FlowRules_CustomerId", - table: "FlowRules"); - - migrationBuilder.DropIndex( - name: "IX_FlowRules_TenantId", - table: "FlowRules"); - - migrationBuilder.DropIndex( - name: "IX_DynamicFormInfos_CustomerId", - table: "DynamicFormInfos"); - - migrationBuilder.DropIndex( - name: "IX_DynamicFormInfos_TenantId", - table: "DynamicFormInfos"); - - migrationBuilder.DropIndex( - name: "IX_DynamicFormFieldValueInfos_CustomerId", - table: "DynamicFormFieldValueInfos"); - - migrationBuilder.DropIndex( - name: "IX_DynamicFormFieldValueInfos_TenantId", - table: "DynamicFormFieldValueInfos"); - - migrationBuilder.DropIndex( - name: "IX_DynamicFormFieldInfos_CustomerId", - table: "DynamicFormFieldInfos"); - - migrationBuilder.DropIndex( - name: "IX_DynamicFormFieldInfos_TenantId", - table: "DynamicFormFieldInfos"); - - migrationBuilder.DropIndex( - name: "IX_DeviceGraphToolBoxes_CustomerId", - table: "DeviceGraphToolBoxes"); - - migrationBuilder.DropIndex( - name: "IX_DeviceGraphToolBoxes_TenantId", - table: "DeviceGraphToolBoxes"); - - migrationBuilder.DropIndex( - name: "IX_DeviceGraphs_CustomerId", - table: "DeviceGraphs"); - - migrationBuilder.DropIndex( - name: "IX_DeviceGraphs_TenantId", - table: "DeviceGraphs"); - - migrationBuilder.DropIndex( - name: "IX_DeviceDiagrams_CustomerId", - table: "DeviceDiagrams"); - - migrationBuilder.DropIndex( - name: "IX_DeviceDiagrams_TenantId", - table: "DeviceDiagrams"); - - migrationBuilder.DropIndex( - name: "IX_BaseEvents_CustomerId", - table: "BaseEvents"); - - migrationBuilder.DropIndex( - name: "IX_BaseEvents_TenantId", - table: "BaseEvents"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "SubscriptionTasks"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "SubscriptionEvents"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "SubscriptionEvents"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "RuleTaskExecutors"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "RuleTaskExecutors"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "Flows"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Flows"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "FlowRules"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "FlowRules"); - - migrationBuilder.DropColumn( - name: "Version", - table: "FlowRules"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "DynamicFormInfos"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "DynamicFormInfos"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "DynamicFormFieldValueInfos"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "DynamicFormFieldValueInfos"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "DynamicFormFieldInfos"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "DynamicFormFieldInfos"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "DeviceGraphToolBoxes"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "DeviceGraphToolBoxes"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "DeviceGraphs"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "DeviceGraphs"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "DeviceDiagrams"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "DeviceDiagrams"); - - migrationBuilder.DropColumn( - name: "CustomerId", - table: "BaseEvents"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "BaseEvents"); - } - } -} diff --git a/IoTSharp.Data.MySQL/Migrations/20220208151552_addtelantinfo.Designer.cs b/IoTSharp.Data.MySQL/Migrations/20220209043947_addtelantinfo.Designer.cs similarity index 98% rename from IoTSharp.Data.MySQL/Migrations/20220208151552_addtelantinfo.Designer.cs rename to IoTSharp.Data.MySQL/Migrations/20220209043947_addtelantinfo.Designer.cs index 78391be0..c0131ca1 100644 --- a/IoTSharp.Data.MySQL/Migrations/20220208151552_addtelantinfo.Designer.cs +++ b/IoTSharp.Data.MySQL/Migrations/20220209043947_addtelantinfo.Designer.cs @@ -11,7 +11,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace IoTSharp.Data.MySql.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20220208151552_addtelantinfo")] + [Migration("20220209043947_addtelantinfo")] partial class addtelantinfo { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -1455,9 +1455,6 @@ namespace IoTSharp.Data.MySql.Migrations .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("CustomerId") - .HasColumnType("char(36)"); - b.Property("EventId") .HasColumnType("char(36)"); @@ -1473,19 +1470,12 @@ namespace IoTSharp.Data.MySql.Migrations b.Property("TaskConfig") .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("char(36)"); - b.HasKey("BindId"); - b.HasIndex("CustomerId"); - b.HasIndex("RuleTaskExecutorExecutorId"); b.HasIndex("SubscriptionEventId"); - b.HasIndex("TenantId"); - b.ToTable("SubscriptionTasks"); }); @@ -2187,12 +2177,6 @@ namespace IoTSharp.Data.MySql.Migrations modelBuilder.Entity("IoTSharp.Data.SubscriptionTask", b => { - b.HasOne("IoTSharp.Data.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - b.HasOne("IoTSharp.Data.RuleTaskExecutor", "RuleTaskExecutor") .WithMany() .HasForeignKey("RuleTaskExecutorExecutorId"); @@ -2201,19 +2185,9 @@ namespace IoTSharp.Data.MySql.Migrations .WithMany() .HasForeignKey("SubscriptionEventId"); - b.HasOne("IoTSharp.Data.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - b.Navigation("RuleTaskExecutor"); b.Navigation("Subscription"); - - b.Navigation("Tenant"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => diff --git a/IoTSharp.Data.MySQL/Migrations/20220209043947_addtelantinfo.cs b/IoTSharp.Data.MySQL/Migrations/20220209043947_addtelantinfo.cs new file mode 100644 index 00000000..bfe8d025 --- /dev/null +++ b/IoTSharp.Data.MySQL/Migrations/20220209043947_addtelantinfo.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace IoTSharp.Data.MySql.Migrations +{ + public partial class addtelantinfo : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/IoTSharp.Data.MySQL/Migrations/ApplicationDbContextModelSnapshot.cs b/IoTSharp.Data.MySQL/Migrations/ApplicationDbContextModelSnapshot.cs index 6c16dabd..2d5e42e8 100644 --- a/IoTSharp.Data.MySQL/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/IoTSharp.Data.MySQL/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1453,9 +1453,6 @@ namespace IoTSharp.Data.MySql.Migrations .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("CustomerId") - .HasColumnType("char(36)"); - b.Property("EventId") .HasColumnType("char(36)"); @@ -1471,19 +1468,12 @@ namespace IoTSharp.Data.MySql.Migrations b.Property("TaskConfig") .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("char(36)"); - b.HasKey("BindId"); - b.HasIndex("CustomerId"); - b.HasIndex("RuleTaskExecutorExecutorId"); b.HasIndex("SubscriptionEventId"); - b.HasIndex("TenantId"); - b.ToTable("SubscriptionTasks"); }); @@ -2185,12 +2175,6 @@ namespace IoTSharp.Data.MySql.Migrations modelBuilder.Entity("IoTSharp.Data.SubscriptionTask", b => { - b.HasOne("IoTSharp.Data.Customer", "Customer") - .WithMany() - .HasForeignKey("CustomerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - b.HasOne("IoTSharp.Data.RuleTaskExecutor", "RuleTaskExecutor") .WithMany() .HasForeignKey("RuleTaskExecutorExecutorId"); @@ -2199,19 +2183,9 @@ namespace IoTSharp.Data.MySql.Migrations .WithMany() .HasForeignKey("SubscriptionEventId"); - b.HasOne("IoTSharp.Data.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Customer"); - b.Navigation("RuleTaskExecutor"); b.Navigation("Subscription"); - - b.Navigation("Tenant"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => diff --git a/IoTSharp.Data/DeviceRule.cs b/IoTSharp.Data/DeviceRule.cs index f81264a4..133341dd 100644 --- a/IoTSharp.Data/DeviceRule.cs +++ b/IoTSharp.Data/DeviceRule.cs @@ -24,7 +24,6 @@ namespace IoTSharp.Data public int EnableTrace { get; set; } //是否开启设备在规则链当中的链路跟踪 - public Guid DeviceId { get; set; } - public Guid FlowRuleId { get; set; } + } } diff --git a/IoTSharp.Data/SubscriptionTask.cs b/IoTSharp.Data/SubscriptionTask.cs index 2b129956..b3a6c0a9 100644 --- a/IoTSharp.Data/SubscriptionTask.cs +++ b/IoTSharp.Data/SubscriptionTask.cs @@ -20,10 +20,6 @@ namespace IoTSharp.Data public string TaskConfig { get; set; } - public Tenant Tenant { get; set; } - public Guid TenantId { get; set; } - - public Guid CustomerId { get; set; } - public Customer Customer { get; set; } + } } -- GitLab