-- Create databases for Airbyte OSS
-- These databases will be used by the Airbyte deployment in 04-ingestion

-- Main Airbyte database
CREATE DATABASE airbyte;

-- Temporal workflow engine databases
CREATE DATABASE temporal;
CREATE DATABASE temporal_visibility;

-- Grant permissions to postgres user
GRANT ALL PRIVILEGES ON DATABASE airbyte TO postgres;
GRANT ALL PRIVILEGES ON DATABASE temporal TO postgres;
GRANT ALL PRIVILEGES ON DATABASE temporal_visibility TO postgres;
