CREATE TABLE system_installation ( singleton boolean PRIMARY KEY DEFAULT true CHECK (singleton), installation_id uuid NOT NULL DEFAULT gen_random_uuid(), setup_completed_at timestamptz, created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now() ); INSERT INTO system_installation(singleton) VALUES(true);