-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpvo_v1_2023 20230418 2346.sql
916 lines (814 loc) · 25.8 KB
/
pvo_v1_2023 20230418 2346.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
--
-- Script was generated by Devart dbForge Studio 2019 for MySQL, Version 8.2.23.0
-- Product home page: http://www.devart.com/dbforge/mysql/studio
-- Script date 18-Apr-23 11:46:32 PM
-- Server version: 5.5.5-10.1.41-MariaDB
-- Client version: 4.1
--
--
-- Disable foreign keys
--
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
--
-- Set SQL mode
--
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
--
-- Set character set the client will use to send SQL statements to the server
--
SET NAMES 'utf8mb4';
--
-- Set default database
--
USE pvo_v1_2023;
--
-- Drop table `dialect`
--
DROP TABLE IF EXISTS dialect;
--
-- Drop table `sys_dialect`
--
DROP TABLE IF EXISTS sys_dialect;
--
-- Drop table `mode`
--
DROP TABLE IF EXISTS mode;
--
-- Drop table `sys_mode`
--
DROP TABLE IF EXISTS sys_mode;
--
-- Drop table `nuance`
--
DROP TABLE IF EXISTS nuance;
--
-- Drop table `sys_nuance`
--
DROP TABLE IF EXISTS sys_nuance;
--
-- Drop table `register`
--
DROP TABLE IF EXISTS register;
--
-- Drop table `sys_register`
--
DROP TABLE IF EXISTS sys_register;
--
-- Drop table `tone`
--
DROP TABLE IF EXISTS tone;
--
-- Drop table `sys_tone`
--
DROP TABLE IF EXISTS sys_tone;
--
-- Drop table `concept_relationship`
--
DROP TABLE IF EXISTS concept_relationship;
--
-- Drop table `concept_link`
--
DROP TABLE IF EXISTS concept_link;
--
-- Drop table `sys_concept_link`
--
DROP TABLE IF EXISTS sys_concept_link;
--
-- Drop table `example_relationship`
--
DROP TABLE IF EXISTS example_relationship;
--
-- Drop table `example_link`
--
DROP TABLE IF EXISTS example_link;
--
-- Drop table `sys_example_link`
--
DROP TABLE IF EXISTS sys_example_link;
--
-- Drop table `audit_log`
--
DROP TABLE IF EXISTS audit_log;
--
-- Drop table `concept`
--
DROP TABLE IF EXISTS concept;
--
-- Drop table `example`
--
DROP TABLE IF EXISTS example;
--
-- Drop table `dictionary`
--
DROP TABLE IF EXISTS dictionary;
--
-- Drop table `user_setting`
--
DROP TABLE IF EXISTS user_setting;
--
-- Drop table `user`
--
DROP TABLE IF EXISTS user;
--
-- Set default database
--
USE pvo_v1_2023;
--
-- Create table `user`
--
CREATE TABLE user (
user_id char(36) NOT NULL COMMENT 'id khóa chính',
user_name varchar(100) DEFAULT NULL COMMENT 'Tên đăng nhập',
password char(60) DEFAULT NULL COMMENT 'Mã hash mật khẩu',
email varchar(50) DEFAULT NULL,
full_name varchar(255) DEFAULT NULL COMMENT 'Tên đầy đủ',
display_name varchar(100) DEFAULT NULL COMMENT 'Tên hiển thị',
birthday datetime DEFAULT NULL COMMENT 'Ngày sinh',
`position` varchar(255) DEFAULT NULL COMMENT 'Công việc',
avatar text DEFAULT NULL COMMENT 'Link ảnh đại diện',
status int(11) DEFAULT NULL COMMENT 'Trạng thái tài khoản',
created_at datetime DEFAULT NULL,
modified_at datetime DEFAULT NULL,
PRIMARY KEY (user_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa thông tin người dùng';
--
-- Create index `email` on table `user`
--
ALTER TABLE user
ADD UNIQUE INDEX email (email);
--
-- Create index `user_name` on table `user`
--
ALTER TABLE user
ADD UNIQUE INDEX user_name (user_name);
--
-- Create table `user_setting`
--
CREATE TABLE user_setting (
user_setting_id char(36) NOT NULL COMMENT 'id khóa chính',
user_id char(36) DEFAULT NULL COMMENT 'id người dùng',
setting_key varchar(255) DEFAULT NULL COMMENT 'key',
setting_value varchar(255) DEFAULT NULL COMMENT 'value',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (user_setting_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa thông tin cấu hình của người dùng';
--
-- Create foreign key
--
ALTER TABLE user_setting
ADD CONSTRAINT FK_user_setting_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Create table `dictionary`
--
CREATE TABLE dictionary (
dictionary_id char(36) NOT NULL COMMENT 'id khóa chính',
user_id char(36) DEFAULT NULL COMMENT 'id người dùng (tham chiếu bảng user)',
dictionary_name varchar(255) DEFAULT NULL COMMENT 'Tên dictionary',
last_view_at datetime DEFAULT NULL COMMENT 'Thời điểm truy cập gần nhất',
created_at datetime DEFAULT NULL,
modified_at datetime DEFAULT NULL,
PRIMARY KEY (dictionary_id)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 8192,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa thông tin dictionary';
--
-- Create foreign key
--
ALTER TABLE dictionary
ADD CONSTRAINT FK_dictionary_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Create table `example`
--
CREATE TABLE example (
example_id char(36) NOT NULL,
dictionary_id char(36) DEFAULT NULL,
detail text DEFAULT NULL,
detail_html text DEFAULT NULL,
note varchar(255) DEFAULT NULL,
tone_id char(36) DEFAULT NULL,
register_id char(36) DEFAULT NULL,
dialect_id char(36) DEFAULT NULL,
mode_id char(36) DEFAULT NULL,
nuance_id char(36) DEFAULT NULL,
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (example_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa thông tin example';
--
-- Create foreign key
--
ALTER TABLE example
ADD CONSTRAINT FK_example_dictionary_id FOREIGN KEY (dictionary_id)
REFERENCES dictionary (dictionary_id) ON DELETE CASCADE;
--
-- Create table `concept`
--
CREATE TABLE concept (
concept_id char(36) NOT NULL COMMENT 'id khóa chính',
dictionary_id char(36) DEFAULT NULL COMMENT 'id dictionary (tham chiếu bảng dictionary)',
title varchar(255) DEFAULT NULL COMMENT 'Tên concept',
description varchar(500) DEFAULT NULL COMMENT 'Mô tả concept',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (concept_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa thông tin concept';
--
-- Create foreign key
--
ALTER TABLE concept
ADD CONSTRAINT FK_concept_dictionary_id FOREIGN KEY (dictionary_id)
REFERENCES dictionary (dictionary_id) ON DELETE CASCADE;
--
-- Create table `audit_log`
--
CREATE TABLE audit_log (
audit_log_id int(11) NOT NULL AUTO_INCREMENT COMMENT 'id khóa chính',
user_id char(36) DEFAULT NULL COMMENT 'id người dùng',
screen_info varchar(255) DEFAULT NULL COMMENT 'Thông tin màn hình',
action_type int(11) DEFAULT NULL COMMENT 'Loại hành động',
reference varchar(255) DEFAULT NULL COMMENT 'Thông tin tham chiếu, vd: id dictionary',
description varchar(500) DEFAULT NULL COMMENT 'Mô tả',
user_agent varchar(255) DEFAULT NULL,
created_date datetime DEFAULT NULL,
PRIMARY KEY (audit_log_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa thông tin lịch sử truy cập';
--
-- Create foreign key
--
ALTER TABLE audit_log
ADD CONSTRAINT FK_audit_log_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Create table `sys_example_link`
--
CREATE TABLE sys_example_link (
sys_example_link_id char(36) NOT NULL COMMENT 'id khóa chính',
example_link_name varchar(255) DEFAULT NULL COMMENT 'Tên loại liên kết',
example_link_type int(11) DEFAULT NULL COMMENT 'Loại liên kết',
sort_order int(11) DEFAULT NULL COMMENT 'Thứ tự sắp xếp',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (sys_example_link_id)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 1820,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng sys loại liên kết giữa example với concept';
--
-- Create table `example_link`
--
CREATE TABLE example_link (
example_link_id char(36) NOT NULL COMMENT 'id khóa chính',
sys_example_link_id char(36) DEFAULT NULL COMMENT 'sys id',
user_id char(36) DEFAULT NULL COMMENT 'id người dùng',
example_link_name varchar(255) DEFAULT NULL COMMENT 'tên loại liên kết',
example_link_type int(11) DEFAULT NULL COMMENT 'loại liên kết',
sort_order int(11) DEFAULT NULL COMMENT 'thứ tự sắp xếp',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (example_link_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa thông tin loại liên kết example-content';
--
-- Create foreign key
--
ALTER TABLE example_link
ADD CONSTRAINT FK_example_link_sys_example_link_id FOREIGN KEY (sys_example_link_id)
REFERENCES sys_example_link (sys_example_link_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE example_link
ADD CONSTRAINT FK_example_link_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Create table `example_relationship`
--
CREATE TABLE example_relationship (
example_relationship_id int(11) NOT NULL AUTO_INCREMENT COMMENT 'id khóa chính',
dictionary_id char(36) DEFAULT NULL COMMENT 'id dictionary',
content_id char(36) DEFAULT NULL,
example_id char(36) DEFAULT NULL,
example_link_id char(36) DEFAULT NULL,
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (example_relationship_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa liên kết example-content';
--
-- Create foreign key
--
ALTER TABLE example_relationship
ADD CONSTRAINT FK_example_relationship_content_id FOREIGN KEY (content_id)
REFERENCES concept (concept_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE example_relationship
ADD CONSTRAINT FK_example_relationship_dictionary_id FOREIGN KEY (dictionary_id)
REFERENCES dictionary (dictionary_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE example_relationship
ADD CONSTRAINT FK_example_relationship_example_id FOREIGN KEY (example_id)
REFERENCES example (example_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE example_relationship
ADD CONSTRAINT FK_example_relationship_example_link_id FOREIGN KEY (example_link_id)
REFERENCES example_link (example_link_id) ON DELETE CASCADE;
--
-- Create table `sys_concept_link`
--
CREATE TABLE sys_concept_link (
sys_concept_link_id char(36) NOT NULL COMMENT 'id khóa chính',
concept_link_name varchar(255) DEFAULT NULL COMMENT 'Tên loại liên kết',
concept_link_type int(11) DEFAULT NULL COMMENT 'Loại liên kết',
sort_order int(11) DEFAULT NULL COMMENT 'Thứ tự sắp xếp',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (sys_concept_link_id)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 5461,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng sys loại liên kết giữa concept với concept';
--
-- Create table `concept_link`
--
CREATE TABLE concept_link (
concept_link_id char(36) NOT NULL COMMENT 'id khóa chính',
sys_concept_link_id char(36) DEFAULT NULL COMMENT 'id bảng sys',
user_id char(36) DEFAULT NULL COMMENT 'id người dùng',
concept_link_name varchar(255) DEFAULT NULL COMMENT 'Tên loại liên kết',
concept_link_type int(11) DEFAULT NULL COMMENT 'Loại liên kết',
sort_order int(11) DEFAULT NULL COMMENT 'Thứ tự sắp xếp',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (concept_link_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa thông tin loại liên kết concept-concept';
--
-- Create foreign key
--
ALTER TABLE concept_link
ADD CONSTRAINT FK_concept_link_sys_concept_link_id FOREIGN KEY (sys_concept_link_id)
REFERENCES sys_concept_link (sys_concept_link_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE concept_link
ADD CONSTRAINT FK_concept_link_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Create table `concept_relationship`
--
CREATE TABLE concept_relationship (
concept_relationship_id int(11) NOT NULL AUTO_INCREMENT COMMENT 'id khóa chính',
dictionary_id char(36) DEFAULT NULL COMMENT 'id dictionảy',
concept_id char(36) DEFAULT NULL COMMENT 'id concept',
parent_id char(36) DEFAULT NULL COMMENT 'id concept cha',
concept_link_id char(36) DEFAULT NULL COMMENT 'id loại liên kết concept-concept',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (concept_relationship_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng chứa liên kết concept-concept';
--
-- Create foreign key
--
ALTER TABLE concept_relationship
ADD CONSTRAINT FK_concept_relationship_concept_id FOREIGN KEY (concept_id)
REFERENCES concept (concept_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE concept_relationship
ADD CONSTRAINT FK_concept_relationship_concept_link_id FOREIGN KEY (concept_link_id)
REFERENCES concept_link (concept_link_id) ON DELETE NO ACTION;
--
-- Create foreign key
--
ALTER TABLE concept_relationship
ADD CONSTRAINT FK_concept_relationship_dictionary_id FOREIGN KEY (dictionary_id)
REFERENCES dictionary (dictionary_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE concept_relationship
ADD CONSTRAINT FK_concept_relationship_parent_id FOREIGN KEY (parent_id)
REFERENCES concept (concept_id) ON DELETE CASCADE;
--
-- Create table `sys_tone`
--
CREATE TABLE sys_tone (
sys_tone_id char(36) NOT NULL COMMENT 'id khóa chính',
tone_name varchar(255) DEFAULT NULL COMMENT 'Tên tone',
tone_type int(11) DEFAULT NULL COMMENT 'Loại tone',
sort_order int(11) DEFAULT NULL COMMENT 'Thứ tự sắp xếp',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (sys_tone_id)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 3276,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng sys loại tone';
--
-- Create table `tone`
--
CREATE TABLE tone (
tone_id char(36) NOT NULL,
sys_tone_id char(36) DEFAULT NULL,
user_id char(36) DEFAULT NULL,
tone_name varchar(255) DEFAULT NULL,
tone_type int(11) DEFAULT NULL,
sort_order int(11) DEFAULT NULL,
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (tone_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng danh sách tone';
--
-- Create foreign key
--
ALTER TABLE tone
ADD CONSTRAINT FK_tone_sys_tone_id FOREIGN KEY (sys_tone_id)
REFERENCES sys_tone (sys_tone_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE tone
ADD CONSTRAINT FK_tone_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Create table `sys_register`
--
CREATE TABLE sys_register (
sys_register_id char(36) NOT NULL COMMENT 'id khóa chính',
register_name varchar(255) DEFAULT NULL COMMENT 'Tên register',
register_type varchar(255) DEFAULT NULL COMMENT 'Loại register',
sort_order int(11) DEFAULT NULL COMMENT 'Thứ tự sắp xếp',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (sys_register_id)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 1820,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng sys loại register';
--
-- Create table `register`
--
CREATE TABLE register (
register_id char(36) NOT NULL,
sys_register_id char(36) DEFAULT NULL,
user_id char(36) DEFAULT NULL,
register_name varchar(255) DEFAULT NULL,
register_type int(11) DEFAULT NULL,
sort_order int(11) DEFAULT NULL,
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (register_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng danh sách register';
--
-- Create foreign key
--
ALTER TABLE register
ADD CONSTRAINT FK_register_sys_register_id FOREIGN KEY (sys_register_id)
REFERENCES sys_register (sys_register_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE register
ADD CONSTRAINT FK_register_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Create table `sys_nuance`
--
CREATE TABLE sys_nuance (
sys_nuance_id char(36) NOT NULL COMMENT 'id khóa chính',
nuance_name varchar(255) DEFAULT NULL COMMENT 'Tên nuance',
nuance_type int(11) DEFAULT NULL COMMENT 'Loại nuance',
sort_order int(11) DEFAULT NULL COMMENT 'Thứ tự sắp xếp',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (sys_nuance_id)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 3276,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng sys loại nuance';
--
-- Create table `nuance`
--
CREATE TABLE nuance (
nuance_id char(36) NOT NULL,
sys_nuance_id char(36) DEFAULT NULL,
user_id char(36) DEFAULT NULL,
nuance_name varchar(255) DEFAULT NULL,
nuance_type int(11) DEFAULT NULL,
sort_order int(11) DEFAULT NULL,
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (nuance_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng danh sách nuance';
--
-- Create foreign key
--
ALTER TABLE nuance
ADD CONSTRAINT FK_nuance_sys_nuance_id FOREIGN KEY (sys_nuance_id)
REFERENCES sys_nuance (sys_nuance_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE nuance
ADD CONSTRAINT FK_nuance_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Create table `sys_mode`
--
CREATE TABLE sys_mode (
sys_mode_id char(36) NOT NULL COMMENT 'id khóa chính',
mode_name varchar(255) DEFAULT NULL COMMENT 'Tên mode',
mode_type int(11) DEFAULT NULL COMMENT 'Loại mode',
sort_order int(11) DEFAULT NULL COMMENT 'Thứ tự sắp xếp',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (sys_mode_id)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 5461,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng sys loại mode';
--
-- Create table `mode`
--
CREATE TABLE mode (
mode_id char(36) NOT NULL,
sys_mode_id char(36) DEFAULT NULL,
user_id char(36) DEFAULT NULL,
mode_name varchar(255) DEFAULT NULL,
mode_type int(11) DEFAULT NULL,
sort_order int(11) DEFAULT NULL,
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (mode_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng danh sách mode';
--
-- Create foreign key
--
ALTER TABLE mode
ADD CONSTRAINT FK_mode_sys_mode_id FOREIGN KEY (sys_mode_id)
REFERENCES sys_mode (sys_mode_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE mode
ADD CONSTRAINT FK_mode_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Create table `sys_dialect`
--
CREATE TABLE sys_dialect (
sys_dialect_id char(36) NOT NULL COMMENT 'id khóa chính',
dialect_name varchar(255) DEFAULT NULL COMMENT 'Tên dialect',
dialect_type int(11) DEFAULT NULL COMMENT 'Loại dialect',
sort_order int(11) DEFAULT NULL COMMENT 'Thứ tự sắp xếp',
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (sys_dialect_id)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 4096,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng sys loại dialect';
--
-- Create table `dialect`
--
CREATE TABLE dialect (
dialect_id char(36) NOT NULL,
sys_dialect_id char(36) DEFAULT NULL,
user_id char(36) DEFAULT NULL,
dialect_name varchar(255) DEFAULT NULL,
dialect_type int(11) DEFAULT NULL,
sort_order int(11) DEFAULT NULL,
created_date datetime DEFAULT NULL,
modified_date datetime DEFAULT NULL,
PRIMARY KEY (dialect_id)
)
ENGINE = INNODB,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci,
COMMENT = 'Bảng danh sách dialect';
--
-- Create foreign key
--
ALTER TABLE dialect
ADD CONSTRAINT FK_dialect_sys_dialect_id FOREIGN KEY (sys_dialect_id)
REFERENCES sys_dialect (sys_dialect_id) ON DELETE CASCADE;
--
-- Create foreign key
--
ALTER TABLE dialect
ADD CONSTRAINT FK_dialect_user_id FOREIGN KEY (user_id)
REFERENCES user (user_id) ON DELETE CASCADE;
--
-- Dumping data for table user
--
INSERT INTO user VALUES
('b0da65f9-dc39-11ed-a1e6-a44cc8756a37', 'hieu.pt183535@gmail.com', '$2a$12$lMbB2V36P50Y7iYgPcTgUOvboP3MyTmIaFslYdxlrEzdzJUiE/2zu', 'hieu.pt183535@gmail.com', NULL, NULL, NULL, NULL, NULL, 1, '2023-04-16 16:32:34', NULL);
--
-- Dumping data for table sys_example_link
--
INSERT INTO sys_example_link VALUES
('2d1bbd1d-dbfd-11ed-a1e6-a44cc8756a37', 'No link', 1, 1, '2023-04-16 09:19:32', NULL),
('2d1bc576-dbfd-11ed-a1e6-a44cc8756a37', 'Idiom', 2, 2, '2023-04-16 09:19:32', NULL),
('2d1bc640-dbfd-11ed-a1e6-a44cc8756a37', 'Nominal', 3, 3, '2023-04-16 09:19:32', NULL),
('2d1bc69a-dbfd-11ed-a1e6-a44cc8756a37', 'Agent', 4, 4, '2023-04-16 09:19:32', NULL),
('2d1bc6d7-dbfd-11ed-a1e6-a44cc8756a37', 'Patient', 5, 5, '2023-04-16 09:19:32', NULL),
('2d1bc70f-dbfd-11ed-a1e6-a44cc8756a37', 'Action', 6, 6, '2023-04-16 09:19:32', NULL),
('2d1bc745-dbfd-11ed-a1e6-a44cc8756a37', 'Described by', 7, 7, '2023-04-16 09:19:32', NULL),
('2d1bc783-dbfd-11ed-a1e6-a44cc8756a37', 'Describing', 8, 8, '2023-04-16 09:19:32', NULL),
('2d1bc88c-dbfd-11ed-a1e6-a44cc8756a37', 'Other phrase', 9, 9, '2023-04-16 09:19:32', NULL);
--
-- Dumping data for table dictionary
--
INSERT INTO dictionary VALUES
('275ee362-dc3f-11ed-a1e6-a44cc8756a37', 'b0da65f9-dc39-11ed-a1e6-a44cc8756a37', 'My PVO', '2023-04-16 17:11:41', '2023-04-16 17:11:41', NULL),
('2dffd988-dc3f-11ed-a1e6-a44cc8756a37', 'b0da65f9-dc39-11ed-a1e6-a44cc8756a37', 'My PVO 2', '2023-04-16 17:11:52', '2023-04-16 17:11:52', NULL);
--
-- Dumping data for table sys_concept_link
--
INSERT INTO sys_concept_link VALUES
('a84e3892-dbfc-11ed-a1e6-a44cc8756a37', 'No link', 1, 1, '2023-04-16 09:15:50', NULL),
('a84e6654-dbfc-11ed-a1e6-a44cc8756a37', 'Association', 2, 2, '2023-04-16 09:15:50', NULL),
('a84e6885-dbfc-11ed-a1e6-a44cc8756a37', 'Type of', 3, 3, '2023-04-16 09:15:50', NULL);
--
-- Dumping data for table sys_tone
--
INSERT INTO sys_tone VALUES
('53f4ef4e-dbfd-11ed-a1e6-a44cc8756a37', 'Neutral', 1, 1, '2023-04-16 09:20:38', NULL),
('53f4f6a1-dbfd-11ed-a1e6-a44cc8756a37', 'Informal', 2, 2, '2023-04-16 09:20:38', NULL),
('53f4f751-dbfd-11ed-a1e6-a44cc8756a37', 'Formal', 3, 3, '2023-04-16 09:20:38', NULL),
('53f4f77f-dbfd-11ed-a1e6-a44cc8756a37', 'Slightly informal', 4, 4, '2023-04-16 09:20:38', NULL),
('53f4f7b3-dbfd-11ed-a1e6-a44cc8756a37', 'Slightly formal', 5, 5, '2023-04-16 09:20:38', NULL);
--
-- Dumping data for table sys_register
--
INSERT INTO sys_register VALUES
('aafb738e-dbfd-11ed-a1e6-a44cc8756a37', 'Neutral', '1', 1, '2023-04-16 09:23:04', NULL),
('aafb845c-dbfd-11ed-a1e6-a44cc8756a37', 'Academic', '2', 2, '2023-04-16 09:23:04', NULL),
('aafb862d-dbfd-11ed-a1e6-a44cc8756a37', 'Literature', '3', 3, '2023-04-16 09:23:04', NULL),
('aafb86cd-dbfd-11ed-a1e6-a44cc8756a37', 'Business', '4', 4, '2023-04-16 09:23:04', NULL),
('aafb8745-dbfd-11ed-a1e6-a44cc8756a37', 'Law', '5', 5, '2023-04-16 09:23:04', NULL),
('aafb87b8-dbfd-11ed-a1e6-a44cc8756a37', 'Journalism', '6', 6, '2023-04-16 09:23:04', NULL),
('aafb8832-dbfd-11ed-a1e6-a44cc8756a37', 'Medicine', '7', 7, '2023-04-16 09:23:04', NULL),
('aafb88dd-dbfd-11ed-a1e6-a44cc8756a37', 'IT', '8', 8, '2023-04-16 09:23:04', NULL),
('aafb896f-dbfd-11ed-a1e6-a44cc8756a37', 'Other', '9', 9, '2023-04-16 09:23:04', NULL);
--
-- Dumping data for table sys_nuance
--
INSERT INTO sys_nuance VALUES
('c59eaacb-dbfd-11ed-a1e6-a44cc8756a37', 'Neutral', 1, 1, '2023-04-16 09:23:48', NULL),
('c59eb46d-dbfd-11ed-a1e6-a44cc8756a37', 'Old fashioned', 2, 2, '2023-04-16 09:23:48', NULL),
('c59eb542-dbfd-11ed-a1e6-a44cc8756a37', 'Humorous', 3, 3, '2023-04-16 09:23:48', NULL),
('c59eb58d-dbfd-11ed-a1e6-a44cc8756a37', 'Oft positive', 4, 4, '2023-04-16 09:23:48', NULL),
('c59eb5be-dbfd-11ed-a1e6-a44cc8756a37', 'Oft negative', 5, 5, '2023-04-16 09:23:48', NULL);
--
-- Dumping data for table sys_mode
--
INSERT INTO sys_mode VALUES
('6799339c-dbfd-11ed-a1e6-a44cc8756a37', 'Neutral', 1, 1, '2023-04-16 09:21:11', NULL),
('67993cef-dbfd-11ed-a1e6-a44cc8756a37', 'Spoken', 2, 2, '2023-04-16 09:21:11', NULL),
('67993dd2-dbfd-11ed-a1e6-a44cc8756a37', 'Written', 3, 3, '2023-04-16 09:21:11', NULL);
--
-- Dumping data for table example_link
--
-- Table pvo_v1_2023.example_link does not contain any data (it is empty)
--
-- Dumping data for table example
--
-- Table pvo_v1_2023.example does not contain any data (it is empty)
--
-- Dumping data for table sys_dialect
--
INSERT INTO sys_dialect VALUES
('d9016880-dbfd-11ed-a1e6-a44cc8756a37', 'Neutral', 1, 1, '2023-04-16 09:24:21', NULL),
('d901737b-dbfd-11ed-a1e6-a44cc8756a37', 'American', 2, 2, '2023-04-16 09:24:21', NULL),
('d9017459-dbfd-11ed-a1e6-a44cc8756a37', 'British', 3, 3, '2023-04-16 09:24:21', NULL),
('d90174af-dbfd-11ed-a1e6-a44cc8756a37', 'Other', 4, 4, '2023-04-16 09:24:21', NULL);
--
-- Dumping data for table concept_link
--
-- Table pvo_v1_2023.concept_link does not contain any data (it is empty)
--
-- Dumping data for table concept
--
-- Table pvo_v1_2023.concept does not contain any data (it is empty)
--
-- Dumping data for table user_setting
--
-- Table pvo_v1_2023.user_setting does not contain any data (it is empty)
--
-- Dumping data for table tone
--
-- Table pvo_v1_2023.tone does not contain any data (it is empty)
--
-- Dumping data for table register
--
-- Table pvo_v1_2023.register does not contain any data (it is empty)
--
-- Dumping data for table nuance
--
-- Table pvo_v1_2023.nuance does not contain any data (it is empty)
--
-- Dumping data for table mode
--
-- Table pvo_v1_2023.mode does not contain any data (it is empty)
--
-- Dumping data for table example_relationship
--
-- Table pvo_v1_2023.example_relationship does not contain any data (it is empty)
--
-- Dumping data for table dialect
--
-- Table pvo_v1_2023.dialect does not contain any data (it is empty)
--
-- Dumping data for table concept_relationship
--
-- Table pvo_v1_2023.concept_relationship does not contain any data (it is empty)
--
-- Dumping data for table audit_log
--
-- Table pvo_v1_2023.audit_log does not contain any data (it is empty)
--
-- Restore previous SQL mode
--
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
--
-- Enable foreign keys
--
/*!40014 SET FOREIGN_KEY_CHECKS = @OLD_FOREIGN_KEY_CHECKS */;