Skip to content

The only tool you need to know what is happening and how to fix it.

302 B
Raw Blame
CREATE TABLE organization_users (id SERIAL PRIMARY KEY, user_id INT NOT NULL REFERENCES users(id), organization_id INT NOT NULL REFERENCES organizations(id), role TEXT NOT NULL CHECK (role IN ('owner','admin','user','readonly')), created_at TIMESTAMPTZ DEFAULT NOW(), UNIQUE(user_id, organization_id))