yuqi1129 commented on code in PR #8675:
URL: https://github.com/apache/gravitino/pull/8675#discussion_r2380772679
##########
scripts/h2/upgrade-0.6.0-to-0.7.0-h2.sql:
##########
@@ -17,26 +17,26 @@
-- under the License.
--
CREATE TABLE IF NOT EXISTS `table_column_version_info` (
- `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'auto increment
id',
- `metalake_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'metalake id',
- `catalog_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'catalog id',
- `schema_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'schema id',
- `table_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'table id',
- `table_version` INT UNSIGNED NOT NULL COMMENT 'table version',
- `column_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'column id',
+ `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'auto increment id',
+ `metalake_id` BIGINT NOT NULL COMMENT 'metalake id',
+ `catalog_id` BIGINT NOT NULL COMMENT 'catalog id',
+ `schema_id` BIGINT NOT NULL COMMENT 'schema id',
+ `table_id` BIGINT NOT NULL COMMENT 'table id',
+ `table_version` INT NOT NULL COMMENT 'table version',
+ `column_id` BIGINT NOT NULL COMMENT 'column id',
`column_name` VARCHAR(128) NOT NULL COMMENT 'column name',
- `column_position` INT UNSIGNED NOT NULL COMMENT 'column position, starting
from 0',
- `column_type` TEXT NOT NULL COMMENT 'column type',
+ `column_position` INT NOT NULL COMMENT 'column position, starting from 0',
+ `column_type` CLOB NOT NULL COMMENT 'column type',
`column_comment` VARCHAR(256) DEFAULT '' COMMENT 'column comment',
- `column_nullable` TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'column nullable,
0 is not nullable, 1 is nullable',
- `column_auto_increment` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'column auto
increment, 0 is not auto increment, 1 is auto increment',
- `column_default_value` TEXT DEFAULT NULL COMMENT 'column default value',
- `column_op_type` TINYINT(1) NOT NULL COMMENT 'column operation type, 1 is
create, 2 is update, 3 is delete',
- `deleted_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'column
deleted at',
- `audit_info` MEDIUMTEXT NOT NULL COMMENT 'column audit info',
+ `column_nullable` SMALLINT NOT NULL DEFAULT 1 COMMENT 'column nullable, 0
is not nullable, 1 is nullable',
Review Comment:
If H2 supports defining column comments in creating table syntax, we should
not use a separate sentence to do it to reduce the chances.
##########
scripts/h2/schema-0.6.0-h2.sql:
##########
@@ -17,249 +17,412 @@
-- under the License.
--
-CREATE TABLE IF NOT EXISTS `metalake_meta` (
- `metalake_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'metalake id',
- `metalake_name` VARCHAR(128) NOT NULL COMMENT 'metalake name',
- `metalake_comment` VARCHAR(256) DEFAULT '' COMMENT 'metalake comment',
- `properties` MEDIUMTEXT DEFAULT NULL COMMENT 'metalake properties',
- `audit_info` MEDIUMTEXT NOT NULL COMMENT 'metalake audit info',
- `schema_version` MEDIUMTEXT NOT NULL COMMENT 'metalake schema version
info',
- `current_version` INT UNSIGNED NOT NULL DEFAULT 1 COMMENT 'metalake
current version',
- `last_version` INT UNSIGNED NOT NULL DEFAULT 1 COMMENT 'metalake last
version',
- `deleted_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'metalake
deleted at',
+CREATE TABLE IF NOT EXISTS metalake_meta (
+ metalake_id BIGINT NOT NULL,
Review Comment:
1. Is there no need to backquote the column name in H2?
2. Is the display length for types like `BIGINT` not supported in H2?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]