sunpengfei
2025-08-12 3933faa0048251bbeaf26eb6bb49a2837dc48b3a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
using System;
using Microsoft.EntityFrameworkCore.Migrations;
 
#nullable disable
 
namespace FlexJobApi.Database.Migrations.Migrations
{
    /// <inheritdoc />
    public partial class UpdateUser0801 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "DictionaryCategory",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "编号"),
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "名称"),
                    FieldNames = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段名(逗号隔开)"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DictionaryCategory", x => x.Id);
                },
                comment: "字典类别");
 
            migrationBuilder.CreateTable(
                name: "FileStore",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Access = table.Column<int>(type: "int", nullable: false, comment: "通道"),
                    AbsolutePath = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "绝对路径"),
                    RelativePath = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "相对路径"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "名称"),
                    Extension = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "扩展名"),
                    ContentType = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "内容类型"),
                    FileType = table.Column<int>(type: "int", nullable: false, comment: "文件类型"),
                    Length = table.Column<long>(type: "bigint", nullable: false, comment: "文件大小(字节)"),
                    Hash = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "哈希"),
                    ImageWidth = table.Column<int>(type: "int", nullable: true, comment: "宽度(像素)"),
                    ImageHeight = table.Column<int>(type: "int", nullable: true, comment: "高度(像素)"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FileStore", x => x.Id);
                },
                comment: "文件存储");
 
            migrationBuilder.CreateTable(
                name: "Menu",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "上级Id"),
                    Path = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "菜单路径"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "编号"),
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "名称"),
                    Type = table.Column<int>(type: "int", nullable: false, comment: "类型"),
                    VisitLevel = table.Column<int>(type: "int", nullable: false, comment: "访问级别"),
                    Icon = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "图标"),
                    Url = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "链接地址"),
                    Group = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "分组名称(用于按钮/字段)"),
                    Location = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "位置(用于按钮)"),
                    Width = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "列宽(用于按钮/列/元素)"),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false, comment: "是否禁用"),
                    IsHidden = table.Column<bool>(type: "bit", nullable: false, comment: "是否隐藏"),
                    IsCache = table.Column<bool>(type: "bit", nullable: false, comment: "是否缓存"),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Menu", x => x.Id);
                    table.ForeignKey(
                        name: "FK_Menu_Menu_ParentId",
                        column: x => x.ParentId,
                        principalTable: "Menu",
                        principalColumn: "Id");
                },
                comment: "菜单");
 
            migrationBuilder.CreateTable(
                name: "Resource",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Service = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Method = table.Column<int>(type: "int", nullable: false),
                    Route = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    RequestTypeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ResponseTypeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsExpired = table.Column<bool>(type: "bit", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Resource", x => x.Id);
                });
 
            migrationBuilder.CreateTable(
                name: "Role",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "名称"),
                    UserType = table.Column<int>(type: "int", nullable: false, comment: "用户类型"),
                    ClientType = table.Column<int>(type: "int", nullable: false, comment: "客户端类型"),
                    MinLevel = table.Column<int>(type: "int", nullable: false, comment: "最低级别"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Role", x => x.Id);
                },
                comment: "角色");
 
            migrationBuilder.CreateTable(
                name: "DictionaryData",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    CategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "类别Id"),
                    ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "上级Id"),
                    Path = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字典路径"),
                    Code = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true, comment: "编号"),
                    Content = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "显示内容"),
                    Field1 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段1"),
                    Field2 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段2"),
                    Field3 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段3"),
                    Field4 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段4"),
                    Field5 = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "字段5"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DictionaryData", x => x.Id);
                    table.ForeignKey(
                        name: "FK_DictionaryData_DictionaryCategory_CategoryId",
                        column: x => x.CategoryId,
                        principalTable: "DictionaryCategory",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_DictionaryData_DictionaryData_ParentId",
                        column: x => x.ParentId,
                        principalTable: "DictionaryData",
                        principalColumn: "Id");
                },
                comment: "字典数据");
 
            migrationBuilder.CreateTable(
                name: "FileVirtualPath",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    StoreId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "文件存储Id"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "名称"),
                    VirtualPath = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "虚拟路径"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FileVirtualPath", x => x.Id);
                    table.ForeignKey(
                        name: "FK_FileVirtualPath_FileStore_StoreId",
                        column: x => x.StoreId,
                        principalTable: "FileStore",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "文件虚拟路径");
 
            migrationBuilder.CreateTable(
                name: "RoleMenu",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "角色Id"),
                    MenuId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "菜单Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RoleMenu", x => x.Id);
                    table.ForeignKey(
                        name: "FK_RoleMenu_Menu_MenuId",
                        column: x => x.MenuId,
                        principalTable: "Menu",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_RoleMenu_Role_RoleId",
                        column: x => x.RoleId,
                        principalTable: "Role",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "角色菜单");
 
            migrationBuilder.CreateTable(
                name: "RoleResource",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    MenuId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    DataPower = table.Column<int>(type: "int", nullable: true),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RoleResource", x => x.Id);
                    table.ForeignKey(
                        name: "FK_RoleResource_Menu_MenuId",
                        column: x => x.MenuId,
                        principalTable: "Menu",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_RoleResource_Role_RoleId",
                        column: x => x.RoleId,
                        principalTable: "Role",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });
 
            migrationBuilder.CreateTable(
                name: "Enterprise",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    EnterpriseRealMethod = table.Column<int>(type: "int", nullable: true, comment: "企业认证方式"),
                    EnterpriseName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "企业全称"),
                    SocietyCreditCode = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: false, comment: "统一社会信用代码"),
                    LicenseImageId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "营业执照照片Id"),
                    LegalPerson = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "法人姓名"),
                    PersonalRealMethod = table.Column<int>(type: "int", nullable: true, comment: "法人或经办人实名方式"),
                    Name = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "法人或经办人姓名"),
                    Identity = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true, comment: "法人或经办人身份证号"),
                    IdentityImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "法人或经办人身份证人像面Id"),
                    IdentityBackImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "法人或经办人身份证国徽面Id"),
                    BankCard = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "法人或经办人银行卡号"),
                    BankCardImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "法人或经办人银行卡照片Id"),
                    PhoneNumber = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true, comment: "法人或经办人手机号"),
                    Proxy = table.Column<bool>(type: "bit", nullable: true, comment: "是否委托经办人"),
                    ProxyPowerAttorneyUrl = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "企业授权书"),
                    RealAccess = table.Column<int>(type: "int", nullable: true, comment: "实名通道"),
                    IsReal = table.Column<bool>(type: "bit", nullable: false, comment: "是否实名"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Enterprise", x => x.Id);
                    table.ForeignKey(
                        name: "FK_Enterprise_FileVirtualPath_IdentityBackImgId",
                        column: x => x.IdentityBackImgId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_Enterprise_FileVirtualPath_IdentityImgId",
                        column: x => x.IdentityImgId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_Enterprise_FileVirtualPath_LicenseImageId",
                        column: x => x.LicenseImageId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id");
                },
                comment: "企业");
 
            migrationBuilder.CreateTable(
                name: "UserAuth",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    AvatarId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "头像Id"),
                    Name = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "姓名"),
                    UserName = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "用户名"),
                    PhoneNumber = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true, comment: "手机号"),
                    IsCheckPhoneNumber = table.Column<bool>(type: "bit", nullable: false, comment: "是否已校验手机号"),
                    Password = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "密码"),
                    Identity = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "身份证号"),
                    IdentityImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "身份证人像面Id"),
                    IdentityBackImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "身份证国徽面Id"),
                    BankCard = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "银行卡号"),
                    BankCardImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "银行卡照片Id"),
                    RealAccess = table.Column<int>(type: "int", nullable: true, comment: "实名通道"),
                    IsReal = table.Column<bool>(type: "bit", nullable: false, comment: "是否实名"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserAuth", x => x.Id);
                    table.ForeignKey(
                        name: "FK_UserAuth_FileVirtualPath_AvatarId",
                        column: x => x.AvatarId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_UserAuth_FileVirtualPath_BankCardImgId",
                        column: x => x.BankCardImgId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_UserAuth_FileVirtualPath_IdentityBackImgId",
                        column: x => x.IdentityBackImgId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_UserAuth_FileVirtualPath_IdentityImgId",
                        column: x => x.IdentityImgId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id");
                },
                comment: "用户");
 
            migrationBuilder.CreateTable(
                name: "Department",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "上级Id"),
                    Path = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "部门路径"),
                    EnterpriseId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "企业Id"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "名称"),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注"),
                    IsDisabled = table.Column<bool>(type: "bit", nullable: false, comment: "是否禁用"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Department", x => x.Id);
                    table.ForeignKey(
                        name: "FK_Department_Department_ParentId",
                        column: x => x.ParentId,
                        principalTable: "Department",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_Department_Enterprise_EnterpriseId",
                        column: x => x.EnterpriseId,
                        principalTable: "Enterprise",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "部门");
 
            migrationBuilder.CreateTable(
                name: "TaskInfo",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    EnterpriseId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "企业Id"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "任务名称"),
                    BillingMethod = table.Column<int>(type: "int", nullable: false, comment: "计费方式"),
                    ServiceFee = table.Column<decimal>(type: "decimal(18,2)", nullable: false, comment: "服务费"),
                    SettlementCycle = table.Column<int>(type: "int", nullable: false, comment: "结算方式"),
                    AgeMinLimit = table.Column<int>(type: "int", nullable: false, comment: "年龄范围最小"),
                    AgeMaxLimit = table.Column<int>(type: "int", nullable: false, comment: "年龄范围大"),
                    GenderLimit = table.Column<int>(type: "int", nullable: false, comment: "性别要求"),
                    CityId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "任务地点所属区域Id"),
                    Address = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "任务地点详细地址"),
                    BeginTime = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "任务开始时间"),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "任务结束时间"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TaskInfo", x => x.Id);
                    table.ForeignKey(
                        name: "FK_TaskInfo_DictionaryData_CityId",
                        column: x => x.CityId,
                        principalTable: "DictionaryData",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_TaskInfo_Enterprise_EnterpriseId",
                        column: x => x.EnterpriseId,
                        principalTable: "Enterprise",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "任务信息");
 
            migrationBuilder.CreateTable(
                name: "UserInfo",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    UserAuthId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户Id"),
                    Type = table.Column<int>(type: "int", nullable: false, comment: "用户类型"),
                    EnterpriseId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "企业Id"),
                    WxmpOpenId = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true, comment: "微信开放Id"),
                    Level = table.Column<int>(type: "int", nullable: false, comment: "级别"),
                    PersonalIdentityId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "身份Id"),
                    EducationalBackgroundId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "学历Id"),
                    CityId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "常驻城市Id"),
                    FreeTime = table.Column<int>(type: "int", nullable: true, comment: "空闲时间"),
                    JobSeekingStatus = table.Column<int>(type: "int", nullable: true, comment: "求职状态"),
                    WorkSeniority = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "工作资历"),
                    WorkExperience = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "工作经验"),
                    Height = table.Column<int>(type: "int", nullable: true, comment: "身高"),
                    Weight = table.Column<int>(type: "int", nullable: true, comment: "体重"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfo", x => x.Id);
                    table.ForeignKey(
                        name: "FK_UserInfo_DictionaryData_CityId",
                        column: x => x.CityId,
                        principalTable: "DictionaryData",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_UserInfo_DictionaryData_EducationalBackgroundId",
                        column: x => x.EducationalBackgroundId,
                        principalTable: "DictionaryData",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_UserInfo_DictionaryData_PersonalIdentityId",
                        column: x => x.PersonalIdentityId,
                        principalTable: "DictionaryData",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_UserInfo_Enterprise_EnterpriseId",
                        column: x => x.EnterpriseId,
                        principalTable: "Enterprise",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_UserInfo_UserAuth_UserAuthId",
                        column: x => x.UserAuthId,
                        principalTable: "UserAuth",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "用户信息");
 
            migrationBuilder.CreateTable(
                name: "TaskInfoBenefit",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    TaskInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "任务Id"),
                    BenefitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "福利Id"),
                    BenefitId1 = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TaskInfoBenefit", x => x.Id);
                    table.ForeignKey(
                        name: "FK_TaskInfoBenefit_DictionaryData_BenefitId1",
                        column: x => x.BenefitId1,
                        principalTable: "DictionaryData",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_TaskInfoBenefit_TaskInfo_BenefitId",
                        column: x => x.BenefitId,
                        principalTable: "TaskInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Restrict);
                },
                comment: "任务福利");
 
            migrationBuilder.CreateTable(
                name: "TaskInfoCredentialLimit",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    TaskInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "任务Id"),
                    TypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "证书类型Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TaskInfoCredentialLimit", x => x.Id);
                    table.ForeignKey(
                        name: "FK_TaskInfoCredentialLimit_DictionaryData_TypeId",
                        column: x => x.TypeId,
                        principalTable: "DictionaryData",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_TaskInfoCredentialLimit_TaskInfo_TaskInfoId",
                        column: x => x.TaskInfoId,
                        principalTable: "TaskInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });
 
            migrationBuilder.CreateTable(
                name: "TaskInfoUser",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    TaskInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "任务Id"),
                    UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
                    HireStatus = table.Column<int>(type: "int", nullable: false, comment: "录用状态"),
                    HireTime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "录用时间"),
                    SignContractStatus = table.Column<int>(type: "int", nullable: true, comment: "签约状态"),
                    SignContractTime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "签约时间"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TaskInfoUser", x => x.Id);
                    table.ForeignKey(
                        name: "FK_TaskInfoUser_TaskInfo_TaskInfoId",
                        column: x => x.TaskInfoId,
                        principalTable: "TaskInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_TaskInfoUser_UserInfo_UserInfoId",
                        column: x => x.UserInfoId,
                        principalTable: "UserInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "任务用户信息");
 
            migrationBuilder.CreateTable(
                name: "UserInfoBankCard",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
                    Code = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false, comment: "银行卡号"),
                    Bank = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "开户行"),
                    PhoneNumber = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: false, comment: "银行预留手机号"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfoBankCard", x => x.Id);
                    table.ForeignKey(
                        name: "FK_UserInfoBankCard_UserInfo_UserInfoId",
                        column: x => x.UserInfoId,
                        principalTable: "UserInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "用户银行卡信息");
 
            migrationBuilder.CreateTable(
                name: "UserInfoCredential",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
                    TypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "证书类型Id"),
                    Code = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false, comment: "证书编号"),
                    IsForever = table.Column<bool>(type: "bit", nullable: false, comment: "永久证书"),
                    StartDate = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "开始日期"),
                    EndDate = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "结束日期"),
                    IssueUnit = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "发证单位"),
                    ImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "证书正面照片Id"),
                    BackImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "证书反面照片Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfoCredential", x => x.Id);
                    table.ForeignKey(
                        name: "FK_UserInfoCredential_DictionaryData_TypeId",
                        column: x => x.TypeId,
                        principalTable: "DictionaryData",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_UserInfoCredential_FileVirtualPath_BackImgId",
                        column: x => x.BackImgId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_UserInfoCredential_FileVirtualPath_ImgId",
                        column: x => x.ImgId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_UserInfoCredential_UserInfo_UserInfoId",
                        column: x => x.UserInfoId,
                        principalTable: "UserInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "用户信息资格证书");
 
            migrationBuilder.CreateTable(
                name: "UserInfoDepartment",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
                    DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "部门Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfoDepartment", x => x.Id);
                    table.ForeignKey(
                        name: "FK_UserInfoDepartment_Department_DepartmentId",
                        column: x => x.DepartmentId,
                        principalTable: "Department",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_UserInfoDepartment_UserInfo_UserInfoId",
                        column: x => x.UserInfoId,
                        principalTable: "UserInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "用户信息部门");
 
            migrationBuilder.CreateTable(
                name: "UserInfoExpectJob",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
                    PersonalIdentityId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "期望岗位Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfoExpectJob", x => x.Id);
                    table.ForeignKey(
                        name: "FK_UserInfoExpectJob_DictionaryData_PersonalIdentityId",
                        column: x => x.PersonalIdentityId,
                        principalTable: "DictionaryData",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_UserInfoExpectJob_UserInfo_UserInfoId",
                        column: x => x.UserInfoId,
                        principalTable: "UserInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "用户信息期望岗位");
 
            migrationBuilder.CreateTable(
                name: "UserInfoPhoto",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
                    ImgId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "照片Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfoPhoto", x => x.Id);
                    table.ForeignKey(
                        name: "FK_UserInfoPhoto_FileVirtualPath_ImgId",
                        column: x => x.ImgId,
                        principalTable: "FileVirtualPath",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_UserInfoPhoto_UserInfo_UserInfoId",
                        column: x => x.UserInfoId,
                        principalTable: "UserInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "用户信息生活照");
 
            migrationBuilder.CreateTable(
                name: "UserInfoRole",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    UserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "用户信息Id"),
                    RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "角色Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟踪Id"),
                    CreatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "创建操作人"),
                    UpdatedUserInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "最后更新操作人"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "是否删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfoRole", x => x.Id);
                    table.ForeignKey(
                        name: "FK_UserInfoRole_Role_RoleId",
                        column: x => x.RoleId,
                        principalTable: "Role",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_UserInfoRole_UserInfo_UserInfoId",
                        column: x => x.UserInfoId,
                        principalTable: "UserInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                },
                comment: "用户信息角色");
 
            migrationBuilder.InsertData(
                table: "UserAuth",
                columns: new[] { "Id", "AvatarId", "BankCard", "BankCardImgId", "CreatedTime", "CreatedUserInfoId", "Identity", "IdentityBackImgId", "IdentityImgId", "IsCheckPhoneNumber", "IsDeleted", "IsReal", "Name", "Password", "PhoneNumber", "RealAccess", "Sort", "TraceId", "UpdatedTime", "UpdatedUserInfoId", "UserName" },
                values: new object[] { new Guid("11111111-1111-1111-1111-111111111111"), null, null, null, new DateTimeOffset(new DateTime(2000, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), null, null, null, null, false, false, false, "管理员", null, null, null, 0, null, null, null, "admin" });
 
            migrationBuilder.InsertData(
                table: "UserInfo",
                columns: new[] { "Id", "CityId", "CreatedTime", "CreatedUserInfoId", "EducationalBackgroundId", "EnterpriseId", "FreeTime", "Height", "IsDeleted", "JobSeekingStatus", "Level", "PersonalIdentityId", "Sort", "TraceId", "Type", "UpdatedTime", "UpdatedUserInfoId", "UserAuthId", "Weight", "WorkExperience", "WorkSeniority", "WxmpOpenId" },
                values: new object[] { new Guid("11111111-1111-1111-1111-111111111112"), null, new DateTimeOffset(new DateTime(2000, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 8, 0, 0, 0)), null, null, null, null, null, false, null, 999, null, 0, null, 100, null, null, new Guid("11111111-1111-1111-1111-111111111111"), null, null, null, null });
 
            migrationBuilder.CreateIndex(
                name: "IX_Department_EnterpriseId",
                table: "Department",
                column: "EnterpriseId");
 
            migrationBuilder.CreateIndex(
                name: "IX_Department_ParentId",
                table: "Department",
                column: "ParentId");
 
            migrationBuilder.CreateIndex(
                name: "IX_DictionaryData_CategoryId",
                table: "DictionaryData",
                column: "CategoryId");
 
            migrationBuilder.CreateIndex(
                name: "IX_DictionaryData_ParentId",
                table: "DictionaryData",
                column: "ParentId");
 
            migrationBuilder.CreateIndex(
                name: "IX_Enterprise_IdentityBackImgId",
                table: "Enterprise",
                column: "IdentityBackImgId");
 
            migrationBuilder.CreateIndex(
                name: "IX_Enterprise_IdentityImgId",
                table: "Enterprise",
                column: "IdentityImgId");
 
            migrationBuilder.CreateIndex(
                name: "IX_Enterprise_LicenseImageId",
                table: "Enterprise",
                column: "LicenseImageId");
 
            migrationBuilder.CreateIndex(
                name: "IX_FileVirtualPath_StoreId",
                table: "FileVirtualPath",
                column: "StoreId");
 
            migrationBuilder.CreateIndex(
                name: "IX_Menu_ParentId",
                table: "Menu",
                column: "ParentId");
 
            migrationBuilder.CreateIndex(
                name: "IX_RoleMenu_MenuId",
                table: "RoleMenu",
                column: "MenuId");
 
            migrationBuilder.CreateIndex(
                name: "IX_RoleMenu_RoleId",
                table: "RoleMenu",
                column: "RoleId");
 
            migrationBuilder.CreateIndex(
                name: "IX_RoleResource_MenuId",
                table: "RoleResource",
                column: "MenuId");
 
            migrationBuilder.CreateIndex(
                name: "IX_RoleResource_RoleId",
                table: "RoleResource",
                column: "RoleId");
 
            migrationBuilder.CreateIndex(
                name: "IX_TaskInfo_CityId",
                table: "TaskInfo",
                column: "CityId");
 
            migrationBuilder.CreateIndex(
                name: "IX_TaskInfo_EnterpriseId",
                table: "TaskInfo",
                column: "EnterpriseId");
 
            migrationBuilder.CreateIndex(
                name: "IX_TaskInfoBenefit_BenefitId",
                table: "TaskInfoBenefit",
                column: "BenefitId");
 
            migrationBuilder.CreateIndex(
                name: "IX_TaskInfoBenefit_BenefitId1",
                table: "TaskInfoBenefit",
                column: "BenefitId1");
 
            migrationBuilder.CreateIndex(
                name: "IX_TaskInfoCredentialLimit_TaskInfoId",
                table: "TaskInfoCredentialLimit",
                column: "TaskInfoId");
 
            migrationBuilder.CreateIndex(
                name: "IX_TaskInfoCredentialLimit_TypeId",
                table: "TaskInfoCredentialLimit",
                column: "TypeId");
 
            migrationBuilder.CreateIndex(
                name: "IX_TaskInfoUser_TaskInfoId",
                table: "TaskInfoUser",
                column: "TaskInfoId");
 
            migrationBuilder.CreateIndex(
                name: "IX_TaskInfoUser_UserInfoId",
                table: "TaskInfoUser",
                column: "UserInfoId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserAuth_AvatarId",
                table: "UserAuth",
                column: "AvatarId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserAuth_BankCardImgId",
                table: "UserAuth",
                column: "BankCardImgId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserAuth_IdentityBackImgId",
                table: "UserAuth",
                column: "IdentityBackImgId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserAuth_IdentityImgId",
                table: "UserAuth",
                column: "IdentityImgId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfo_CityId",
                table: "UserInfo",
                column: "CityId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfo_EducationalBackgroundId",
                table: "UserInfo",
                column: "EducationalBackgroundId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfo_EnterpriseId",
                table: "UserInfo",
                column: "EnterpriseId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfo_PersonalIdentityId",
                table: "UserInfo",
                column: "PersonalIdentityId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfo_UserAuthId",
                table: "UserInfo",
                column: "UserAuthId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoBankCard_UserInfoId",
                table: "UserInfoBankCard",
                column: "UserInfoId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoCredential_BackImgId",
                table: "UserInfoCredential",
                column: "BackImgId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoCredential_ImgId",
                table: "UserInfoCredential",
                column: "ImgId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoCredential_TypeId",
                table: "UserInfoCredential",
                column: "TypeId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoCredential_UserInfoId",
                table: "UserInfoCredential",
                column: "UserInfoId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoDepartment_DepartmentId",
                table: "UserInfoDepartment",
                column: "DepartmentId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoDepartment_UserInfoId",
                table: "UserInfoDepartment",
                column: "UserInfoId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoExpectJob_PersonalIdentityId",
                table: "UserInfoExpectJob",
                column: "PersonalIdentityId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoExpectJob_UserInfoId",
                table: "UserInfoExpectJob",
                column: "UserInfoId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoPhoto_ImgId",
                table: "UserInfoPhoto",
                column: "ImgId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoPhoto_UserInfoId",
                table: "UserInfoPhoto",
                column: "UserInfoId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoRole_RoleId",
                table: "UserInfoRole",
                column: "RoleId");
 
            migrationBuilder.CreateIndex(
                name: "IX_UserInfoRole_UserInfoId",
                table: "UserInfoRole",
                column: "UserInfoId");
        }
 
        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Resource");
 
            migrationBuilder.DropTable(
                name: "RoleMenu");
 
            migrationBuilder.DropTable(
                name: "RoleResource");
 
            migrationBuilder.DropTable(
                name: "TaskInfoBenefit");
 
            migrationBuilder.DropTable(
                name: "TaskInfoCredentialLimit");
 
            migrationBuilder.DropTable(
                name: "TaskInfoUser");
 
            migrationBuilder.DropTable(
                name: "UserInfoBankCard");
 
            migrationBuilder.DropTable(
                name: "UserInfoCredential");
 
            migrationBuilder.DropTable(
                name: "UserInfoDepartment");
 
            migrationBuilder.DropTable(
                name: "UserInfoExpectJob");
 
            migrationBuilder.DropTable(
                name: "UserInfoPhoto");
 
            migrationBuilder.DropTable(
                name: "UserInfoRole");
 
            migrationBuilder.DropTable(
                name: "Menu");
 
            migrationBuilder.DropTable(
                name: "TaskInfo");
 
            migrationBuilder.DropTable(
                name: "Department");
 
            migrationBuilder.DropTable(
                name: "Role");
 
            migrationBuilder.DropTable(
                name: "UserInfo");
 
            migrationBuilder.DropTable(
                name: "DictionaryData");
 
            migrationBuilder.DropTable(
                name: "Enterprise");
 
            migrationBuilder.DropTable(
                name: "UserAuth");
 
            migrationBuilder.DropTable(
                name: "DictionaryCategory");
 
            migrationBuilder.DropTable(
                name: "FileVirtualPath");
 
            migrationBuilder.DropTable(
                name: "FileStore");
        }
    }
}