CREATE TABLE IF NOT EXISTS project_member_join_request (
    id BIGSERIAL PRIMARY KEY,
    project UUID NOT NULL,
    "user" UUID NOT NULL,
    status VARCHAR(255) NOT NULL,
    message TEXT,
    processed_by UUID,
    processed_at TIMESTAMPTZ,
    reject_reason TEXT,
    created_at TIMESTAMPTZ NOT NULL,
    updated_at TIMESTAMPTZ NOT NULL
);

CREATE INDEX idx_project_member_join_request_project_user ON project_member_join_request (project, "user");
CREATE INDEX idx_project_member_join_request_status ON project_member_join_request (status);
