Files
microdao-daarion/migrations/043_asset_urls_to_text.sql

34 lines
1.4 KiB
SQL

-- 043_asset_urls_to_text.sql
-- Migration: Change asset URL fields to text to support full HTTPS URLs from MinIO/S3
-- MicroDAO logo and banner URLs
ALTER TABLE microdaos
ALTER COLUMN logo_url TYPE text,
ALTER COLUMN banner_url TYPE text;
COMMENT ON COLUMN microdaos.logo_url IS 'Full HTTPS URL to logo image (e.g., https://assets.daarion.space/daarion-assets/microdao/logo/...)';
COMMENT ON COLUMN microdaos.banner_url IS 'Full HTTPS URL to banner image (e.g., https://assets.daarion.space/daarion-assets/microdao/banner/...)';
-- Agent avatar URLs
ALTER TABLE agents
ALTER COLUMN avatar_url TYPE text;
COMMENT ON COLUMN agents.avatar_url IS 'Full HTTPS URL to avatar image (e.g., https://assets.daarion.space/daarion-assets/agents/avatar/...)';
-- City rooms logo and banner (if exists)
DO $$
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.columns
WHERE table_name = 'city_rooms' AND column_name = 'logo_url') THEN
ALTER TABLE city_rooms ALTER COLUMN logo_url TYPE text;
COMMENT ON COLUMN city_rooms.logo_url IS 'Full HTTPS URL to room logo image';
END IF;
IF EXISTS (SELECT 1 FROM information_schema.columns
WHERE table_name = 'city_rooms' AND column_name = 'banner_url') THEN
ALTER TABLE city_rooms ALTER COLUMN banner_url TYPE text;
COMMENT ON COLUMN city_rooms.banner_url IS 'Full HTTPS URL to room banner image';
END IF;
END $$;