20220212100327_FixTenantInfo.Designer.cs 76.0 KB
Newer Older
W
wq1234wq 已提交
1 2 3 4 5 6 7
// <auto-generated />
using System;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
8
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
W
wq1234wq 已提交
9 10 11

#nullable disable

12
namespace IoTSharp.Migrations
W
wq1234wq 已提交
13 14
{
    [DbContext(typeof(ApplicationDbContext))]
15 16
    [Migration("20220212100327_FixTenantInfo")]
    partial class FixTenantInfo
W
wq1234wq 已提交
17 18 19 20 21
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
22
                .HasAnnotation("ProductVersion", "6.0.2")
23 24 25
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
W
wq1234wq 已提交
26 27 28 29 30

            modelBuilder.Entity("IoTSharp.Data.AuditLog", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
31
                        .HasColumnType("uuid");
W
wq1234wq 已提交
32 33

                    b.Property<string>("ActionData")
34
                        .HasColumnType("jsonb");
W
wq1234wq 已提交
35 36

                    b.Property<string>("ActionName")
37
                        .HasColumnType("text");
W
wq1234wq 已提交
38 39

                    b.Property<string>("ActionResult")
40
                        .HasColumnType("jsonb");
W
wq1234wq 已提交
41 42

                    b.Property<DateTime>("ActiveDateTime")
43
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
44 45

                    b.Property<Guid?>("CustomerId")
46
                        .HasColumnType("uuid");
W
wq1234wq 已提交
47 48

                    b.Property<Guid>("ObjectID")
49
                        .HasColumnType("uuid");
W
wq1234wq 已提交
50 51

                    b.Property<string>("ObjectName")
52
                        .HasColumnType("text");
W
wq1234wq 已提交
53 54

                    b.Property<int>("ObjectType")
55
                        .HasColumnType("integer");
W
wq1234wq 已提交
56 57

                    b.Property<Guid?>("TenantId")
58
                        .HasColumnType("uuid");
W
wq1234wq 已提交
59 60

                    b.Property<string>("UserId")
61
                        .HasColumnType("text");
W
wq1234wq 已提交
62 63

                    b.Property<string>("UserName")
64
                        .HasColumnType("text");
W
wq1234wq 已提交
65 66 67 68 69 70 71 72 73 74 75 76 77 78

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("AuditLog");
                });

            modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
79
                        .HasColumnType("uuid");
W
wq1234wq 已提交
80 81

                    b.Property<string>("AuthToken")
82
                        .HasColumnType("text");
W
wq1234wq 已提交
83 84

                    b.Property<Guid?>("CustomerId")
85
                        .HasColumnType("uuid");
W
wq1234wq 已提交
86 87

                    b.Property<string>("Name")
88
                        .HasColumnType("text");
W
wq1234wq 已提交
89 90

                    b.Property<Guid?>("TenantId")
91
                        .HasColumnType("uuid");
