-
Notifications
You must be signed in to change notification settings - Fork 3k
Expand file tree
/
Copy pathschema.sql
More file actions
3820 lines (3061 loc) · 312 KB
/
schema.sql
File metadata and controls
3820 lines (3061 loc) · 312 KB
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
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
create table dashboard_user
(
id VARCHAR2(128) not null,
user_name VARCHAR2(64) not null,
password VARCHAR2(128),
role NUMBER(10) not null,
enabled NUMBER(3) not null,
client_id VARCHAR2(32),
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id),
constraint unique_user_name unique (user_name)
);
-- Add comments to the columns
comment on column DASHBOARD_USER.id
is 'primary key id';
comment on column DASHBOARD_USER.user_name
is 'user name';
comment on column DASHBOARD_USER.password
is 'user password';
comment on column DASHBOARD_USER.role
is 'role';
comment on column DASHBOARD_USER.enabled
is 'delete or not';
comment on column DASHBOARD_USER.date_created
is 'create time';
comment on column DASHBOARD_USER.date_updated
is 'update time';
create table plugin
(
id VARCHAR2(128) not null,
name VARCHAR2(62) not null,
config CLOB,
role VARCHAR2(64) not null,
sort NUMBER(10),
enabled NUMBER(3) default '0' not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
plugin_jar BLOB,
PRIMARY KEY (id)
);
-- Add comments to the columns
comment on column PLUGIN.id
is 'primary key id';
comment on column PLUGIN.name
is 'plugin name';
comment on column PLUGIN.config
is 'plugin configuration';
comment on column PLUGIN.role
is 'plugin role';
comment on column PLUGIN.sort
is 'sort';
comment on column PLUGIN.enabled
is 'plugin whether to open (0 not open, 1 open)';
comment on column PLUGIN.date_created
is 'create time';
comment on column PLUGIN.date_updated
is 'update time';
comment on column PLUGIN.plugin_jar
is 'plugin jar';
create table plugin_handle
(
id VARCHAR2(128) not null,
plugin_id VARCHAR2(128) not null,
field VARCHAR2(100) not null,
label VARCHAR2(100),
data_type NUMBER(5) default '1' not null,
type NUMBER(5),
sort NUMBER(10),
ext_obj clob,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id),
constraint plugin_id_field_type unique (plugin_id,field,type)
);
-- Add comments to the columns
comment on column PLUGIN_HANDLE.plugin_id
is 'plugin id';
comment on column PLUGIN_HANDLE.field
is 'field';
comment on column PLUGIN_HANDLE.label
is 'label';
comment on column PLUGIN_HANDLE.data_type
is 'data type 1 number 2 string';
comment on column PLUGIN_HANDLE.type
is 'type, 1 means selector, 2 means rule, 3 means plugin';
comment on column PLUGIN_HANDLE.sort
is 'sort';
comment on column PLUGIN_HANDLE.ext_obj
is 'extra configuration (json format data)';
comment on column PLUGIN_HANDLE.date_created
is 'create time';
comment on column PLUGIN_HANDLE.date_updated
is 'update time';
create table selector
(
id VARCHAR2(128) not null primary key,
plugin_id VARCHAR2(128) not null,
selector_name VARCHAR2(64) not null,
match_mode NUMBER(10) not null,
selector_type NUMBER(10) not null,
sort_code NUMBER(10) not null,
handle VARCHAR2(1024),
enabled NUMBER(3) not null,
loged NUMBER(3) not null,
continued NUMBER(3) not null,
match_restful NUMBER(3) not null,
namespace_id VARCHAR2(50) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null
);
-- Add comments to the columns
comment on column SELECTOR.id
is 'primary key id varchar';
comment on column SELECTOR.plugin_id
is 'plugin id';
comment on column SELECTOR.selector_name
is 'selector name';
comment on column SELECTOR.match_mode
is 'matching mode (0 and 1 or)';
comment on column SELECTOR.selector_type
is 'type (0 full flow, 1 custom flow)';
comment on column SELECTOR.sort_code
is 'sort';
comment on column SELECTOR.handle
is 'processing logic (here for different plugins, there will be different fields to identify different processes, all data in JSON format is stored)';
comment on column SELECTOR.enabled
is 'whether to open (0 not open, 1 open)';
comment on column SELECTOR.loged
is 'whether to print the log (0 not print, 1 print)';
comment on column SELECTOR.continued
is 'whether to continue execution';
comment on column SELECTOR.match_restful
is 'whether to match restful(0 cache, 1 not cache)';
comment on column SELECTOR.namespace_id
is 'namespace id';
comment on column SELECTOR.date_created
is 'create time';
comment on column SELECTOR.date_updated
is 'update time';
create table selector_condition
(
id VARCHAR2(128) not null,
selector_id VARCHAR2(128) not null,
param_type VARCHAR2(64) not null,
operator VARCHAR2(64) not null,
param_name VARCHAR2(64) not null,
param_value VARCHAR2(64) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the columns
comment on column SELECTOR_CONDITION.id
is 'primary key id';
comment on column SELECTOR_CONDITION.selector_id
is 'selector id';
comment on column SELECTOR_CONDITION.param_type
is 'parameter type (to query uri, etc.)';
comment on column SELECTOR_CONDITION.operator
is 'matching character (=> <like matching)';
comment on column SELECTOR_CONDITION.param_name
is 'parameter name';
comment on column SELECTOR_CONDITION.param_value
is 'parameter value';
comment on column SELECTOR_CONDITION.date_created
is 'create time';
comment on column SELECTOR_CONDITION.date_updated
is 'update time';
create table rule
(
id VARCHAR2(128) not null PRIMARY KEY,
selector_id VARCHAR2(128) not null,
match_mode NUMBER(10) not null,
rule_name VARCHAR2(128) not null,
enabled NUMBER(3) not null,
loged NUMBER(3) not null,
match_restful NUMBER(3) not null,
namespace_id VARCHAR2(50) not null,
sort_code NUMBER(10) not null,
handle CLOB,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null
);
-- Add comments to the columns
comment on column RULE.id
is 'primary key id';
comment on column RULE.selector_id
is 'selector id';
comment on column RULE.match_mode
is 'matching mode (0 and 1 or)';
comment on column RULE.rule_name
is 'rule name';
comment on column RULE.enabled
is 'whether to open (0 not open, 1 open)';
comment on column RULE.loged
is 'whether to log or not (0 not print, 1 print)';
comment on column RULE.match_restful
is 'whether to match restful(0 cache, 1 not cache)';
comment on column RULE.namespace_id
is 'namespace id';
comment on column RULE.sort_code
is 'sort';
comment on column RULE.handle
is 'processing logic (here for different plug-ins, there will be different fields to identify different processes, all data in JSON format is stored)';
comment on column RULE.date_created
is 'create time';
comment on column RULE.date_updated
is 'update time';
create table rule_condition
(
id VARCHAR2(128) not null PRIMARY KEY,
rule_id VARCHAR2(128) not null,
param_type VARCHAR2(64) not null,
operator VARCHAR2(64) not null,
param_name VARCHAR2(64) not null,
param_value VARCHAR2(64) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null
);
-- Add comments to the columns
comment on column RULE_CONDITION.id
is 'primary key id';
comment on column RULE_CONDITION.rule_id
is 'rule id';
comment on column RULE_CONDITION.param_type
is 'parameter type (post query uri, etc.)';
comment on column RULE_CONDITION.operator
is 'matching character (=> <like match)';
comment on column RULE_CONDITION.param_name
is 'parameter name';
comment on column RULE_CONDITION.param_value
is 'parameter value';
comment on column RULE_CONDITION.date_created
is 'create time';
comment on column RULE_CONDITION.date_updated
is 'update time';
create table meta_data
(
id VARCHAR2(128) not null,
app_name VARCHAR2(255) not null,
path VARCHAR2(255) not null,
path_desc VARCHAR2(255),
rpc_type VARCHAR2(64) not null,
service_name VARCHAR2(255),
method_name VARCHAR2(255),
parameter_types VARCHAR2(255),
rpc_ext VARCHAR2(512),
namespace_id VARCHAR2(50) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
enabled NUMBER(3) default '0' not null,
PRIMARY KEY (id)
);
-- Add comments to the columns
comment on column META_DATA.id
is 'id';
comment on column META_DATA.app_name
is 'application name';
comment on column META_DATA.path
is 'path, cannot be repeated';
comment on column META_DATA.path_desc
is 'path description';
comment on column META_DATA.rpc_type
is 'rpc type';
comment on column META_DATA.service_name
is 'service name';
comment on column META_DATA.method_name
is 'method name';
comment on column META_DATA.parameter_types
is 'parameter types are provided with multiple parameter types separated by commas';
comment on column META_DATA.rpc_ext
is 'rpc extended information, json format';
comment on column META_DATA.namespace_id
is 'namespace id';
comment on column META_DATA.date_created
is 'create time';
comment on column META_DATA.date_updated
is 'update time';
comment on column META_DATA.enabled
is 'enabled state (0 close, 1 enabled) ';
create table mock_request_record
(
id VARCHAR2(128) not null PRIMARY KEY,
api_id VARCHAR2(128) not null,
host VARCHAR2(32) not null,
port NUMBER(5) not null,
url VARCHAR2(1024) not null,
path_variable VARCHAR2(255) default '' not null,
query VARCHAR2(1024) default '' not null,
header VARCHAR2(1024) default '' not null,
body CLOB,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null
);
-- Add comments to the table
comment on table MOCK_REQUEST_RECORD
is 'mock request records';
-- Add comments to the columns
comment on column MOCK_REQUEST_RECORD.id
is 'id';
comment on column MOCK_REQUEST_RECORD.api_id
is 'the api id';
comment on column MOCK_REQUEST_RECORD.host
is 'the request host';
comment on column MOCK_REQUEST_RECORD.port
is 'the request port';
comment on column MOCK_REQUEST_RECORD.url
is 'the request url';
comment on column MOCK_REQUEST_RECORD.path_variable
is 'the request param in url';
comment on column MOCK_REQUEST_RECORD.query
is 'the request param after url';
comment on column MOCK_REQUEST_RECORD.header
is 'the request param in header';
comment on column MOCK_REQUEST_RECORD.body
is 'the request body';
comment on column MOCK_REQUEST_RECORD.date_created
is 'create time';
comment on column MOCK_REQUEST_RECORD.date_updated
is 'update time';
-- Table structure for proxy_api_key_mapping
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE proxy_api_key_mapping';
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE != -942 THEN RAISE; END IF;
END;
/
CREATE TABLE proxy_api_key_mapping
(
id VARCHAR2(128) not null,
proxy_api_key VARCHAR2(255) not null,
description VARCHAR2(500),
enabled NUMBER(3) default 1 not null,
namespace_id VARCHAR2(50) not null,
selector_id VARCHAR2(255) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
CONSTRAINT pk_proxy_api_key_mapping PRIMARY KEY (id)
);
CREATE UNIQUE INDEX uk_selector_proxy_key ON proxy_api_key_mapping (selector_id, proxy_api_key);
CREATE INDEX idx_namespace_enabled ON proxy_api_key_mapping (namespace_id, enabled);
create table model
(
id VARCHAR2(128) not null PRIMARY KEY,
name VARCHAR2(128) not null,
model_desc VARCHAR2(1024) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null
);
-- Add comments to the table
comment on table MODEL
is 'model desc table';
-- Add comments to the columns
comment on column MODEL.id
is 'id';
comment on column MODEL.name
is 'the model name';
comment on column MODEL.model_desc
is 'the model description';
comment on column MODEL.date_created
is 'create time';
comment on column MODEL.date_updated
is 'update time';
-- todo add some simple model, like java.lang.String long java.lang.Long
create table operation_record_log
(
id NUMBER(20) not null PRIMARY KEY,
color VARCHAR2(20) not null,
context CLOB not null,
operator VARCHAR2(200) not null,
operation_time timestamp(3) not null,
operation_type VARCHAR2(60) DEFAULT 'update' not null
);
-- Add comments to the columns
comment on column OPERATION_RECORD_LOG.id
is 'id';
comment on column OPERATION_RECORD_LOG.color
is 'log color';
comment on column OPERATION_RECORD_LOG.context
is 'log context';
comment on column OPERATION_RECORD_LOG.operator
is 'operator [user or app]]';
comment on column OPERATION_RECORD_LOG.operation_time
is 'operation time';
comment on column OPERATION_RECORD_LOG.operation_type
is 'operation type:create/update/delete/register...';
create sequence operation_record_log_seq
increment by 1
START WITH 1
NOMAXVALUE
NOCYCLE
NOCACHE;
create table api
(
id VARCHAR2 (128) not null,
context_path VARCHAR2 (255) not null,
api_path VARCHAR2 (255) not null,
http_method NUMBER (10) not null,
consume VARCHAR2 (255) not null,
produce VARCHAR2 (255) not null,
version VARCHAR2 (255) not null,
rpc_type VARCHAR2 (64) not null,
state NUMBER (10) not null,
ext VARCHAR2 (1025) not null,
api_owner VARCHAR2 (255) not null,
api_desc VARCHAR2 (1024) not null,
document CLOB not null,
document_md5 VARCHAR2 (32) not null,
api_source NUMBER (10) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the table
comment on table API
is 'api document';
-- Add comments to the columns
comment on column API.id
is 'primary key id';
comment on column API.context_path
is 'the context_path';
comment on column API.api_path
is 'the api_path';
comment on column API.http_method
is '0-get,1-head,2-post,3-put,4-patch,5-delete,6-options,7-trace';
comment on column API.consume
is 'consume content-type';
comment on column API.produce
is 'produce content-type';
comment on column API.version
is 'api version,for example V0.01';
comment on column API.rpc_type
is 'http,dubbo,sofa,tars,websocket,motan,grpc';
comment on column API.state
is '0-unpublished,1-published,2-offline';
comment on column API.ext
is 'extended fields';
comment on column API.api_owner
is 'api_owner';
comment on column API.api_desc
is 'the api description';
comment on column API.api_source
is '0-swagger,1-annotation generation,2-create manually,3-import swagger,4-import yapi';
comment on column API.document
is 'complete documentation of the api, including request parameters and response parameters';
comment on column API.document_md5
is 'document_md5';
comment on column API.date_created
is 'create time';
comment on column API.date_updated
is 'update time';
create table api_rule_relation
(
id VARCHAR2 (128) not null,
api_id VARCHAR2 (128) not null,
rule_id VARCHAR2 (128) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the columns
comment on column API_RULE_RELATION.id
is 'primary key id';
comment on column API_RULE_RELATION.api_id
is 'the table api primary key id';
comment on column API_RULE_RELATION.rule_id
is 'the table rule primary key id';
comment on column API_RULE_RELATION.date_created
is 'create time';
comment on column API_RULE_RELATION.date_updated
is 'update time';
create table app_auth
(
id VARCHAR2(128) not null,
app_key VARCHAR2(32) not null,
app_secret VARCHAR2(128) not null,
user_id VARCHAR2(128),
phone VARCHAR2(255),
ext_info VARCHAR2(1024),
open NUMBER(3) not null,
enabled NUMBER(3) not null,
namespace_id VARCHAR2(50) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the columns
comment on column APP_AUTH.id
is 'primary key id';
comment on column APP_AUTH.app_key
is 'application identification key';
comment on column APP_AUTH.app_secret
is 'encryption algorithm secret';
comment on column APP_AUTH.user_id
is 'user id';
comment on column APP_AUTH.phone
is 'phone number when the user applies';
comment on column APP_AUTH.ext_info
is 'extended parameter json';
comment on column APP_AUTH.open
is 'open auth path or not (0 not open, 1 open) ';
comment on column APP_AUTH.enabled
is 'delete or not (0 close, 1 open) ';
comment on column APP_AUTH.namespace_id
is 'namespace id';
comment on column APP_AUTH.date_created
is 'create time';
comment on column APP_AUTH.date_updated
is 'update time';
create table auth_param
(
id VARCHAR2(128) not null,
auth_id VARCHAR2(128),
app_name VARCHAR2(255) not null,
app_param VARCHAR2(255),
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the columns
comment on column AUTH_PARAM.id
is 'primary key id';
comment on column AUTH_PARAM.auth_id
is 'authentication table id';
comment on column AUTH_PARAM.app_name
is 'business Module';
comment on column AUTH_PARAM.app_param
is 'service module parameters (parameters that need to be passed by the gateway) json type';
comment on column AUTH_PARAM.date_created
is 'create time';
comment on column AUTH_PARAM.date_updated
is 'update time';
create table auth_path
(
id VARCHAR2(128) not null,
auth_id VARCHAR2(128) not null,
app_name VARCHAR2(255) not null,
path VARCHAR2(255) not null,
enabled NUMBER(3) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the columns
comment on column AUTH_PATH.id
is 'primary key id';
comment on column AUTH_PATH.auth_id
is 'auth table id';
comment on column AUTH_PATH.app_name
is 'module';
comment on column AUTH_PATH.path
is 'path';
comment on column AUTH_PATH.enabled
is 'whether pass 1 is (0 close, 1 open) ';
comment on column AUTH_PATH.date_created
is 'create time';
comment on column AUTH_PATH.date_updated
is 'update time';
create table shenyu_dict
(
id VARCHAR2(128) not null,
type VARCHAR2(100) not null,
dict_code VARCHAR2(100) not null,
dict_name VARCHAR2(100) not null,
dict_value VARCHAR2(2048),
"desc" VARCHAR2(255),
sort NUMBER(10) not null,
enabled NUMBER(3),
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id),
constraint dict_type_dict_code_dict_name unique (type,dict_code,dict_name)
);
-- Add comments to the columns
comment on column SHENYU_DICT.id
is 'primary key id';
comment on column SHENYU_DICT.type
is 'type';
comment on column SHENYU_DICT.dict_code
is 'dictionary encoding';
comment on column SHENYU_DICT.dict_name
is 'dictionary name';
comment on column SHENYU_DICT.dict_value
is 'dictionary value';
comment on column SHENYU_DICT."desc"
is 'dictionary description or remarks';
comment on column SHENYU_DICT.sort
is 'sort';
comment on column SHENYU_DICT.enabled
is 'whether it is enabled (0 close, 1 open) ';
comment on column SHENYU_DICT.date_created
is 'create time';
comment on column SHENYU_DICT.date_updated
is 'update time';
create table role
(
id VARCHAR2(128) not null,
role_name VARCHAR2(32) not null,
description VARCHAR2(255),
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id,role_name)
);
-- Add comments to the table
comment on table ROLE
is 'role table';
-- Add comments to the columns
comment on column ROLE.id
is 'primary key id';
comment on column ROLE.role_name
is 'role name';
comment on column ROLE.description
is 'role describe';
comment on column ROLE.date_created
is 'create time';
comment on column ROLE.date_updated
is 'update time';
create table user_role
(
id VARCHAR2(128) not null,
user_id VARCHAR2(128) not null,
role_id VARCHAR2(128) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the table
comment on table USER_ROLE
is 'user and role bind table';
-- Add comments to the columns
comment on column USER_ROLE.id
is 'primary key id';
comment on column USER_ROLE.user_id
is 'user primary key';
comment on column USER_ROLE.role_id
is 'role primary key';
comment on column USER_ROLE.date_created
is 'create time';
comment on column USER_ROLE.date_updated
is 'update time';
create table param
(
id VARCHAR2(128) not null,
api_id VARCHAR2(128) not null,
model_id VARCHAR2(128) not null,
type NUMBER(10) not null,
name VARCHAR2(255) not null,
param_desc VARCHAR2(1024) not null,
is_required NUMBER(3) not null,
ext VARCHAR2(1024) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the table
comment on table PARAM
is 'param document';
-- Add comments to the columns
comment on column PARAM.id
is 'primary key id';
comment on column PARAM.api_id
is 'the api id';
comment on column PARAM.model_id
is 'the model id, empty if not a model';
comment on column PARAM.type
is '0-requestPathVariable,1-requestUrlParam,2-requestHeader,3-requestBody,4-responseHeader,5-responseBody';
comment on column PARAM.name
is 'the param name';
comment on column PARAM.param_desc
is 'the param description';
comment on column PARAM.is_required
is 'whether to require (0 not required, 1 required)';
comment on column PARAM.ext
is 'extended fields';
comment on column PARAM.date_created
is 'create time';
comment on column PARAM.date_updated
is 'update time';
create table permission
(
id VARCHAR2(128) not null,
object_id VARCHAR2(128) not null,
resource_id VARCHAR2(128) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the table
comment on table PERMISSION
is 'permission table';
-- Add comments to the columns
comment on column PERMISSION.id
is 'primary key id';
comment on column PERMISSION.object_id
is 'user primary key id or role primary key id';
comment on column PERMISSION.resource_id
is 'resource primary key id';
comment on column PERMISSION.date_created
is 'create time';
comment on column PERMISSION.date_updated
is 'update time';
create table "resource"
(
id VARCHAR2(128) not null,
parent_id VARCHAR2(128) null,
title VARCHAR2(128) not null,
name VARCHAR2(32) null,
url VARCHAR2(32) null,
component VARCHAR2(32) null,
resource_type NUMBER(10) not null,
sort NUMBER(10) not null,
icon VARCHAR2(32) null,
is_leaf NUMBER(3) not null,
is_route NUMBER(10) not null,
perms VARCHAR2(64) null,
status NUMBER(10) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the table
comment on table "resource"
is 'resource table';
-- Add comments to the columns
comment on column "resource".id
is 'primary key id';
comment on column "resource".parent_id
is 'resource parent primary key id';
comment on column "resource".title
is 'title';
comment on column "resource".name
is 'route name';
comment on column "resource".url
is 'route url';
comment on column "resource".component
is 'component';
comment on column "resource".resource_type
is 'resource type eg 0:main menu 1:child menu 2:function button';
comment on column "resource".sort
is 'sort';
comment on column "resource".icon
is 'icon';
comment on column "resource".is_leaf
is 'leaf node 0:no 1:yes';
comment on column "resource".is_route
is 'route 1:yes 0:no';
comment on column "resource".perms
is 'button permission description sys:user:add(add);sys:user:edit(edit)';
comment on column "resource".status
is 'status 1:enable 0:disable';
comment on column "resource".date_created
is 'create time';
comment on column "resource".date_updated
is 'update time';
create table data_permission
(
id VARCHAR2(128) not null,
user_id VARCHAR2(128) not null,
data_id VARCHAR2(128) not null,
data_type NUMBER(10) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the table
comment on table DATA_PERMISSION
is 'data permission table';
-- Add comments to the columns
comment on column DATA_PERMISSION.id
is 'primary key id';
comment on column DATA_PERMISSION.user_id
is 'user primary key id';
comment on column DATA_PERMISSION.data_id
is 'data(selector,rule) primary key id';
comment on column DATA_PERMISSION.data_type
is '0 selector type , 1 rule type';
comment on column DATA_PERMISSION.date_created
is 'create time';
comment on column DATA_PERMISSION.date_updated
is 'update time';
create table detail
(
id VARCHAR2(128) not null,
field_id VARCHAR2(128) not null,
is_example NUMBER(3) not null,
field_value CLOB not null,
value_desc VARCHAR2(1024) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the table
comment on table DETAIL
is 'field value detail table';
-- Add comments to the columns
comment on column DETAIL.id
is 'primary key id';
comment on column DETAIL.field_id
is 'the field id';
comment on column DETAIL.is_example
is 'is example or not (0 not, 1 is)';
comment on column DETAIL.field_value
is 'the field value';
comment on column DETAIL.value_desc
is 'field value description';
comment on column DETAIL.date_created
is 'create time';
comment on column DETAIL.date_updated
is 'update time';
create table field
(
id VARCHAR2(128) not null,
model_id VARCHAR2(128) not null,
self_model_id VARCHAR2(128) not null,
name VARCHAR2(128) not null,
field_desc VARCHAR2(1024) not null,
is_required NUMBER(3) not null,
ext VARCHAR2(1024) not null,
date_created timestamp(3) default SYSDATE not null,
date_updated timestamp(3) default SYSDATE not null,
PRIMARY KEY (id)
);
-- Add comments to the table
comment on table field
is 'field document table';
-- Add comments to the columns
comment on column FIELD.id
is 'primary key id';
comment on column FIELD.model_id
is 'this field belongs to which model';
comment on column FIELD.self_model_id
is 'which model of this field is';
comment on column FIELD.name
is 'field name';
comment on column FIELD.field_desc
is 'field description';
comment on column FIELD.is_required
is 'whether to require (0 not required, 1 required)';
comment on column FIELD.ext
is 'extended fields,can store genericTypes,eg..{"genericTypes":[model_id1,model_id2]}';
comment on column FIELD.date_created
is 'create time';
comment on column FIELD.date_updated
is 'update time';
/**default admin user**/
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(dashboard_user(id)) */ INTO dashboard_user (id, user_name, password, role, enabled) VALUES ('1','admin','ba3253876aed6bc22d4a6ff53d8406c6ad864195ed144ab5c87621b6c233b548baeae6956df346ec8c17f5ea10f35ee3cbc514797ed7ddd3145464e2a0bab413', '1', '1');
/** insert admin role */
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(user_role(id)) */ INTO user_role (id, user_id, role_id) VALUES ('1351007709096976384', '1', '1346358560427216896');
/** insert permission role for role */
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(role(id)) */ INTO role (id,role_name,description) VALUES ('1346358560427216896', 'super', 'Administrator');
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(role(id)) */ INTO role (id,role_name,description) VALUES ('1385482862971723776', 'default', 'Standard');
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885184', 'degradeRuleGrade', 'DEGRADE_GRADE_RT', 'slow call ratio', '0', 'degrade type-slow call ratio', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885185', 'degradeRuleGrade', 'DEGRADE_GRADE_EXCEPTION_RATIO', 'exception ratio', '1', 'degrade type-abnormal ratio', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885186', 'degradeRuleGrade', 'DEGRADE_GRADE_EXCEPTION_COUNT', 'exception number strategy', '2', 'degrade type-abnormal number strategy', 2, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885187', 'flowRuleGrade', 'FLOW_GRADE_QPS', 'QPS', '1', 'grade type-QPS', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885188', 'flowRuleGrade', 'FLOW_GRADE_THREAD', 'number of concurrent threads', '0', 'degrade type-number of concurrent threads', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885189', 'flowRuleControlBehavior', 'CONTROL_BEHAVIOR_DEFAULT', 'direct rejection by default', '0', 'control behavior-direct rejection by default', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885190', 'flowRuleControlBehavior', 'CONTROL_BEHAVIOR_WARM_UP', 'warm up', '1', 'control behavior-warm up', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885191', 'flowRuleControlBehavior', 'CONTROL_BEHAVIOR_RATE_LIMITER', 'constant speed queuing', '2', 'control behavior-uniform speed queuing', 2, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885192', 'flowRuleControlBehavior', 'CONTROL_BEHAVIOR_WARM_UP_RATE_LIMITER', 'preheating uniformly queued', '3', 'control behavior-preheating uniformly queued', 3, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885193', 'permission', 'REJECT', 'reject', 'reject', 'reject', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885194', 'permission', 'ALLOW', 'allow', 'allow', 'allow', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885195', 'algorithmName', 'ALGORITHM_SLIDINGWINDOW', 'slidingWindow', 'slidingWindow', 'Sliding window algorithm', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885196', 'algorithmName', 'ALGORITHM_LEAKYBUCKET', 'leakyBucket', 'leakyBucket', 'Leaky bucket algorithm', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885197', 'algorithmName', 'ALGORITHM_CONCURRENT', 'concurrent', 'concurrent', 'Concurrent algorithm', 2, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885198', 'algorithmName', 'ALGORITHM_TOKENBUCKET', 'tokenBucket', 'tokenBucket', 'Token bucket algorithm', 3, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885199', 'loadBalance', 'LOAD_BALANCE', 'roundRobin', 'roundRobin', 'roundRobin', 2, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885200', 'loadBalance', 'LOAD_BALANCE', 'random', 'random', 'random', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885201', 'loadBalance', 'LOAD_BALANCE', 'hash', 'hash', 'hash', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885202', 'status', 'DIVIDE_STATUS', 'close', 'false', 'close', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885203', 'status', 'DIVIDE_STATUS', 'open', 'true', 'open', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885204', 'multiRuleHandle', 'MULTI_RULE_HANDLE', 'multiple rule', '1', 'multiple rule', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897201885205', 'multiRuleHandle', 'MULTI_RULE_HANDLE', 'single rule', '0', 'single rule', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079488', 'multiSelectorHandle', 'MULTI_SELECTOR_HANDLE', 'multiple handle', '1', 'multiple handle', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079489', 'multiSelectorHandle', 'MULTI_SELECTOR_HANDLE', 'single handle', '0', 'single handle', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079490', 'matchMode', 'MATCH_MODE', 'and', '0', 'and', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079491', 'matchMode', 'MATCH_MODE', 'or', '1', 'or', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079492', 'operator', 'OPERATOR', 'match', 'match', 'match', 0, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079493', 'operator', 'OPERATOR', '=', '=', '=', 1, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079494', 'operator', 'OPERATOR', 'regex', 'regex', 'regex', 2, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079495', 'operator', 'OPERATOR', 'contains', 'contains', 'contains', 3, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079496', 'operator', 'OPERATOR', 'TimeBefore', 'TimeBefore', 'TimeBefore', 4, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079497', 'operator', 'OPERATOR', 'TimeAfter', 'TimeAfter', 'TimeAfter', 5, 1);
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name)) */ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT, ENABLED)
values ('1518229897206079498', 'operator', 'OPERATOR', 'exclude', 'exclude', 'exclude', 6, 1);