-- 回滚图片生成模板分辨率的小写约束变更。
ALTER TABLE product_image_templates
    DROP CONSTRAINT IF EXISTS chk_product_image_template_resolution;

UPDATE product_image_templates
SET resolution = upper(resolution);

ALTER TABLE product_image_templates
    ALTER COLUMN resolution SET DEFAULT '1K',
    ADD CONSTRAINT chk_product_image_template_resolution
        CHECK (resolution IN ('1K', '2K', '4K'));
