yuqi1129 commented on code in PR #5689:
URL: https://github.com/apache/gravitino/pull/5689#discussion_r1860292173
##########
scripts/h2/schema-0.8.0-h2.sql:
##########
@@ -289,3 +289,51 @@ CREATE TABLE IF NOT EXISTS `owner_meta` (
KEY `idx_oid` (`owner_id`),
KEY `idx_meid` (`metadata_object_id`)
) ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS `model_meta` (
+ `model_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'model id',
+ `model_name` VARCHAR(128) NOT NULL COMMENT 'model name',
+ `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',
+ `model_comment` TEXT DEFAULT NULL COMMENT 'model comment',
+ `model_properties` MEDIUMTEXT DEFAULT NULL COMMENT 'model properties',
+ `model_latest_version` INT UNSIGNED DEFAULT 0 COMMENT 'model latest
version',
+ `audit_info` MEDIUMTEXT NOT NULL COMMENT 'model audit info',
+ `deleted_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'model deleted
at',
+ PRIMARY KEY (`model_id`),
+ UNIQUE KEY `uk_sid_mn_del` (`schema_id`, `model_name`, `deleted_at`),
+ KEY `idx_mmid` (`metalake_id`),
+ KEY `idx_mcid` (`catalog_id`)
+) ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS `model_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',
+ `model_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'model id',
+ `version` INT UNSIGNED NOT NULL COMMENT 'model version',
+ `model_version_comment` TEXT DEFAULT NULL COMMENT 'model version comment',
+ `model_version_properties` MEDIUMTEXT DEFAULT NULL COMMENT 'model version
properties',
+ `model_version_uri` MEDIUMTEXT NOT NULL COMMENT 'model storage uri',
+ `audit_info` MEDIUMTEXT NOT NULL COMMENT 'model version audit info',
+ `deleted_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'model version
deleted at',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_mid_ver_del` (`model_id`, `version`, `deleted_at`),
+ KEY `idx_vmid` (`metalake_id`),
+ KEY `idx_vcid` (`catalog_id`),
+ KEY `idx_vsid` (`schema_id`)
+) ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS `model_version_alias_rel` (
+ `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'auto increment
id',
+ `model_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'model id',
+ `model_version` INT UNSIGNED NOT NULL COMMENT 'model version',
+ `model_version_alias` VARCHAR(128) NOT NULL COMMENT 'model version alias',
+ `deleted_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'model version
alias deleted at',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_mi_mv_mva_del` (`model_id`, `model_version`,
`model_version_alias`, `deleted_at`),
+ KEY `idx_mvtid` (`model_id`),
Review Comment:
I believe the unique key `uk_mi_mv_mva_del` can cover key `idx_mvtid`
according to the left match rule.
##########
scripts/h2/schema-0.8.0-h2.sql:
##########
@@ -289,3 +289,51 @@ CREATE TABLE IF NOT EXISTS `owner_meta` (
KEY `idx_oid` (`owner_id`),
KEY `idx_meid` (`metadata_object_id`)
) ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS `model_meta` (
+ `model_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'model id',
+ `model_name` VARCHAR(128) NOT NULL COMMENT 'model name',
+ `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',
+ `model_comment` TEXT DEFAULT NULL COMMENT 'model comment',
+ `model_properties` MEDIUMTEXT DEFAULT NULL COMMENT 'model properties',
+ `model_latest_version` INT UNSIGNED DEFAULT 0 COMMENT 'model latest
version',
+ `audit_info` MEDIUMTEXT NOT NULL COMMENT 'model audit info',
+ `deleted_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'model deleted
at',
+ PRIMARY KEY (`model_id`),
+ UNIQUE KEY `uk_sid_mn_del` (`schema_id`, `model_name`, `deleted_at`),
+ KEY `idx_mmid` (`metalake_id`),
+ KEY `idx_mcid` (`catalog_id`)
+) ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS `model_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',
+ `model_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'model id',
+ `version` INT UNSIGNED NOT NULL COMMENT 'model version',
+ `model_version_comment` TEXT DEFAULT NULL COMMENT 'model version comment',
+ `model_version_properties` MEDIUMTEXT DEFAULT NULL COMMENT 'model version
properties',
+ `model_version_uri` MEDIUMTEXT NOT NULL COMMENT 'model storage uri',
Review Comment:
Is it possible that the `model_version_uri` is too large to use `MEDIUMTEXT`?
--
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]