-- Drive v2 uses forward-only migrations. Rollback is restore-or-fix-forward.
CREATE EXTENSION IF NOT EXISTS pg_trgm;

CREATE TABLE IF NOT EXISTS drive_metadata (
    singleton BOOLEAN PRIMARY KEY DEFAULT TRUE CHECK (singleton),
    installed_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

INSERT INTO drive_metadata (singleton) VALUES (TRUE)
ON CONFLICT (singleton) DO NOTHING;
