DO $$ BEGIN
    IF EXISTS (
        SELECT 1 FROM information_schema.columns 
        WHERE table_schema = 'public' 
        AND table_name = 'annunci' 
        AND column_name = 'updated_at'
    ) THEN
        ALTER TABLE public.annunci RENAME COLUMN "updated_at" TO "media_updated_at";
    END IF;
END $$;