CREATE SCHEMA IF NOT EXISTS stg;
CREATE SCHEMA IF NOT EXISTS dim;
CREATE SCHEMA IF NOT EXISTS fact;
CREATE SCHEMA IF NOT EXISTS rej;
CREATE SCHEMA IF NOT EXISTS meta;

CREATE TABLE IF NOT EXISTS meta.batch_log (
    batch_id       BIGSERIAL PRIMARY KEY,
    source_file    TEXT NOT NULL,
    source_hash    TEXT,
    rows_read      INT,
    rows_loaded    INT,
    rows_rejected  INT,
    started_at     TIMESTAMPTZ DEFAULT NOW(),
    finished_at    TIMESTAMPTZ
);
