set mode mysql; set names utf8mb4; set foreign_key_checks = 0; -- auto-generated definition drop table if exists idx_dimension; create table if not exists idx_dimension ( dimension_id bigint auto_increment primary key, create_by varchar(500), create_time timestamp, update_by varchar(500), update_time timestamp, dimension_code varchar(500), dimension_description varchar(500), dimension_name varchar(500), index_dimension boolean, time_dimension boolean ); drop table if exists idx_dimension_attribute; create table if not exists idx_dimension_attribute ( dimension_attribute_id bigint auto_increment primary key, create_by varchar(500), create_time timestamp, update_by varchar(500), update_time timestamp, attribute_code varchar(500), attribute_name varchar(500), description varchar(500), code_attribute boolean, key_attribute boolean, dimension_id bigint ); drop table if exists idx_fact; create table if not exists idx_fact ( fact_id bigint auto_increment primary key, create_by varchar(500), create_time timestamp, update_by varchar(500), update_time timestamp, fact_code varchar(500), description varchar(500), fact_name varchar(500) ); drop table if exists idx_fact_attribute; create table if not exists idx_fact_attribute ( fact_attribute_id bigint auto_increment primary key, create_by varchar(500), create_time timestamp, update_by varchar(500), update_time timestamp, attribute_code varchar(500), attribute_name varchar(500), description varchar(500), fact_id bigint ); drop table if exists idx_indexes; create table if not exists idx_indexes ( index_id bigint auto_increment primary key, create_by varchar(500), create_time timestamp, update_by varchar(500), update_time timestamp, based boolean, enabled boolean, index_calcule_type varchar(500), index_category varchar(500), index_code varchar(500), index_description varchar(500), index_folder_id varchar(500), index_name varchar(500), index_type varchar(500) ); drop table if exists idx_fact_measure; create table if not exists idx_fact_measure ( fact_measure_id bigint auto_increment primary key, measure_code varchar(10), measure_name varchar(1000), description varchar(1000), measure_type varchar(10), fact_id bigint, create_by varchar(100), create_time timestamp, update_by varchar(100), update_time timestamp ); drop table if exists idx_logic_model; create table if not exists idx_logic_model ( logic_model_id bigint auto_increment primary key comment '物理主键', model_name varchar(255) null, description varchar(255) null, fact_id bigint(30) null, table_definition_id bigint(30) null, create_by varchar(255) null, create_time timestamp, update_by varchar(255) null, update_time timestamp ); drop table if exists idx_table_definition; create table if not exists idx_table_definition ( table_definition_id bigint auto_increment primary key comment '物理主键', table_name varchar(255) null, table_description varchar(255) null, remark varchar(255) null, enabled varchar(255) null, ds_id bigint(30) null, source_system varchar(255) null, difinition_type varchar(255) null, created tinyint(1) null, create_by varchar(255) null, create_time timestamp, update_by varchar(255) null, update_time timestamp ); begin; commit; set foreign_key_checks = 1; -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (1, 'admin', null, null, null, 'RPT_BUS_ORG_CD_D', '机构', '机构', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (2, 'admin', null, null, null, 'RPT_BUSINESS_LINE_ID_D', '条线', '条线', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (3, 'admin', null, null, null, 'RPT_MIS_PROD_ID_D', '产品', '产品', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (4, 'admin', null, null, null, 'RPT_ADJ_TYPE_D', '调整类型', '调整类型', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (5, 'admin', null, null, null, 'RPT_BUS_ORG_CD_d', '机构', '机构', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (6, 'admin', null, null, null, 'RPT_CCY_CD_D', '币种', '币种', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (7, 'admin', null, null, null, 'RPT_PERIOD_CODe_d', '期间', '期间', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (8, 'admin', null, null, null, 'RPT_INDEX_D', '指标', '指标', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (9, 'admin', null, null, null, 'RPT_BUS_ORG_CD_ori_d', '原始机构', '原始机构', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (10, 'admin', null, null, null, 'RPT_DESK_D', 'DESK', 'DESK', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (11, 'admin', null, null, null, 'GRM_ORG_CODE', 'GRM机构', 'GRM机构', false, false); -- insert into public.idx_dimension (dimension_id, create_by, create_time, update_by, update_time, dimension_code, dimension_description, dimension_name, index_dimension, time_dimension) values (12, 'admin', null, null, null, 'RPT_DATE_D', '日期', '日期', false, false);