W
wq1234wq 已提交
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("AuthorizedKeys");
                });

            modelBuilder.Entity("IoTSharp.Data.BaseDictionary", b =>
                {
                    b.Property<long>("DictionaryId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

108 109
                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("DictionaryId"));

W
wq1234wq 已提交
110
                    b.Property<string>("Dictionary18NKeyName")
111
                        .HasColumnType("text");
W
wq1234wq 已提交
112 113

                    b.Property<string>("DictionaryColor")
114
                        .HasColumnType("text");
W
wq1234wq 已提交
115 116

                    b.Property<string>("DictionaryDesc")
117
                        .HasColumnType("text");
W
wq1234wq 已提交
118 119 120 121 122

                    b.Property<long?>("DictionaryGroupId")
                        .HasColumnType("bigint");

                    b.Property<string>("DictionaryIcon")
123
                        .HasColumnType("text");
W
wq1234wq 已提交
124 125

                    b.Property<string>("DictionaryName")
126
                        .HasColumnType("text");
W
wq1234wq 已提交
127 128

                    b.Property<string>("DictionaryPattern")
129
                        .HasColumnType("text");
W
wq1234wq 已提交
130 131

                    b.Property<int?>("DictionaryStatus")
132
                        .HasColumnType("integer");
W
wq1234wq 已提交
133 134

                    b.Property<string>("DictionaryTag")
135
                        .HasColumnType("text");
W
wq1234wq 已提交
136 137

                    b.Property<string>("DictionaryValue")
138
                        .HasColumnType("text");
W
wq1234wq 已提交
139 140

                    b.Property<int?>("DictionaryValueType")
141
                        .HasColumnType("integer");
W
wq1234wq 已提交
142 143

                    b.Property<string>("DictionaryValueTypeName")
144
                        .HasColumnType("text");
W
wq1234wq 已提交
145 146 147 148 149 150 151 152 153 154 155 156

                    b.HasKey("DictionaryId");

                    b.ToTable("BaseDictionaries");
                });

            modelBuilder.Entity("IoTSharp.Data.BaseDictionaryGroup", b =>
                {
                    b.Property<long>("DictionaryGroupId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

157 158
                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("DictionaryGroupId"));

W
wq1234wq 已提交
159
                    b.Property<string>("DictionaryGroup18NKeyName")
160
                        .HasColumnType("text");
W
wq1234wq 已提交
161 162

                    b.Property<string>("DictionaryGroupDesc")
163
                        .HasColumnType("text");
W
wq1234wq 已提交
164 165

                    b.Property<string>("DictionaryGroupKey")
166
                        .HasColumnType("text");
W
wq1234wq 已提交
167 168

                    b.Property<string>("DictionaryGroupName")
169
                        .HasColumnType("text");
W
wq1234wq 已提交
170 171

                    b.Property<int?>("DictionaryGroupStatus")
172
                        .HasColumnType("integer");
W
wq1234wq 已提交
173 174

                    b.Property<int?>("DictionaryGroupValueType")
175
                        .HasColumnType("integer");
W
wq1234wq 已提交
176 177

                    b.Property<string>("DictionaryGroupValueTypeName")
178
                        .HasColumnType("text");
W
wq1234wq 已提交
179 180 181 182 183 184 185 186 187 188

                    b.HasKey("DictionaryGroupId");

                    b.ToTable("BaseDictionaryGroups");
                });

            modelBuilder.Entity("IoTSharp.Data.BaseEvent", b =>
                {
                    b.Property<Guid>("EventId")
                        .ValueGeneratedOnAdd()
189
                        .HasColumnType("uuid");
W
wq1234wq 已提交
190 191

                    b.Property<string>("BizData")
192
                        .HasColumnType("text");
W
wq1234wq 已提交
193 194

                    b.Property<string>("Bizid")
195
                        .HasColumnType("text");
W
wq1234wq 已提交
196 197

                    b.Property<DateTime>("CreaterDateTime")
198
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
199 200

                    b.Property<Guid>("Creator")
201
                        .HasColumnType("uuid");
W
wq1234wq 已提交
202

麦壳饼's avatar
麦壳饼 已提交
203
                    b.Property<Guid?>("CustomerId")
204
                        .HasColumnType("uuid");
W
wq1234wq 已提交
205 206

                    b.Property<string>("EventDesc")
207
                        .HasColumnType("text");
W
wq1234wq 已提交
208 209

                    b.Property<string>("EventName")
210
                        .HasColumnType("text");
W
wq1234wq 已提交
211 212

                    b.Property<int>("EventStaus")
213
                        .HasColumnType("integer");
W
wq1234wq 已提交
214 215

                    b.Property<Guid?>("FlowRuleRuleId")
216
                        .HasColumnType("uuid");
W
wq1234wq 已提交
217 218

                    b.Property<string>("MataData")
219
                        .HasColumnType("text");
W
wq1234wq 已提交
220

麦壳饼's avatar
麦壳饼 已提交
221
                    b.Property<Guid?>("TenantId")
222
                        .HasColumnType("uuid");
W
wq1234wq 已提交
223 224

                    b.Property<int>("Type")
225
                        .HasColumnType("integer");
W
wq1234wq 已提交
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243

                    b.HasKey("EventId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("FlowRuleRuleId");

                    b.HasIndex("TenantId");

                    b.ToTable("BaseEvents");
                });

            modelBuilder.Entity("IoTSharp.Data.BaseI18N", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

244 245
                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

W
wq1234wq 已提交
246
                    b.Property<DateTime?>("AddDate")
247
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
248 249

                    b.Property<string>("KeyName")
250
                        .HasColumnType("text");
W
wq1234wq 已提交
251 252

                    b.Property<string>("ResouceDesc")
253
                        .HasColumnType("text");
W
wq1234wq 已提交
254 255

                    b.Property<int?>("ResouceGroupId")
256
                        .HasColumnType("integer");
W
wq1234wq 已提交
257 258 259 260 261

                    b.Property<long?>("ResourceId")
                        .HasColumnType("bigint");

                    b.Property<string>("ResourceKey")
262
                        .HasColumnType("text");
W
wq1234wq 已提交
263 264

                    b.Property<string>("ResourceTag")
265
                        .HasColumnType("text");
W
wq1234wq 已提交
266 267

                    b.Property<int?>("ResourceType")
268
                        .HasColumnType("integer");
W
wq1234wq 已提交
269 270

                    b.Property<int>("Status")
271
                        .HasColumnType("integer");
W
wq1234wq 已提交
272 273

                    b.Property<Guid>("UserId")
274
                        .HasColumnType("uuid");
W
wq1234wq 已提交
275 276

                    b.Property<string>("ValueBG")
277
                        .HasColumnType("text");
W
wq1234wq 已提交
278 279

                    b.Property<string>("ValueCS")
280
                        .HasColumnType("text");
W
wq1234wq 已提交
281 282

                    b.Property<string>("ValueDA")
283
                        .HasColumnType("text");
W
wq1234wq 已提交
284 285

                    b.Property<string>("ValueDEDE")
286
                        .HasColumnType("text");
W
wq1234wq 已提交
287 288

                    b.Property<string>("ValueELGR")
289
                        .HasColumnType("text");
W
wq1234wq 已提交
290 291

                    b.Property<string>("ValueENGR")
292
                        .HasColumnType("text");
W
wq1234wq 已提交
293 294

                    b.Property<string>("ValueENUS")
295
                        .HasColumnType("text");
W
wq1234wq 已提交
296 297

                    b.Property<string>("ValueESES")
298
                        .HasColumnType("text");
W
wq1234wq 已提交
299 300

                    b.Property<string>("ValueFI")
301
                        .HasColumnType("text");
W
wq1234wq 已提交
302 303

                    b.Property<string>("ValueFRFR")
304
                        .HasColumnType("text");
W
wq1234wq 已提交
305 306

                    b.Property<string>("ValueHE")
307
                        .HasColumnType("text");
W
wq1234wq 已提交
308 309

                    b.Property<string>("ValueHRHR")
310
                        .HasColumnType("text");
W
wq1234wq 已提交
311 312

                    b.Property<string>("ValueHU")
313
                        .HasColumnType("text");
W
wq1234wq 已提交
314 315

                    b.Property<string>("ValueITIT")
316
                        .HasColumnType("text");
W
wq1234wq 已提交
317 318

                    b.Property<string>("ValueJAJP")
319
                        .HasColumnType("text");
W
wq1234wq 已提交
320 321

                    b.Property<string>("ValueKOKR")
322
                        .HasColumnType("text");
W
wq1234wq 已提交
323 324

                    b.Property<string>("ValueNL")
325
                        .HasColumnType("text");
W
wq1234wq 已提交
326 327

                    b.Property<string>("ValuePLPL")
328
                        .HasColumnType("text");
W
wq1234wq 已提交
329 330

                    b.Property<string>("ValuePT")
331
                        .HasColumnType("text");
W
wq1234wq 已提交
332 333

                    b.Property<string>("ValueSLSL")
334
                        .HasColumnType("text");
W
wq1234wq 已提交
335 336

                    b.Property<string>("ValueSR")
337
                        .HasColumnType("text");
W
wq1234wq 已提交
338 339

                    b.Property<string>("ValueSV")
340
                        .HasColumnType("text");
W
wq1234wq 已提交
341 342

                    b.Property<string>("ValueTRTR")
343
                        .HasColumnType("text");
W
wq1234wq 已提交
344 345

                    b.Property<string>("ValueUK")
346
                        .HasColumnType("text");
W
wq1234wq 已提交
347 348

                    b.Property<string>("ValueVI")
349
                        .HasColumnType("text");
W
wq1234wq 已提交
350 351

                    b.Property<string>("ValueZHCN")
352
                        .HasColumnType("text");
W
wq1234wq 已提交
353 354

                    b.Property<string>("ValueZHTW")
355
                        .HasColumnType("text");
W
wq1234wq 已提交
356 357 358 359 360 361 362 363 364 365

                    b.HasKey("Id");

                    b.ToTable("BaseI18Ns");
                });

            modelBuilder.Entity("IoTSharp.Data.Customer", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
366
                        .HasColumnType("uuid");
W
wq1234wq 已提交
367 368

                    b.Property<string>("Address")
369
                        .HasColumnType("text");
W
wq1234wq 已提交
370 371

                    b.Property<string>("City")
372
                        .HasColumnType("text");
W
wq1234wq 已提交
373 374

                    b.Property<string>("Country")
375
                        .HasColumnType("text");
W
wq1234wq 已提交
376 377

                    b.Property<string>("Email")
378
                        .HasColumnType("text");
W
wq1234wq 已提交
379 380

                    b.Property<string>("Name")
381
                        .HasColumnType("text");
W
wq1234wq 已提交
382 383

                    b.Property<string>("Phone")
384
                        .HasColumnType("text");
W
wq1234wq 已提交
385 386

                    b.Property<string>("Province")
387
                        .HasColumnType("text");
W
wq1234wq 已提交
388 389

                    b.Property<string>("Street")
390
                        .HasColumnType("text");
W
wq1234wq 已提交
391 392

                    b.Property<Guid?>("TenantId")
393
                        .HasColumnType("uuid");
W
wq1234wq 已提交
394 395

                    b.Property<int>("ZipCode")
396
                        .HasColumnType("integer");
W
wq1234wq 已提交
397 398 399 400 401 402 403 404 405 406 407

                    b.HasKey("Id");

                    b.HasIndex("TenantId");

                    b.ToTable("Customer");
                });

            modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
                {
                    b.Property<int>("Catalog")
408
                        .HasColumnType("integer")
W
wq1234wq 已提交
409 410 411
                        .HasColumnOrder(0);

                    b.Property<Guid>("DeviceId")
412
                        .HasColumnType("uuid")
W
wq1234wq 已提交
413 414 415
                        .HasColumnOrder(1);

                    b.Property<string>("KeyName")
416
                        .HasColumnType("text")
W
wq1234wq 已提交
417 418 419
                        .HasColumnOrder(2);

                    b.Property<int>("DataSide")
420
                        .HasColumnType("integer")
W
wq1234wq 已提交
421 422 423
                        .HasColumnOrder(4);

                    b.Property<DateTime>("DateTime")
424
                        .HasColumnType("timestamp with time zone")
W
wq1234wq 已提交
425 426 427
                        .HasColumnOrder(3);

                    b.Property<int>("Type")
428
                        .HasColumnType("integer")
W
wq1234wq 已提交
429 430 431
                        .HasColumnOrder(5);

                    b.Property<byte[]>("Value_Binary")
432
                        .HasColumnType("bytea");
W
wq1234wq 已提交
433 434

                    b.Property<bool?>("Value_Boolean")
435
                        .HasColumnType("boolean");
W
wq1234wq 已提交
436 437

                    b.Property<DateTime?>("Value_DateTime")
438
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
439 440

                    b.Property<double?>("Value_Double")
441
                        .HasColumnType("double precision");
W
wq1234wq 已提交
442 443

                    b.Property<string>("Value_Json")
444
                        .HasColumnType("jsonb");
W
wq1234wq 已提交
445 446 447 448 449

                    b.Property<long?>("Value_Long")
                        .HasColumnType("bigint");

                    b.Property<string>("Value_String")
450
                        .HasColumnType("text");
W
wq1234wq 已提交
451 452

                    b.Property<string>("Value_XML")
453
                        .HasColumnType("xml");
W
wq1234wq 已提交
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469

                    b.HasKey("Catalog", "DeviceId", "KeyName");

                    b.HasIndex("Catalog");

                    b.HasIndex("Catalog", "DeviceId");

                    b.ToTable("DataStorage");

                    b.HasDiscriminator<int>("Catalog").HasValue(0);
                });

            modelBuilder.Entity("IoTSharp.Data.Device", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
470
                        .HasColumnType("uuid");
W
wq1234wq 已提交
471 472

                    b.Property<Guid?>("AuthorizedKeyId")
473
                        .HasColumnType("uuid");
W
wq1234wq 已提交
474 475

                    b.Property<Guid?>("CustomerId")
476
                        .HasColumnType("uuid");
W
wq1234wq 已提交
477 478

                    b.Property<Guid?>("DeviceModelId")
479
                        .HasColumnType("uuid");
W
wq1234wq 已提交
480 481

                    b.Property<int>("DeviceType")
482
                        .HasColumnType("integer");
W
wq1234wq 已提交
483 484

                    b.Property<DateTime>("LastActive")
485
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
486 487

                    b.Property<string>("Name")
488
                        .HasColumnType("text");
W
wq1234wq 已提交
489 490

                    b.Property<bool>("Online")
491
                        .HasColumnType("boolean");
W
wq1234wq 已提交
492 493

                    b.Property<Guid?>("OwnerId")
494
                        .HasColumnType("uuid");
W
wq1234wq 已提交
495 496

                    b.Property<int>("Status")
497
                        .HasColumnType("integer");
W
wq1234wq 已提交
498 499

                    b.Property<Guid?>("TenantId")
500
                        .HasColumnType("uuid");
W
wq1234wq 已提交
501 502

                    b.Property<int>("Timeout")
503
                        .HasColumnType("integer");
W
wq1234wq 已提交
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525

                    b.HasKey("Id");

                    b.HasIndex("AuthorizedKeyId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("DeviceModelId");

                    b.HasIndex("OwnerId");

                    b.HasIndex("TenantId");

                    b.ToTable("Device");

                    b.HasDiscriminator<int>("DeviceType").HasValue(0);
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceDiagram", b =>
                {
                    b.Property<Guid>("DiagramId")
                        .ValueGeneratedOnAdd()
526
                        .HasColumnType("uuid");
W
wq1234wq 已提交
527 528

                    b.Property<DateTimeOffset?>("CreateDate")
529
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
530 531

                    b.Property<Guid>("Creator")
532
                        .HasColumnType("uuid");
W
wq1234wq 已提交
533

534 535
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
536 537

                    b.Property<string>("DiagramDesc")
538
                        .HasColumnType("text");
W
wq1234wq 已提交
539 540

                    b.Property<string>("DiagramImage")
541
                        .HasColumnType("text");
W
wq1234wq 已提交
542 543

                    b.Property<string>("DiagramName")
544
                        .HasColumnType("text");
W
wq1234wq 已提交
545

546 547
                    b.Property<int>("DiagramStatus")
                        .HasColumnType("integer");
W
wq1234wq 已提交
548

549 550
                    b.Property<bool>("IsDefault")
                        .HasColumnType("boolean");
W
wq1234wq 已提交
551

552 553
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
554 555 556 557 558 559 560 561 562 563 564 565 566 567

                    b.HasKey("DiagramId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("DeviceDiagrams");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceGraph", b =>
                {
                    b.Property<Guid>("GraphId")
                        .ValueGeneratedOnAdd()
568
                        .HasColumnType("uuid");
W
wq1234wq 已提交
569 570

                    b.Property<DateTime?>("CreateDate")
571
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
572 573

                    b.Property<Guid>("Creator")
574
                        .HasColumnType("uuid");
W
wq1234wq 已提交
575

576 577
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
578 579

                    b.Property<Guid?>("DeviceDiagramDiagramId")
580
                        .HasColumnType("uuid");
W
wq1234wq 已提交
581 582

                    b.Property<Guid>("DeviceId")
583
                        .HasColumnType("uuid");
W
wq1234wq 已提交
584 585

                    b.Property<string>("GraphElementId")
586
                        .HasColumnType("text");
W
wq1234wq 已提交
587 588

                    b.Property<string>("GraphFill")
589
                        .HasColumnType("text");
W
wq1234wq 已提交
590

591 592
                    b.Property<int>("GraphHeight")
                        .HasColumnType("integer");
W
wq1234wq 已提交
593

594 595
                    b.Property<int>("GraphPostionX")
                        .HasColumnType("integer");
W
wq1234wq 已提交
596

597 598
                    b.Property<int>("GraphPostionY")
                        .HasColumnType("integer");
W
wq1234wq 已提交
599 600

                    b.Property<string>("GraphShape")
601
                        .HasColumnType("text");
W
wq1234wq 已提交
602 603

                    b.Property<string>("GraphStroke")
604
                        .HasColumnType("text");
W
wq1234wq 已提交
605

606 607
                    b.Property<int>("GraphStrokeWidth")
                        .HasColumnType("integer");
W
wq1234wq 已提交
608 609

                    b.Property<string>("GraphTextAnchor")
610
                        .HasColumnType("text");
W
wq1234wq 已提交
611 612

                    b.Property<string>("GraphTextFill")
613
                        .HasColumnType("text");
W
wq1234wq 已提交
614 615

                    b.Property<string>("GraphTextFontFamily")
616
                        .HasColumnType("text");
W
wq1234wq 已提交
617

618 619
                    b.Property<int>("GraphTextFontSize")
                        .HasColumnType("integer");
W
wq1234wq 已提交
620

621 622
                    b.Property<int>("GraphTextRefX")
                        .HasColumnType("integer");
W
wq1234wq 已提交
623

624 625
                    b.Property<int>("GraphTextRefY")
                        .HasColumnType("integer");
W
wq1234wq 已提交
626 627

                    b.Property<string>("GraphTextVerticalAnchor")
628
                        .HasColumnType("text");
W
wq1234wq 已提交
629

630 631
                    b.Property<int>("GraphWidth")
                        .HasColumnType("integer");
W
wq1234wq 已提交
632

633 634
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650

                    b.HasKey("GraphId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("DeviceDiagramDiagramId");

                    b.HasIndex("TenantId");

                    b.ToTable("DeviceGraphs");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceGraphToolBox", b =>
                {
                    b.Property<Guid>("ToolBoxId")
                        .ValueGeneratedOnAdd()
651
                        .HasColumnType("uuid");
W
wq1234wq 已提交
652 653

                    b.Property<string>("CommondParam")
654
                        .HasColumnType("text");
W
wq1234wq 已提交
655 656

                    b.Property<string>("CommondType")
657
                        .HasColumnType("text");
W
wq1234wq 已提交
658 659

                    b.Property<DateTime?>("CreateDate")
660
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
661 662

                    b.Property<Guid>("Creator")
663
                        .HasColumnType("uuid");
W
wq1234wq 已提交
664

665 666
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
667

668
                    b.Property<long>("DeviceId")
W
wq1234wq 已提交
669 670
                        .HasColumnType("bigint");

671 672
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
673 674

                    b.Property<string>("ToolBoxIcon")
675
                        .HasColumnType("text");
W
wq1234wq 已提交
676 677

                    b.Property<string>("ToolBoxName")
678
                        .HasColumnType("text");
W
wq1234wq 已提交
679

680 681
                    b.Property<int>("ToolBoxOffsetLeftPer")
                        .HasColumnType("integer");
W
wq1234wq 已提交
682

683 684
                    b.Property<int>("ToolBoxOffsetTopPer")
                        .HasColumnType("integer");
W
wq1234wq 已提交
685

686 687
                    b.Property<int>("ToolBoxOffsetX")
                        .HasColumnType("integer");
W
wq1234wq 已提交
688

689 690
                    b.Property<int>("ToolBoxOffsetY")
                        .HasColumnType("integer");
W
wq1234wq 已提交
691 692

                    b.Property<string>("ToolBoxRequestUri")
693
                        .HasColumnType("text");
W
wq1234wq 已提交
694

695 696
                    b.Property<int>("ToolBoxStatus")
                        .HasColumnType("integer");
W
wq1234wq 已提交
697 698

                    b.Property<string>("ToolBoxType")
699
                        .HasColumnType("text");
W
wq1234wq 已提交
700 701 702 703 704 705 706 707 708 709 710 711 712 713

                    b.HasKey("ToolBoxId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("DeviceGraphToolBoxes");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
714
                        .HasColumnType("uuid");
W
wq1234wq 已提交
715 716

                    b.Property<Guid>("DeviceId")
717
                        .HasColumnType("uuid");
W
wq1234wq 已提交
718 719 720

                    b.Property<string>("IdentityId")
                        .IsRequired()
721
                        .HasColumnType("text");
W
wq1234wq 已提交
722 723

                    b.Property<int>("IdentityType")
724
                        .HasColumnType("integer");
W
wq1234wq 已提交
725 726

                    b.Property<string>("IdentityValue")
727
                        .HasColumnType("text");
W
wq1234wq 已提交
728 729 730 731 732 733 734 735 736 737 738 739 740

                    b.HasKey("Id");

                    b.HasIndex("DeviceId")
                        .IsUnique();

                    b.ToTable("DeviceIdentities");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceModel", b =>
                {
                    b.Property<Guid>("DeviceModelId")
                        .ValueGeneratedOnAdd()
741
                        .HasColumnType("uuid");
W
wq1234wq 已提交
742 743

                    b.Property<DateTime>("CreateDateTime")
744
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
745 746

                    b.Property<Guid>("Creator")
747
                        .HasColumnType("uuid");
W
wq1234wq 已提交
748 749

                    b.Property<string>("ModelDesc")
750
                        .HasColumnType("text");
W
wq1234wq 已提交
751 752

                    b.Property<string>("ModelName")
753
                        .HasColumnType("text");
W
wq1234wq 已提交
754 755

                    b.Property<int>("ModelStatus")
756
                        .HasColumnType("integer");
W
wq1234wq 已提交
757 758 759 760 761 762 763 764 765 766

                    b.HasKey("DeviceModelId");

                    b.ToTable("DeviceModels");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceModelCommand", b =>
                {
                    b.Property<Guid>("CommandId")
                        .ValueGeneratedOnAdd()
767
                        .HasColumnType("uuid");
W
wq1234wq 已提交
768 769

                    b.Property<string>("CommandI18N")
770
                        .HasColumnType("text");
W
wq1234wq 已提交
771 772

                    b.Property<string>("CommandName")
773
                        .HasColumnType("text");
W
wq1234wq 已提交
774 775

                    b.Property<string>("CommandParams")
776
                        .HasColumnType("text");
W
wq1234wq 已提交
777 778

                    b.Property<int>("CommandStatus")
779
                        .HasColumnType("integer");
W
wq1234wq 已提交
780 781

                    b.Property<string>("CommandTemplate")
782
                        .HasColumnType("text");
W
wq1234wq 已提交
783 784

                    b.Property<string>("CommandTitle")
785
                        .HasColumnType("text");
W
wq1234wq 已提交
786 787

                    b.Property<int>("CommandType")
788
                        .HasColumnType("integer");
W
wq1234wq 已提交
789 790

                    b.Property<DateTime>("CreateDateTime")
791
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
792 793

                    b.Property<Guid>("Creator")
794
                        .HasColumnType("uuid");
W
wq1234wq 已提交
795 796

                    b.Property<Guid>("DeviceModelId")
797
                        .HasColumnType("uuid");
W
wq1234wq 已提交
798 799 800 801 802 803 804 805 806 807 808 809

                    b.HasKey("CommandId");

                    b.HasIndex("DeviceModelId");

                    b.ToTable("DeviceModelCommands");
                });

            modelBuilder.Entity("IoTSharp.Data.DevicePort", b =>
                {
                    b.Property<Guid>("PortId")
                        .ValueGeneratedOnAdd()
810
                        .HasColumnType("uuid");
W
wq1234wq 已提交
811 812

                    b.Property<DateTime?>("CreateDate")
813
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
814

815
                    b.Property<long>("Creator")
W
wq1234wq 已提交
816 817 818
                        .HasColumnType("bigint");

                    b.Property<Guid>("DeviceId")
819
                        .HasColumnType("uuid");
W
wq1234wq 已提交
820 821

                    b.Property<string>("PortDesc")
822
                        .HasColumnType("text");
W
wq1234wq 已提交
823 824

                    b.Property<string>("PortElementId")
825
                        .HasColumnType("text");
W
wq1234wq 已提交
826 827

                    b.Property<string>("PortName")
828
                        .HasColumnType("text");
W
wq1234wq 已提交
829

830 831
                    b.Property<int>("PortPhyType")
                        .HasColumnType("integer");
W
wq1234wq 已提交
832 833

                    b.Property<string>("PortPic")
834
                        .HasColumnType("text");
W
wq1234wq 已提交
835

836 837
                    b.Property<int>("PortStatus")
                        .HasColumnType("integer");
W
wq1234wq 已提交
838

839 840
                    b.Property<int>("PortType")
                        .HasColumnType("integer");
W
wq1234wq 已提交
841 842 843 844 845 846 847 848 849 850

                    b.HasKey("PortId");

                    b.ToTable("DevicePorts");
                });

            modelBuilder.Entity("IoTSharp.Data.DevicePortMapping", b =>
                {
                    b.Property<Guid>("MappingId")
                        .ValueGeneratedOnAdd()
851
                        .HasColumnType("uuid");
W
wq1234wq 已提交
852 853

                    b.Property<DateTime?>("CreateDate")
854
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
855 856

                    b.Property<Guid>("Creator")
857
                        .HasColumnType("uuid");
W
wq1234wq 已提交
858

859 860
                    b.Property<int>("MappingIndex")
                        .HasColumnType("integer");
W
wq1234wq 已提交
861

862 863
                    b.Property<int>("MappingStatus")
                        .HasColumnType("integer");
W
wq1234wq 已提交
864 865

                    b.Property<Guid>("SourceDeviceId")
866
                        .HasColumnType("uuid");
W
wq1234wq 已提交
867 868

                    b.Property<string>("SourceElementId")
869
                        .HasColumnType("text");
W
wq1234wq 已提交
870 871

                    b.Property<string>("SourceId")
872
                        .HasColumnType("text");
W
wq1234wq 已提交
873 874

                    b.Property<string>("TargeId")
875
                        .HasColumnType("text");
W
wq1234wq 已提交
876 877

                    b.Property<Guid>("TargetDeviceId")
878
                        .HasColumnType("uuid");
W
wq1234wq 已提交
879 880

                    b.Property<string>("TargetElementId")
881
                        .HasColumnType("text");
W
wq1234wq 已提交
882 883 884 885 886 887 888 889 890 891

                    b.HasKey("MappingId");

                    b.ToTable("DevicePortMappings");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceRule", b =>
                {
                    b.Property<Guid>("DeviceRuleId")
                        .ValueGeneratedOnAdd()
892
                        .HasColumnType("uuid");
W
wq1234wq 已提交
893 894

                    b.Property<DateTime>("ConfigDateTime")
895
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
896 897

                    b.Property<Guid>("ConfigUser")
898
                        .HasColumnType("uuid");
W
wq1234wq 已提交
899 900

                    b.Property<Guid?>("DeviceId")
901
                        .HasColumnType("uuid");
W
wq1234wq 已提交
902 903

                    b.Property<int>("EnableTrace")
904
                        .HasColumnType("integer");
W
wq1234wq 已提交
905 906

                    b.Property<Guid?>("FlowRuleRuleId")
907
                        .HasColumnType("uuid");
W
wq1234wq 已提交
908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923

                    b.HasKey("DeviceRuleId");

                    b.HasIndex("DeviceId");

                    b.HasIndex("FlowRuleRuleId");

                    b.ToTable("DeviceRules");
                });

            modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldInfo", b =>
                {
                    b.Property<long>("FieldId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

924 925
                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("FieldId"));

W
wq1234wq 已提交
926
                    b.Property<Guid>("Creator")
927
                        .HasColumnType("uuid");
W
wq1234wq 已提交
928

929 930
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
931 932

                    b.Property<string>("FieldCode")
933
                        .HasColumnType("text");
W
wq1234wq 已提交
934 935

                    b.Property<DateTime?>("FieldCreateDate")
936
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
937 938

                    b.Property<DateTime?>("FieldEditDate")
939
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
940 941

                    b.Property<string>("FieldI18nKey")
942
                        .HasColumnType("text");
W
wq1234wq 已提交
943

944 945
                    b.Property<int>("FieldMaxLength")
                        .HasColumnType("integer");
W
wq1234wq 已提交
946 947

                    b.Property<string>("FieldName")
948
                        .HasColumnType("text");
W
wq1234wq 已提交
949 950

                    b.Property<string>("FieldPattern")
951
                        .HasColumnType("text");
W
wq1234wq 已提交
952 953

                    b.Property<string>("FieldPocoTypeName")
954
                        .HasColumnType("text");
W
wq1234wq 已提交
955

956 957
                    b.Property<int>("FieldStatus")
                        .HasColumnType("integer");
W
wq1234wq 已提交
958

959
                    b.Property<long>("FieldUIElement")
W
wq1234wq 已提交
960 961 962
                        .HasColumnType("bigint");

                    b.Property<string>("FieldUIElementSchema")
963
                        .HasColumnType("text");
W
wq1234wq 已提交
964 965

                    b.Property<string>("FieldUnit")
966
                        .HasColumnType("text");
W
wq1234wq 已提交
967 968

                    b.Property<string>("FieldValue")
969
                        .HasColumnType("text");
W
wq1234wq 已提交
970 971

                    b.Property<string>("FieldValueDataSource")
972
                        .HasColumnType("text");
W
wq1234wq 已提交
973 974

                    b.Property<string>("FieldValueLocalDataSource")
975
                        .HasColumnType("text");
W
wq1234wq 已提交
976

977 978
                    b.Property<int>("FieldValueType")
                        .HasColumnType("integer");
W
wq1234wq 已提交
979 980

                    b.Property<string>("FieldValueTypeName")
981
                        .HasColumnType("text");
W
wq1234wq 已提交
982

983
                    b.Property<long>("FormId")
W
wq1234wq 已提交
984 985
                        .HasColumnType("bigint");

986 987
                    b.Property<bool>("IsEnabled")
                        .HasColumnType("boolean");
W
wq1234wq 已提交
988

989 990
                    b.Property<bool>("IsRequired")
                        .HasColumnType("boolean");
W
wq1234wq 已提交
991

992 993
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009

                    b.HasKey("FieldId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("DynamicFormFieldInfos");
                });

            modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldValueInfo", b =>
                {
                    b.Property<long>("FieldValueId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

1010 1011 1012
                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("FieldValueId"));

                    b.Property<long>("BizId")
W
wq1234wq 已提交
1013 1014 1015
                        .HasColumnType("bigint");

                    b.Property<Guid>("Creator")
1016
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1017

1018 1019
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1020 1021

                    b.Property<string>("FieldCode")
1022
                        .HasColumnType("text");
W
wq1234wq 已提交
1023 1024

                    b.Property<DateTime?>("FieldCreateDate")
1025
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1026

1027
                    b.Property<long>("FieldId")
W
wq1234wq 已提交
1028 1029 1030
                        .HasColumnType("bigint");

                    b.Property<string>("FieldName")
1031
                        .HasColumnType("text");
W
wq1234wq 已提交
1032 1033

                    b.Property<string>("FieldUnit")
1034
                        .HasColumnType("text");
W
wq1234wq 已提交
1035 1036

                    b.Property<string>("FieldValue")
1037
                        .HasColumnType("text");
W
wq1234wq 已提交
1038

1039
                    b.Property<long>("FieldValueType")
W
wq1234wq 已提交
1040 1041
                        .HasColumnType("bigint");

1042
                    b.Property<long>("FromId")
W
wq1234wq 已提交
1043 1044
                        .HasColumnType("bigint");

1045 1046
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062

                    b.HasKey("FieldValueId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("DynamicFormFieldValueInfos");
                });

            modelBuilder.Entity("IoTSharp.Data.DynamicFormInfo", b =>
                {
                    b.Property<long>("FormId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

1063 1064 1065
                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("FormId"));

                    b.Property<long>("BizId")
W
wq1234wq 已提交
1066 1067 1068
                        .HasColumnType("bigint");

                    b.Property<Guid>("Creator")
1069
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1070

1071 1072
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1073

1074
                    b.Property<long>("FormCreator")
W
wq1234wq 已提交
1075 1076 1077
                        .HasColumnType("bigint");

                    b.Property<string>("FormDesc")
1078
                        .HasColumnType("text");
W
wq1234wq 已提交
1079 1080

                    b.Property<string>("FormLayout")
1081
                        .HasColumnType("text");
W
wq1234wq 已提交
1082 1083

                    b.Property<string>("FormName")
1084
                        .HasColumnType("text");
W
wq1234wq 已提交
1085 1086

                    b.Property<string>("FormSchame")
1087
                        .HasColumnType("text");
W
wq1234wq 已提交
1088

1089 1090
                    b.Property<int>("FormStatus")
                        .HasColumnType("integer");
W
wq1234wq 已提交
1091 1092

                    b.Property<DateTime?>("FromCreateDate")
1093
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1094 1095

                    b.Property<bool>("IsCompact")
1096
                        .HasColumnType("boolean");
W
wq1234wq 已提交
1097 1098

                    b.Property<string>("ModelClass")
1099
                        .HasColumnType("text");
W
wq1234wq 已提交
1100

1101 1102
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1103 1104

                    b.Property<string>("Url")
1105
                        .HasColumnType("text");
W
wq1234wq 已提交
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119

                    b.HasKey("FormId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("DynamicFormInfos");
                });

            modelBuilder.Entity("IoTSharp.Data.Flow", b =>
                {
                    b.Property<Guid>("FlowId")
                        .ValueGeneratedOnAdd()
1120
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1121 1122

                    b.Property<string>("Conditionexpression")
1123
                        .HasColumnType("text");
W
wq1234wq 已提交
1124 1125

                    b.Property<DateTime>("CreateDate")
1126
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1127 1128

                    b.Property<Guid>("CreateId")
1129
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1130 1131

                    b.Property<Guid>("Createor")
1132
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1133

1134 1135
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1136 1137

                    b.Property<Guid?>("ExecutorId")
1138
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1139 1140

                    b.Property<Guid?>("FlowRuleRuleId")
1141
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1142 1143

                    b.Property<int>("FlowStatus")
1144
                        .HasColumnType("integer");
W
wq1234wq 已提交
1145 1146

                    b.Property<string>("FlowType")
1147
                        .HasColumnType("text");
W
wq1234wq 已提交
1148 1149

                    b.Property<string>("Flowdesc")
1150
                        .HasColumnType("text");
W
wq1234wq 已提交
1151 1152

                    b.Property<string>("Flowname")
1153
                        .HasColumnType("text");
W
wq1234wq 已提交
1154 1155

                    b.Property<string>("Incoming")
1156
                        .HasColumnType("text");
W
wq1234wq 已提交
1157 1158

                    b.Property<string>("NodeProcessClass")
1159
                        .HasColumnType("text");
W
wq1234wq 已提交
1160 1161

                    b.Property<string>("NodeProcessMethod")
1162
                        .HasColumnType("text");
W
wq1234wq 已提交
1163 1164

                    b.Property<string>("NodeProcessParams")
1165
                        .HasColumnType("text");
W
wq1234wq 已提交
1166 1167

                    b.Property<string>("NodeProcessScript")
1168
                        .HasColumnType("text");
W
wq1234wq 已提交
1169 1170

                    b.Property<string>("NodeProcessScriptType")
1171
                        .HasColumnType("text");
W
wq1234wq 已提交
1172 1173

                    b.Property<string>("NodeProcessType")
1174
                        .HasColumnType("text");
W
wq1234wq 已提交
1175 1176

                    b.Property<string>("ObjectId")
1177
                        .HasColumnType("text");
W
wq1234wq 已提交
1178 1179

                    b.Property<string>("Outgoing")
1180
                        .HasColumnType("text");
W
wq1234wq 已提交
1181 1182

                    b.Property<string>("SourceId")
1183
                        .HasColumnType("text");
W
wq1234wq 已提交
1184 1185

                    b.Property<string>("TargetId")
1186
                        .HasColumnType("text");
W
wq1234wq 已提交
1187

1188 1189
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1190 1191

                    b.Property<int>("TestStatus")
1192
                        .HasColumnType("integer");
W
wq1234wq 已提交
1193 1194

                    b.Property<Guid>("Tester")
1195
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1196 1197

                    b.Property<DateTime>("TesterDateTime")
1198
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1199 1200

                    b.Property<string>("bpmnid")
1201
                        .HasColumnType("text");
W
wq1234wq 已提交
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219

                    b.HasKey("FlowId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("ExecutorId");

                    b.HasIndex("FlowRuleRuleId");

                    b.HasIndex("TenantId");

                    b.ToTable("Flows");
                });

            modelBuilder.Entity("IoTSharp.Data.FlowOperation", b =>
                {
                    b.Property<Guid>("OperationId")
                        .ValueGeneratedOnAdd()
1220
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1221 1222

                    b.Property<DateTime?>("AddDate")
1223
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1224

1225 1226
                    b.Property<Guid?>("BaseEventEventId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1227 1228

                    b.Property<string>("BizId")
1229
                        .HasColumnType("text");
W
wq1234wq 已提交
1230 1231

                    b.Property<string>("Data")
1232
                        .HasColumnType("text");
W
wq1234wq 已提交
1233

1234 1235
                    b.Property<Guid?>("FlowId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1236

1237 1238
                    b.Property<Guid?>("FlowRuleRuleId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1239

1240 1241
                    b.Property<int>("NodeStatus")
                        .HasColumnType("integer");
W
wq1234wq 已提交
1242 1243

                    b.Property<string>("OperationDesc")
1244
                        .HasColumnType("text");
W
wq1234wq 已提交
1245 1246

                    b.Property<int>("Step")
1247
                        .HasColumnType("integer");
W
wq1234wq 已提交
1248 1249

                    b.Property<string>("Tag")
1250
                        .HasColumnType("text");
W
wq1234wq 已提交
1251 1252

                    b.Property<string>("bpmnid")
1253
                        .HasColumnType("text");
W
wq1234wq 已提交
1254 1255 1256

                    b.HasKey("OperationId");

1257
                    b.HasIndex("BaseEventEventId");
W
wq1234wq 已提交
1258 1259 1260

                    b.HasIndex("FlowId");

1261
                    b.HasIndex("FlowRuleRuleId");
W
wq1234wq 已提交
1262 1263 1264 1265 1266 1267 1268 1269

                    b.ToTable("FlowOperations");
                });

            modelBuilder.Entity("IoTSharp.Data.FlowRule", b =>
                {
                    b.Property<Guid>("RuleId")
                        .ValueGeneratedOnAdd()
1270
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1271 1272

                    b.Property<DateTime?>("CreatTime")
1273
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1274 1275

                    b.Property<Guid>("CreateId")
1276
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1277 1278

                    b.Property<string>("Creator")
1279
                        .HasColumnType("text");
W
wq1234wq 已提交
1280

1281 1282
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1283 1284

                    b.Property<string>("DefinitionsXml")
1285
                        .HasColumnType("text");
W
wq1234wq 已提交
1286 1287

                    b.Property<string>("Describes")
1288
                        .HasColumnType("text");
W
wq1234wq 已提交
1289 1290

                    b.Property<string>("ExecutableCode")
1291
                        .HasColumnType("text");
W
wq1234wq 已提交
1292 1293

                    b.Property<int>("MountType")
1294
                        .HasColumnType("integer");
W
wq1234wq 已提交
1295 1296 1297

                    b.Property<string>("Name")
                        .IsRequired()
1298
                        .HasColumnType("text");
W
wq1234wq 已提交
1299 1300

                    b.Property<Guid>("ParentRuleId")
1301
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1302 1303

                    b.Property<string>("RuleDesc")
1304
                        .HasColumnType("text");
W
wq1234wq 已提交
1305 1306

                    b.Property<int?>("RuleStatus")
1307
                        .HasColumnType("integer");
W
wq1234wq 已提交
1308 1309

                    b.Property<int>("RuleType")
1310
                        .HasColumnType("integer");
W
wq1234wq 已提交
1311 1312

                    b.Property<string>("Runner")
1313
                        .HasColumnType("text");
W
wq1234wq 已提交
1314 1315

                    b.Property<double>("SubVersion")
1316
                        .HasColumnType("double precision");
W
wq1234wq 已提交
1317

1318 1319
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1320 1321

                    b.Property<double>("Version")
1322
                        .HasColumnType("double precision");
W
wq1234wq 已提交
1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336

                    b.HasKey("RuleId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("FlowRules");
                });

            modelBuilder.Entity("IoTSharp.Data.RefreshToken", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
1337
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1338 1339

                    b.Property<DateTime>("AddedDate")
1340
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1341 1342

                    b.Property<DateTime>("ExpiryDate")
1343
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1344 1345

                    b.Property<bool>("IsRevorked")
1346
                        .HasColumnType("boolean");
W
wq1234wq 已提交
1347 1348

                    b.Property<bool>("IsUsed")
1349
                        .HasColumnType("boolean");
W
wq1234wq 已提交
1350 1351

                    b.Property<string>("JwtId")
1352
                        .HasColumnType("text");
W
wq1234wq 已提交
1353 1354

                    b.Property<string>("Token")
1355
                        .HasColumnType("text");
W
wq1234wq 已提交
1356 1357

                    b.Property<string>("UserId")
1358
                        .HasColumnType("text");
W
wq1234wq 已提交
1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("RefreshTokens");
                });

            modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
1371
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1372 1373

                    b.Property<Guid?>("CustomerId")
1374
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1375 1376

                    b.Property<string>("IdentityUserId")
1377
                        .HasColumnType("text");
W
wq1234wq 已提交
1378 1379

                    b.Property<Guid?>("TenantId")
1380
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.HasIndex("IdentityUserId");

                    b.HasIndex("TenantId");

                    b.ToTable("Relationship");
                });

            modelBuilder.Entity("IoTSharp.Data.RuleTaskExecutor", b =>
                {
                    b.Property<Guid>("ExecutorId")
                        .ValueGeneratedOnAdd()
1397
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1398 1399

                    b.Property<DateTime>("AddDateTime")
1400
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1401 1402

                    b.Property<Guid>("Creator")
1403
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1404

1405 1406
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1407 1408

                    b.Property<string>("DefaultConfig")
1409
                        .HasColumnType("text");
W
wq1234wq 已提交
1410 1411

                    b.Property<string>("ExecutorDesc")
1412
                        .HasColumnType("text");
W
wq1234wq 已提交
1413 1414

                    b.Property<string>("ExecutorName")
1415
                        .HasColumnType("text");
W
wq1234wq 已提交
1416 1417

                    b.Property<int>("ExecutorStatus")
1418
                        .HasColumnType("integer");
W
wq1234wq 已提交
1419 1420

                    b.Property<string>("MataData")
1421
                        .HasColumnType("text");
W
wq1234wq 已提交
1422 1423

                    b.Property<string>("Path")
1424
                        .HasColumnType("text");
W
wq1234wq 已提交
1425 1426

                    b.Property<string>("Tag")
1427
                        .HasColumnType("text");
W
wq1234wq 已提交
1428

1429 1430
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1431 1432

                    b.Property<int>("TestStatus")
1433
                        .HasColumnType("integer");
W
wq1234wq 已提交
1434 1435

                    b.Property<Guid>("Tester")
1436
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1437 1438

                    b.Property<DateTime>("TesterDateTime")
1439
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1440 1441

                    b.Property<string>("TypeName")
1442
                        .HasColumnType("text");
W
wq1234wq 已提交
1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456

                    b.HasKey("ExecutorId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("RuleTaskExecutors");
                });

            modelBuilder.Entity("IoTSharp.Data.SubscriptionEvent", b =>
                {
                    b.Property<Guid>("EventId")
                        .ValueGeneratedOnAdd()
1457
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1458 1459

                    b.Property<DateTime>("CreateDateTime")
1460
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1461 1462

                    b.Property<Guid>("Creator")
1463
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1464

1465 1466
                    b.Property<Guid?>("CustomerId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1467 1468

                    b.Property<string>("EventDesc")
1469
                        .HasColumnType("text");
W
wq1234wq 已提交
1470 1471

                    b.Property<string>("EventName")
1472
                        .HasColumnType("text");
W
wq1234wq 已提交
1473 1474

                    b.Property<string>("EventNameSpace")
1475
                        .HasColumnType("text");
W
wq1234wq 已提交
1476 1477

                    b.Property<string>("EventParam")
1478
                        .HasColumnType("text");
W
wq1234wq 已提交
1479 1480

                    b.Property<int>("EventStatus")
1481
                        .HasColumnType("integer");
W
wq1234wq 已提交
1482 1483

                    b.Property<string>("EventTag")
1484
                        .HasColumnType("text");
W
wq1234wq 已提交
1485

1486 1487
                    b.Property<Guid?>("TenantId")
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1488 1489

                    b.Property<int>("Type")
1490
                        .HasColumnType("integer");
W
wq1234wq 已提交
1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504

                    b.HasKey("EventId");

                    b.HasIndex("CustomerId");

                    b.HasIndex("TenantId");

                    b.ToTable("SubscriptionEvents");
                });

            modelBuilder.Entity("IoTSharp.Data.SubscriptionTask", b =>
                {
                    b.Property<Guid>("BindId")
                        .ValueGeneratedOnAdd()
1505
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1506 1507

                    b.Property<Guid>("EventId")
1508
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1509 1510

                    b.Property<Guid?>("RuleTaskExecutorExecutorId")
1511
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1512 1513

                    b.Property<int>("Status")
1514
                        .HasColumnType("integer");
W
wq1234wq 已提交
1515 1516

                    b.Property<Guid?>("SubscriptionEventId")
1517
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1518 1519

                    b.Property<string>("TaskConfig")
1520
                        .HasColumnType("text");
W
wq1234wq 已提交
1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533

                    b.HasKey("BindId");

                    b.HasIndex("RuleTaskExecutorExecutorId");

                    b.HasIndex("SubscriptionEventId");

                    b.ToTable("SubscriptionTasks");
                });

            modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
                {
                    b.Property<Guid>("DeviceId")
1534
                        .HasColumnType("uuid")
W
wq1234wq 已提交
1535 1536 1537
                        .HasColumnOrder(1);

                    b.Property<string>("KeyName")
1538
                        .HasColumnType("text")
W
wq1234wq 已提交
1539 1540 1541
                        .HasColumnOrder(2);

                    b.Property<DateTime>("DateTime")
1542
                        .HasColumnType("timestamp with time zone")
W
wq1234wq 已提交
1543 1544 1545
                        .HasColumnOrder(3);

                    b.Property<int>("DataSide")
1546
                        .HasColumnType("integer")
W
wq1234wq 已提交
1547 1548 1549
                        .HasColumnOrder(4);

                    b.Property<int>("Type")
1550
                        .HasColumnType("integer")
W
wq1234wq 已提交
1551 1552 1553
                        .HasColumnOrder(5);

                    b.Property<byte[]>("Value_Binary")
1554
                        .HasColumnType("bytea");
W
wq1234wq 已提交
1555 1556

                    b.Property<bool?>("Value_Boolean")
1557
                        .HasColumnType("boolean");
W
wq1234wq 已提交
1558 1559

                    b.Property<DateTime?>("Value_DateTime")
1560
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1561 1562

                    b.Property<double?>("Value_Double")
1563
                        .HasColumnType("double precision");
W
wq1234wq 已提交
1564 1565

                    b.Property<string>("Value_Json")
1566
                        .HasColumnType("jsonb");
W
wq1234wq 已提交
1567 1568 1569 1570 1571

                    b.Property<long?>("Value_Long")
                        .HasColumnType("bigint");

                    b.Property<string>("Value_String")
1572
                        .HasColumnType("text");
W
wq1234wq 已提交
1573 1574

                    b.Property<string>("Value_XML")
1575
                        .HasColumnType("xml");
W
wq1234wq 已提交
1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591

                    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<Guid>("Id")
                        .ValueGeneratedOnAdd()
1592
                        .HasColumnType("uuid");
W
wq1234wq 已提交
1593 1594

                    b.Property<string>("Address")
1595
                        .HasColumnType("text");
W
wq1234wq 已提交
1596 1597

                    b.Property<string>("City")
1598
                        .HasColumnType("text");
W
wq1234wq 已提交
1599 1600

                    b.Property<string>("Country")
1601
                        .HasColumnType("text");
W
wq1234wq 已提交
1602 1603

                    b.Property<string>("EMail")
1604
                        .HasColumnType("text");
W
wq1234wq 已提交
1605 1606

                    b.Property<string>("Name")
1607
                        .HasColumnType("text");
W
wq1234wq 已提交
1608 1609

                    b.Property<string>("Phone")
1610
                        .HasColumnType("text");
W
wq1234wq 已提交
1611 1612

                    b.Property<string>("Province")
1613
                        .HasColumnType("text");
W
wq1234wq 已提交
1614 1615

                    b.Property<string>("Street")
1616
                        .HasColumnType("text");
W
wq1234wq 已提交
1617 1618

                    b.Property<int>("ZipCode")
1619
                        .HasColumnType("integer");
W
wq1234wq 已提交
1620 1621 1622 1623 1624 1625 1626 1627 1628

                    b.HasKey("Id");

                    b.ToTable("Tenant");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
1629
                        .HasColumnType("text");
W
wq1234wq 已提交
1630 1631 1632

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
1633
                        .HasColumnType("text");
W
wq1234wq 已提交
1634 1635 1636

                    b.Property<string>("Name")
                        .HasMaxLength(256)
1637
                        .HasColumnType("character varying(256)");
W
wq1234wq 已提交
1638 1639 1640

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256)
1641
                        .HasColumnType("character varying(256)");
W
wq1234wq 已提交
1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasDatabaseName("RoleNameIndex");

                    b.ToTable("AspNetRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
1656 1657 1658
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
W
wq1234wq 已提交
1659 1660

                    b.Property<string>("ClaimType")
1661
                        .HasColumnType("text");
W
wq1234wq 已提交
1662 1663

                    b.Property<string>("ClaimValue")
1664
                        .HasColumnType("text");
W
wq1234wq 已提交
1665 1666 1667

                    b.Property<string>("RoleId")
                        .IsRequired()
1668
                        .HasColumnType("text");
W
wq1234wq 已提交
1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
                {
                    b.Property<string>("Id")
1680
                        .HasColumnType("text");
W
wq1234wq 已提交
1681 1682

                    b.Property<int>("AccessFailedCount")
1683
                        .HasColumnType("integer");
W
wq1234wq 已提交
1684 1685 1686

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
1687
                        .HasColumnType("text");
W
wq1234wq 已提交
1688 1689 1690

                    b.Property<string>("Email")
                        .HasMaxLength(256)
1691
                        .HasColumnType("character varying(256)");
W
wq1234wq 已提交
1692 1693

                    b.Property<bool>("EmailConfirmed")
1694
                        .HasColumnType("boolean");
W
wq1234wq 已提交
1695 1696

                    b.Property<bool>("LockoutEnabled")
1697
                        .HasColumnType("boolean");
W
wq1234wq 已提交
1698 1699

                    b.Property<DateTimeOffset?>("LockoutEnd")
1700
                        .HasColumnType("timestamp with time zone");
W
wq1234wq 已提交
1701 1702 1703

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256)
1704
                        .HasColumnType("character varying(256)");
W
wq1234wq 已提交
1705 1706 1707

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256)
1708
                        .HasColumnType("character varying(256)");
W
wq1234wq 已提交
1709 1710

                    b.Property<string>("PasswordHash")
1711
                        .HasColumnType("text");
W
wq1234wq 已提交
1712 1713

                    b.Property<string>("PhoneNumber")
1714
                        .HasColumnType("text");
W
wq1234wq 已提交
1715 1716

                    b.Property<bool>("PhoneNumberConfirmed")
1717
                        .HasColumnType("boolean");
W
wq1234wq 已提交
1718 1719

                    b.Property<string>("SecurityStamp")
1720
                        .HasColumnType("text");
W
wq1234wq 已提交
1721 1722

                    b.Property<bool>("TwoFactorEnabled")
1723
                        .HasColumnType("boolean");
W
wq1234wq 已提交
1724 1725 1726

                    b.Property<string>("UserName")
                        .HasMaxLength(256)
1727
                        .HasColumnType("character varying(256)");
W
wq1234wq 已提交
1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasDatabaseName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasDatabaseName("UserNameIndex");

                    b.ToTable("AspNetUsers", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
1745 1746 1747
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
W
wq1234wq 已提交
1748 1749

                    b.Property<string>("ClaimType")
1750
                        .HasColumnType("text");
W
wq1234wq 已提交
1751 1752

                    b.Property<string>("ClaimValue")
1753
                        .HasColumnType("text");
W
wq1234wq 已提交
1754 1755 1756

                    b.Property<string>("UserId")
                        .IsRequired()
1757
                        .HasColumnType("text");
W
wq1234wq 已提交
1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider")
1769
                        .HasColumnType("text");
W
wq1234wq 已提交
1770 1771

                    b.Property<string>("ProviderKey")
1772
                        .HasColumnType("text");
W
wq1234wq 已提交
1773 1774

                    b.Property<string>("ProviderDisplayName")
1775
                        .HasColumnType("text");
W
wq1234wq 已提交
1776 1777 1778

                    b.Property<string>("UserId")
                        .IsRequired()
1779
                        .HasColumnType("text");
W
wq1234wq 已提交
1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId")
1791
                        .HasColumnType("text");
W
wq1234wq 已提交
1792 1793

                    b.Property<string>("RoleId")
1794
                        .HasColumnType("text");
W
wq1234wq 已提交
1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId")
1806
                        .HasColumnType("text");
W
wq1234wq 已提交
1807 1808

                    b.Property<string>("LoginProvider")
1809
                        .HasColumnType("text");
W
wq1234wq 已提交
1810 1811

                    b.Property<string>("Name")
1812
                        .HasColumnType("text");
W
wq1234wq 已提交
1813 1814

                    b.Property<string>("Value")
1815
                        .HasColumnType("text");
W
wq1234wq 已提交
1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens", (string)null);
                });

            modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
                {
                    b.HasBaseType("IoTSharp.Data.DataStorage");

                    b.HasDiscriminator().HasValue(2);
                });

            modelBuilder.Entity("IoTSharp.Data.Gateway", b =>
                {
                    b.HasBaseType("IoTSharp.Data.Device");

                    b.HasDiscriminator().HasValue(1);
                });

            modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
                {
                    b.HasBaseType("IoTSharp.Data.DataStorage");

                    b.HasDiscriminator().HasValue(4);
                });

            modelBuilder.Entity("IoTSharp.Data.AuditLog", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
                        .HasForeignKey("CustomerId");

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
                        .HasForeignKey("TenantId");

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
                        .HasForeignKey("CustomerId");

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
                        .HasForeignKey("TenantId");

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.BaseEvent", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
麦壳饼's avatar
麦壳饼 已提交
1877
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
1878 1879 1880 1881 1882 1883 1884

                    b.HasOne("IoTSharp.Data.FlowRule", "FlowRule")
                        .WithMany()
                        .HasForeignKey("FlowRuleRuleId");

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
麦壳饼's avatar
麦壳饼 已提交
1885
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937

                    b.Navigation("Customer");

                    b.Navigation("FlowRule");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.Customer", b =>
                {
                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany("Customers")
                        .HasForeignKey("TenantId");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.Device", b =>
                {
                    b.HasOne("IoTSharp.Data.AuthorizedKey", null)
                        .WithMany("Devices")
                        .HasForeignKey("AuthorizedKeyId");

                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany("Devices")
                        .HasForeignKey("CustomerId");

                    b.HasOne("IoTSharp.Data.DeviceModel", "DeviceModel")
                        .WithMany()
                        .HasForeignKey("DeviceModelId");

                    b.HasOne("IoTSharp.Data.Gateway", "Owner")
                        .WithMany("Children")
                        .HasForeignKey("OwnerId");

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany("Devices")
                        .HasForeignKey("TenantId");

                    b.Navigation("Customer");

                    b.Navigation("DeviceModel");

                    b.Navigation("Owner");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceDiagram", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
1938
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
1939 1940 1941

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
1942
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
1943 1944 1945 1946 1947 1948 1949 1950 1951 1952

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceGraph", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
1953
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
1954 1955 1956 1957 1958 1959 1960

                    b.HasOne("IoTSharp.Data.DeviceDiagram", "DeviceDiagram")
                        .WithMany()
                        .HasForeignKey("DeviceDiagramDiagramId");

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
1961
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973

                    b.Navigation("Customer");

                    b.Navigation("DeviceDiagram");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceGraphToolBox", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
1974
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
1975 1976 1977

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
1978
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
                {
                    b.HasOne("IoTSharp.Data.Device", "Device")
                        .WithOne("DeviceIdentity")
                        .HasForeignKey("IoTSharp.Data.DeviceIdentity", "DeviceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Device");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceModelCommand", b =>
                {
                    b.HasOne("IoTSharp.Data.DeviceModel", "DeviceModel")
                        .WithMany("DeviceModelCommands")
                        .HasForeignKey("DeviceModelId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("DeviceModel");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceRule", b =>
                {
                    b.HasOne("IoTSharp.Data.Device", "Device")
                        .WithMany()
                        .HasForeignKey("DeviceId");

                    b.HasOne("IoTSharp.Data.FlowRule", "FlowRule")
                        .WithMany()
                        .HasForeignKey("FlowRuleRuleId");

                    b.Navigation("Device");

                    b.Navigation("FlowRule");
                });

            modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldInfo", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
2026
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
2027 2028 2029

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
2030
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
2031 2032 2033 2034 2035 2036 2037 2038 2039 2040

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.DynamicFormFieldValueInfo", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
2041
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
2042 2043 2044

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
2045
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
2046 2047 2048 2049 2050 2051 2052 2053 2054 2055

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.DynamicFormInfo", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
2056
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
2057 2058 2059

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
2060
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
2061 2062 2063 2064 2065 2066 2067 2068 2069 2070

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.Flow", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
2071
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082

                    b.HasOne("IoTSharp.Data.RuleTaskExecutor", "Executor")
                        .WithMany()
                        .HasForeignKey("ExecutorId");

                    b.HasOne("IoTSharp.Data.FlowRule", "FlowRule")
                        .WithMany()
                        .HasForeignKey("FlowRuleRuleId");

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
2083
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097

                    b.Navigation("Customer");

                    b.Navigation("Executor");

                    b.Navigation("FlowRule");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.FlowOperation", b =>
                {
                    b.HasOne("IoTSharp.Data.BaseEvent", "BaseEvent")
                        .WithMany()
2098
                        .HasForeignKey("BaseEventEventId");
W
wq1234wq 已提交
2099 2100 2101

                    b.HasOne("IoTSharp.Data.Flow", "Flow")
                        .WithMany()
2102
                        .HasForeignKey("FlowId");
W
wq1234wq 已提交
2103 2104 2105

                    b.HasOne("IoTSharp.Data.FlowRule", "FlowRule")
                        .WithMany()
2106
                        .HasForeignKey("FlowRuleRuleId");
W
wq1234wq 已提交
2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118

                    b.Navigation("BaseEvent");

                    b.Navigation("Flow");

                    b.Navigation("FlowRule");
                });

            modelBuilder.Entity("IoTSharp.Data.FlowRule", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
2119
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
2120 2121 2122

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
2123
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.RefreshToken", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User")
                        .WithMany()
                        .HasForeignKey("UserId");

                    b.Navigation("User");
                });

            modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
                        .HasForeignKey("CustomerId");

                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "IdentityUser")
                        .WithMany()
                        .HasForeignKey("IdentityUserId");

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
                        .HasForeignKey("TenantId");

                    b.Navigation("Customer");

                    b.Navigation("IdentityUser");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.RuleTaskExecutor", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
2164
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
2165 2166 2167

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
2168
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
2169 2170 2171 2172 2173 2174 2175 2176 2177 2178

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.SubscriptionEvent", b =>
                {
                    b.HasOne("IoTSharp.Data.Customer", "Customer")
                        .WithMany()
2179
                        .HasForeignKey("CustomerId");
W
wq1234wq 已提交
2180 2181 2182

                    b.HasOne("IoTSharp.Data.Tenant", "Tenant")
                        .WithMany()
2183
                        .HasForeignKey("TenantId");
W
wq1234wq 已提交
2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290

                    b.Navigation("Customer");

                    b.Navigation("Tenant");
                });

            modelBuilder.Entity("IoTSharp.Data.SubscriptionTask", b =>
                {
                    b.HasOne("IoTSharp.Data.RuleTaskExecutor", "RuleTaskExecutor")
                        .WithMany()
                        .HasForeignKey("RuleTaskExecutorExecutorId");

                    b.HasOne("IoTSharp.Data.SubscriptionEvent", "Subscription")
                        .WithMany()
                        .HasForeignKey("SubscriptionEventId");

                    b.Navigation("RuleTaskExecutor");

                    b.Navigation("Subscription");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("IoTSharp.Data.AuthorizedKey", b =>
                {
                    b.Navigation("Devices");
                });

            modelBuilder.Entity("IoTSharp.Data.Customer", b =>
                {
                    b.Navigation("Devices");
                });

            modelBuilder.Entity("IoTSharp.Data.Device", b =>
                {
                    b.Navigation("DeviceIdentity");
                });

            modelBuilder.Entity("IoTSharp.Data.DeviceModel", b =>
                {
                    b.Navigation("DeviceModelCommands");
                });

            modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
                {
                    b.Navigation("Customers");

                    b.Navigation("Devices");
                });

            modelBuilder.Entity("IoTSharp.Data.Gateway", b =>
                {
                    b.Navigation("Children");
                });
#pragma warning restore 612, 618
        }
    }
}