-
Notifications
You must be signed in to change notification settings - Fork 0
/
crebas.sql
1714 lines (1485 loc) · 52.5 KB
/
crebas.sql
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
/*==============================================================*/
/* DBMS name: Microsoft SQL Server 2008 */
/* Created on: 2015/10/17 17:07:37 */
/*==============================================================*/
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('dbo.Tab_EexpertCert') and o.name = 'FK_TAB_EEXP_REFERENCE_TAB_USER')
alter table dbo.Tab_EexpertCert
drop constraint FK_TAB_EEXP_REFERENCE_TAB_USER
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('dbo.Tab_TrainterCert') and o.name = 'FK_TAB_TRAI_REFERENCE_TAB_USER')
alter table dbo.Tab_TrainterCert
drop constraint FK_TAB_TRAI_REFERENCE_TAB_USER
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('dbo.tab_TestItem') and o.name = 'FK_TAB_TEST_REFERENCE_TAB_USER')
alter table dbo.tab_TestItem
drop constraint FK_TAB_TEST_REFERENCE_TAB_USER
go
alter table dbo.Tab_Dict
drop constraint PK_TAB_DICT
go
if exists (select 1
from sysobjects
where id = object_id('dbo.Tab_Dict')
and type = 'U')
drop table dbo.Tab_Dict
go
alter table dbo.Tab_EexpertCert
drop constraint PK_TAB_EEXPERTCERT
go
if exists (select 1
from sysobjects
where id = object_id('dbo.Tab_EexpertCert')
and type = 'U')
drop table dbo.Tab_EexpertCert
go
alter table dbo.Tab_ExpertCertTemp1
drop constraint PK_TAB_EXPERTCERTTEMP1
go
if exists (select 1
from sysobjects
where id = object_id('dbo.Tab_ExpertCertTemp1')
and type = 'U')
drop table dbo.Tab_ExpertCertTemp1
go
alter table dbo.Tab_TrainterCert
drop constraint PK_TAB_TRAINTERCERT
go
if exists (select 1
from sysobjects
where id = object_id('dbo.Tab_TrainterCert')
and type = 'U')
drop table dbo.Tab_TrainterCert
go
alter table dbo.Tab_User
drop constraint PK_TAB_USER
go
if exists (select 1
from sysobjects
where id = object_id('dbo.Tab_User')
and type = 'U')
drop table dbo.Tab_User
go
alter table dbo.tab_InfoRight
drop constraint PK_TAB_INFORIGHT
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_InfoRight')
and type = 'U')
drop table dbo.tab_InfoRight
go
alter table dbo.tab_ResourceFile
drop constraint PK_TAB_RESOURCEFILE
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_ResourceFile')
and type = 'U')
drop table dbo.tab_ResourceFile
go
alter table dbo.tab_SeedLibrary
drop constraint PK_TAB_SEEDLIBRARY
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_SeedLibrary')
and type = 'U')
drop table dbo.tab_SeedLibrary
go
alter table dbo.tab_TestItem
drop constraint PK_TAB_TESTITEM
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_TestItem')
and type = 'U')
drop table dbo.tab_TestItem
go
alter table dbo.tab_TrainerCertTemp
drop constraint PK_TAB_TRAINERCERTTEMP
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_TrainerCertTemp')
and type = 'U')
drop table dbo.tab_TrainerCertTemp
go
alter table dbo.tab_consult
drop constraint PK_TAB_CONSULT
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_consult')
and type = 'U')
drop table dbo.tab_consult
go
alter table dbo.tab_expression
drop constraint PK_TAB_EXPRESSION
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_expression')
and type = 'U')
drop table dbo.tab_expression
go
alter table dbo.tab_order_TrainExpert
drop constraint PK_TAB_ORDER_TRAINEXPERT
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_order_TrainExpert')
and type = 'U')
drop table dbo.tab_order_TrainExpert
go
alter table dbo.tab_result
drop constraint PK_TAB_RESULT
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_result')
and type = 'U')
drop table dbo.tab_result
go
alter table dbo.tab_user_expert
drop constraint PK_TAB_USER_EXPERT
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_user_expert')
and type = 'U')
drop table dbo.tab_user_expert
go
alter table dbo.tab_user_trainer
drop constraint PK_TAB_USER_TRAINER
go
if exists (select 1
from sysobjects
where id = object_id('dbo.tab_user_trainer')
and type = 'U')
drop table dbo.tab_user_trainer
go
/*==============================================================*/
/* Table: Tab_Dict */
/*==============================================================*/
create table Tab_Dict (
ID int identity,
Type int null,
Code varchar(200) null,
Parent int null,
Name varchar(300) null,
Mark varchar(300) null,
Sort int null,
constraint PK_TAB_DICT primary key (ID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'基础字典表',
'user', @CurrentUser, 'table', 'Tab_Dict'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'主键ID',
'user', @CurrentUser, 'table', 'Tab_Dict', 'column', 'ID'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'类型',
'user', @CurrentUser, 'table', 'Tab_Dict', 'column', 'Type'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'编码',
'user', @CurrentUser, 'table', 'Tab_Dict', 'column', 'Code'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'父级',
'user', @CurrentUser, 'table', 'Tab_Dict', 'column', 'Parent'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'名称',
'user', @CurrentUser, 'table', 'Tab_Dict', 'column', 'Name'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'备注',
'user', @CurrentUser, 'table', 'Tab_Dict', 'column', 'Mark'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'排序',
'user', @CurrentUser, 'table', 'Tab_Dict', 'column', 'Sort'
go
/*==============================================================*/
/* Table: Tab_EexpertCert */
/*==============================================================*/
create table Tab_EexpertCert (
Id int not null,
UserId int null,
AcceptState int null,
AcceptUserId int null,
AcceptTime datetime null,
AcceptMessage varchar(1000) null,
ExpertSort int null,
IDNumber varchar(50) null,
School varchar(200) null,
Education varchar(200) null,
Qualification varchar(300) null,
zyProject varchar(200) null,
yjProject varchar(300) null,
yjResult varchar(300) null,
ServiceArea varchar(200) null,
SelfResume varchar(1000) null,
constraint PK_TAB_EEXPERTCERT primary key (Id)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'专家认证表',
'user', @CurrentUser, 'table', 'Tab_EexpertCert'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'Id',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'Id'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户ID',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'UserId'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证状态',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'AcceptState'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证操作员',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'AcceptUserId'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证时间',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'AcceptTime'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证理由说明',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'AcceptMessage'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'专家分类',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'ExpertSort'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'身份证号',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'IDNumber'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'毕业学校',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'School'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'学历',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'Education'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'资质',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'Qualification'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'专业领域',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'zyProject'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'研究方向',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'yjProject'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'研究成果',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'yjResult'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'服务地区',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'ServiceArea'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'个人简历',
'user', @CurrentUser, 'table', 'Tab_EexpertCert', 'column', 'SelfResume'
go
/*==============================================================*/
/* Index: index_un_tab_expertcert_userid */
/*==============================================================*/
create unique index index_un_tab_expertcert_userid on Tab_EexpertCert (
UserId ASC
)
go
/*==============================================================*/
/* Table: Tab_ExpertCertTemp1 */
/*==============================================================*/
create table Tab_ExpertCertTemp1 (
Id int identity,
UserId int null,
AcceptState int null,
AcceptUserId int null,
AcceptTime datetime null,
AcceptMessage varchar(1000) null,
ExpertSort int null,
IDNumber varchar(50) null,
School varchar(200) null,
Education varchar(200) null,
Qualification varchar(300) null,
zyProject varchar(200) null,
yjProject varchar(300) null,
yjResult varchar(300) null,
ServiceArea varchar(200) null,
SelfResume varchar(1000) null,
constraint PK_TAB_EXPERTCERTTEMP1 primary key (Id)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'专家认证信息修改临时表',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'Id',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'Id'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户ID',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'UserId'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证状态',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'AcceptState'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证操作员',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'AcceptUserId'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证时间',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'AcceptTime'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证理由说明',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'AcceptMessage'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'专家分类',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'ExpertSort'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'身份证号',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'IDNumber'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'毕业学校',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'School'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'学历',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'Education'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'资质',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'Qualification'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'专业领域',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'zyProject'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'研究方向',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'yjProject'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'研究成果',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'yjResult'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'服务地区',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'ServiceArea'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'个人简历',
'user', @CurrentUser, 'table', 'Tab_ExpertCertTemp1', 'column', 'SelfResume'
go
/*==============================================================*/
/* Index: index_un_tab_expertcert_userid */
/*==============================================================*/
create unique index index_un_tab_expertcert_userid on Tab_ExpertCertTemp1 (
UserId ASC
)
go
/*==============================================================*/
/* Table: Tab_TrainterCert */
/*==============================================================*/
create table Tab_TrainterCert (
Id int not null,
UserId int null,
AcceptState int null,
AcceptUserId int null,
AcceptTime datetime null,
AcceptMessage varchar(1000) null,
IDNumber varchar(50) null,
School varchar(200) null,
Education varchar(200) null,
Qualification varchar(200) null,
zyProject varchar(300) null,
ksProject varchar(300) null,
ServiceArea varchar(200) null,
SelfResume varchar(1000) null,
constraint PK_TAB_TRAINTERCERT primary key (Id)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'教练认证表',
'user', @CurrentUser, 'table', 'Tab_TrainterCert'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'Id',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'Id'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户ID',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'UserId'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证状态',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'AcceptState'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证操作员',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'AcceptUserId'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证时间',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'AcceptTime'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'认证理由说明',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'AcceptMessage'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'身份证号',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'IDNumber'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'毕业学校',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'School'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'学历',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'Education'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'资质',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'Qualification'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'职业项目',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'zyProject'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'可授项目',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'ksProject'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'服务地区',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'ServiceArea'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'个人简历',
'user', @CurrentUser, 'table', 'Tab_TrainterCert', 'column', 'SelfResume'
go
/*==============================================================*/
/* Index: index_un_tab_trainercert_userid */
/*==============================================================*/
create unique index index_un_tab_trainercert_userid on Tab_TrainterCert (
UserId ASC
)
go
/*==============================================================*/
/* Table: Tab_User */
/*==============================================================*/
create table Tab_User (
Id int identity,
Name varchar(100) not null,
PassWord varchar(64) null,
RealName varchar(100) null,
Photo varchar(100) null,
Six int null,
Type int null,
Grade int null,
Phone varchar(12) null,
WeiXin varchar(101) null,
QQ varchar(14) null,
TowCode varchar(1000) null,
Province varchar(30) null,
Area varchar(30) null,
Adress varchar(1000) null,
School varchar(300) null,
State int null,
Mark varchar(1000) null,
Token varchar(64) null,
CreateTime datetime null,
constraint PK_TAB_USER primary key (Id)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'站点用户表',
'user', @CurrentUser, 'table', 'Tab_User'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'Id',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Id'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户账号',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Name'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户密码',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'PassWord'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'真实姓名',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'RealName'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户头像',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Photo'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'性别',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Six'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户类别(用户、教练、专家)',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Type'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户等级',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Grade'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'电话',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Phone'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'微信',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'WeiXin'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'QQ',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'QQ'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'二维码',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'TowCode'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'所属省',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Province'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'区域',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Area'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'地址',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Adress'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'学校名称',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'School'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'状态',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'State'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'备注',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Mark'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'建权码',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'Token'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'注册时间',
'user', @CurrentUser, 'table', 'Tab_User', 'column', 'CreateTime'
go
/*==============================================================*/
/* Index: Index_tab_user_un_name */
/*==============================================================*/
create unique index Index_tab_user_un_name on Tab_User (
Name ASC
)
go
/*==============================================================*/
/* Table: tab_InfoRight */
/*==============================================================*/
create table tab_InfoRight (
RightUId int not null,
CoverRightUId int not null,
RightType int not null,
RightState int null,
RightTime datetime null,
constraint PK_TAB_INFORIGHT primary key (RightUId, CoverRightUId, RightType)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户数据授权表',
'user', @CurrentUser, 'table', 'tab_InfoRight'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'授权人id',
'user', @CurrentUser, 'table', 'tab_InfoRight', 'column', 'RightUId'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'被授权人id',
'user', @CurrentUser, 'table', 'tab_InfoRight', 'column', 'CoverRightUId'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'权限类型(个人数据、自测数据)',
'user', @CurrentUser, 'table', 'tab_InfoRight', 'column', 'RightType'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'权限状态',
'user', @CurrentUser, 'table', 'tab_InfoRight', 'column', 'RightState'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'授权时间',
'user', @CurrentUser, 'table', 'tab_InfoRight', 'column', 'RightTime'
go
/*==============================================================*/
/* Table: tab_ResourceFile */
/*==============================================================*/
create table tab_ResourceFile (
ID int identity,
UId int null,
ResourceName varchar(500) null,
ResourceType varchar(1000) null,
ResourceState int null,
ResourceTime datetime null,
constraint PK_TAB_RESOURCEFILE primary key (ID)
)
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'用户资源文件表',
'user', @CurrentUser, 'table', 'tab_ResourceFile'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'主键ID',
'user', @CurrentUser, 'table', 'tab_ResourceFile', 'column', 'ID'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'关联用户ID',
'user', @CurrentUser, 'table', 'tab_ResourceFile', 'column', 'UId'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'资源文件名称',
'user', @CurrentUser, 'table', 'tab_ResourceFile', 'column', 'ResourceName'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'资源文件地址',
'user', @CurrentUser, 'table', 'tab_ResourceFile', 'column', 'ResourceType'
go
declare @CurrentUser sysname
select @CurrentUser = user_name()