mchades commented on code in PR #10793: URL: https://github.com/apache/gravitino/pull/10793#discussion_r3165360068
########## scripts/h2/upgrade-1.2.0-to-1.3.0-h2.sql: ########## @@ -17,6 +17,29 @@ -- under the License. -- +ALTER TABLE `role_meta` ADD COLUMN `updated_at` BIGINT NOT NULL DEFAULT 0; +ALTER TABLE `user_meta` ADD COLUMN `updated_at` BIGINT NOT NULL DEFAULT 0; +ALTER TABLE `group_meta` ADD COLUMN `updated_at` BIGINT NOT NULL DEFAULT 0; +ALTER TABLE `owner_meta` ADD COLUMN `updated_at` BIGINT NOT NULL DEFAULT 0; + +CREATE INDEX IF NOT EXISTS `idx_user_meta_name_del_upd` ON `user_meta`(`metalake_id`, `user_name`, `deleted_at`, `updated_at`); +CREATE INDEX IF NOT EXISTS `idx_group_meta_del_upd` ON `group_meta`(`group_id`, `deleted_at`, `updated_at`); +CREATE INDEX IF NOT EXISTS `idx_role_meta_del_upd` ON `role_meta`(`role_id`, `deleted_at`, `updated_at`); +CREATE INDEX IF NOT EXISTS `idx_owner_meta_obj_del_upd` ON `owner_meta`(`metadata_object_id`, `deleted_at`, `updated_at`); +CREATE INDEX IF NOT EXISTS `idx_owner_meta_del_upd_obj` ON `owner_meta`(`deleted_at`, `updated_at`, `metadata_object_id`); + +CREATE TABLE IF NOT EXISTS `entity_change_log` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `metalake_name` VARCHAR(128) NOT NULL, + `entity_type` VARCHAR(32) NOT NULL, + `full_name` VARCHAR(512) NOT NULL, + -- Operate type code: 1=RENAME, 2=DROP, 3=INSERT. Codes are stable and never re-used. + `operate_type` TINYINT UNSIGNED NOT NULL, Review Comment: Here, `rename` is treated as a separate operation, but our current API uses update (which may include rename and other update operations such as `setProperty`, etc.). Does this mean that separate op_codes are needed to represent other update operations? -- 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]
