yuqi1129 commented on code in PR #12579: URL: https://github.com/apache/gravitino/pull/12579#discussion_r3843601064
########## scripts/h2/upgrade-1.3.0-to-2.0.0-h2.sql: ########## @@ -40,3 +40,18 @@ CREATE UNIQUE INDEX IF NOT EXISTS `uk_ti_mi_mo_tv_del` ON `tag_relation_meta` (` CREATE INDEX IF NOT EXISTS `idx_tid_value` ON `tag_relation_meta` (`tag_id`, `tag_value`); ALTER TABLE `job_run_meta` ADD COLUMN `job_started_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'job started at' AFTER `job_run_status`; + +CREATE TABLE IF NOT EXISTS `policy_tag_relation_meta` ( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'auto increment id', + `policy_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'policy id', + `tag_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'tag id', + `selector` CLOB DEFAULT NULL COMMENT 'policy tag selector JSON, NULL matches tag presence', + `audit_info` CLOB NOT NULL COMMENT 'policy tag relation audit info', + `current_version` INT UNSIGNED NOT NULL DEFAULT 1 COMMENT 'policy tag relation current version', + `last_version` INT UNSIGNED NOT NULL DEFAULT 1 COMMENT 'policy tag relation last version', + `deleted_at` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'policy tag relation deleted at', + PRIMARY KEY (`id`), + UNIQUE KEY `policy_tag_relation_meta_uk_pid_tid_del` (`policy_id`, `tag_id`, `deleted_at`), + KEY `policy_tag_relation_meta_idx_policy_id` (`policy_id`), Review Comment: This one is redundant, as we already have a unique with the prefix `policy_id`. -- 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]
