Unverified Commit 713e65ac authored by aiwenmo's avatar aiwenmo Committed by GitHub

[Fix-709] [catalog] Fix catalog SPI bug and sql bug (#710)

Co-authored-by: 's avatarwenmo <32723967+wenmo@users.noreply.github.com>
parent 4aaea1a6
drop table if exists `metadata_database` drop table if exists `metadata_database`;
create table if not exists `metadata_database` ( create table if not exists `metadata_database` (
`id` int(11) not null AUTO_INCREMENT COMMENT '主键', `id` int(11) not null AUTO_INCREMENT COMMENT '主键',
`database_name` varchar(255) NOT NULL COMMENT '名称', `database_name` varchar(255) NOT NULL COMMENT '名称',
...@@ -6,9 +6,9 @@ create table if not exists `metadata_database` ( ...@@ -6,9 +6,9 @@ create table if not exists `metadata_database` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间',
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='元数据对象信息' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='元数据对象信息';
drop table if exists `metadata_table` drop table if exists `metadata_table`;
create table if not exists `metadata_table` ( create table if not exists `metadata_table` (
`id` int(11) not null AUTO_INCREMENT COMMENT '主键', `id` int(11) not null AUTO_INCREMENT COMMENT '主键',
`table_name` varchar(255) NOT NULL COMMENT '名称', `table_name` varchar(255) NOT NULL COMMENT '名称',
...@@ -18,9 +18,9 @@ create table if not exists `metadata_table` ( ...@@ -18,9 +18,9 @@ create table if not exists `metadata_table` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间',
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='元数据对象信息' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='元数据对象信息';
drop table if exists `metadata_database_property` drop table if exists `metadata_database_property`;
create table if not exists `metadata_database_property` ( create table if not exists `metadata_database_property` (
`key` varchar(255) NOT NULL COMMENT '属性key', `key` varchar(255) NOT NULL COMMENT '属性key',
`value` varchar(255) NULL COMMENT '属性value', `value` varchar(255) NULL COMMENT '属性value',
...@@ -28,9 +28,9 @@ create table if not exists `metadata_database_property` ( ...@@ -28,9 +28,9 @@ create table if not exists `metadata_database_property` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`key`, `database_id`) PRIMARY KEY (`key`, `database_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='元数据属性信息' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='元数据属性信息';
drop table if exists `metadata_table_property` drop table if exists `metadata_table_property`;
create table if not exists `metadata_table_property` ( create table if not exists `metadata_table_property` (
`key` varchar(255) NOT NULL COMMENT '属性key', `key` varchar(255) NOT NULL COMMENT '属性key',
`value` varchar(255) NULL COMMENT '属性value', `value` varchar(255) NULL COMMENT '属性value',
...@@ -38,9 +38,9 @@ create table if not exists `metadata_table_property` ( ...@@ -38,9 +38,9 @@ create table if not exists `metadata_table_property` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`key`, `table_id`) PRIMARY KEY (`key`, `table_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='元数据属性信息' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='元数据属性信息';
drop table if exists metadata_column drop table if exists metadata_column;
create table if not exists `metadata_column` ( create table if not exists `metadata_column` (
`column_name` varchar(255) NOT NULL COMMENT '列名', `column_name` varchar(255) NOT NULL COMMENT '列名',
`column_type` varchar(255) NOT NULL COMMENT '列类型, 有Physical Metadata Computed WATERMARK ', `column_type` varchar(255) NOT NULL COMMENT '列类型, 有Physical Metadata Computed WATERMARK ',
...@@ -52,9 +52,9 @@ create table if not exists `metadata_column` ( ...@@ -52,9 +52,9 @@ create table if not exists `metadata_column` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`table_id`,`column_name`) PRIMARY KEY (`table_id`,`column_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据列信息' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据列信息';
drop table if exists `metadata_function` drop table if exists `metadata_function`;
create table if not exists `metadata_function` ( create table if not exists `metadata_function` (
`id` int(11) not null AUTO_INCREMENT COMMENT '主键', `id` int(11) not null AUTO_INCREMENT COMMENT '主键',
`function_name` varchar(255) NOT NULL COMMENT '名称', `function_name` varchar(255) NOT NULL COMMENT '名称',
...@@ -64,4 +64,4 @@ create table if not exists `metadata_function` ( ...@@ -64,4 +64,4 @@ create table if not exists `metadata_function` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间', `update_time` datetime DEFAULT NULL COMMENT '更新时间',
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='UDF信息' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='UDF信息';
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment