CREATE TABLE IF NOT EXISTS project_audit_log (
    id BIGSERIAL PRIMARY KEY,
    project UUID NOT NULL,
    actor UUID NOT NULL,
    action TEXT NOT NULL,
    details JSONB,
    ip_address VARCHAR(255),
    user_agent VARCHAR(255),
    created_at TIMESTAMPTZ NOT NULL
);

CREATE INDEX idx_project_audit_log_project ON project_audit_log (project);
CREATE INDEX idx_project_audit_log_created_at ON project_audit_log (created_at);
