allied_creation_test_tables_view.sql
2.0 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
-- == 表【files】建视图语句 ==
drop view view_files;
create view view_files as select file_id as id,file_id,file_type,source_file_id,created_at,updated_at,deleted_at,version,file_from,app_key from files;
-- pk file_id
-- jsonb file_info,context
-- == 表【mapping_rules】建视图语句 ==
drop view view_mapping_rules;
create view view_mapping_rules as select mapping_rule_id as id,mapping_rule_id,name,table_id,file_id,created_at,updated_at,deleted_at from mapping_rules;
-- pk mapping_rule_id
-- jsonb main_table_fields,verified_file_fields,mapping_fields,context
-- == 表【logs】建视图语句 ==
drop view view_logs;
create view view_logs as select log_id as id,log_id,log_type,source_id,object_name,object_type,operation_type,content,operator_name,created_at,log_time from logs;
-- pk log_id
-- jsonb entry,context
-- == 表【query_sets】建视图语句 ==
drop view view_query_sets;
create view view_query_sets as select query_set_id as id,query_set_id,type,flag,name,pin_name,parent_id,status,sort,created_at,updated_at,deleted_at from query_sets;
-- pk query_set_id
-- jsonb query_set_info,query_components,context
-- == 表【query_sets_copy1】建视图语句 ==
drop view view_query_sets_copy1;
create view view_query_sets_copy1 as select query_set_id as id,query_set_id,type,flag,name,pin_name,parent_id,status,sort,created_at,updated_at,deleted_at from query_sets_copy1;
-- pk query_set_id
-- jsonb query_set_info,query_components,context
-- == 表【tables】建视图语句 ==
drop view view_tables;
create view view_tables as select table_id as id,table_id,table_catalog,table_type,table_schema,table_name,name,sql_name,table_type,parent_id,self_referencing_column_name,data_field_index,reference_generation,user_defined_type_catalog,user_defined_type_schema,user_defined_type_name,is_insertable_into,created_at,updated_at,is_typed,commit_action,deleted_at,version,row_count,apply_at from tables;
-- pk table_id
-- jsonb pk,data_fields,manual_fields,context,table_info,order_fields