xiaozcy commented on code in PR #7502:
URL: https://github.com/apache/gravitino/pull/7502#discussion_r2184267638


##########
scripts/h2/upgrade-0.9.0-to-1.0.0-h2.sql:
##########
@@ -60,4 +60,11 @@ CREATE TABLE IF NOT EXISTS `policy_relation_meta` (
     UNIQUE KEY `uk_pi_mi_mo_del` (`policy_id`, `metadata_object_id`, 
`metadata_object_type`, `deleted_at`),
     KEY `idx_pid` (`policy_id`),
     KEY `idx_mid` (`metadata_object_id`)
-) ENGINE=InnoDB;
\ No newline at end of file
+) ENGINE=InnoDB;
+
+-- using default 'unknown' to fill in the new column for compatibility
+ALTER TABLE `model_version_info` ADD COLUMN `model_version_uri_name` 
VARCHAR(256) NOT NULL DEFAULT 'unknown' COMMENT 'model version uri name';
+ALTER TABLE `model_version_info` DROP INDEX `uk_mid_ver_del`;
+ALTER TABLE `model_version_info` ADD CONSTRAINT `uk_mid_ver_uri_del` UNIQUE 
(`model_id`, `version`, `model_version_uri_name`, `deleted_at`);
+-- remove the default value for model_version_uri_name
+ALTER TABLE `model_version_info` ALTER COLUMN `model_version_uri_name` DROP 
DEFAULT;

Review Comment:
   The filed `model_version_uri_name` should not have a default value, the 
default value is used for compatibility with previous data. After setting 
default value for the previous data, the default value of the field should be 
dropped.



-- 
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]

Reply via email to