* feat: instancd groups mapping to workspace * npm run check * nits * improve apis * sqlx prepare and ee-repo ref * adding workspace assignment in groups page * nits * correct rollback * sqlx * ee repo ref * revert accidental ee-repo-ref commit to main * ee repo ref * revert accidental ee-repo-ref commit to main
9 lines
430 B
SQL
9 lines
430 B
SQL
-- Add added_via column to track how users were added to workspaces
|
|
-- NULL = manual addition
|
|
-- {"source": "domain", "domain": "company.com"} = domain auto-add
|
|
-- {"source": "instance_group", "group": "developers", "role": "developer"} = instance group auto-add
|
|
ALTER TABLE usr ADD COLUMN added_via jsonb DEFAULT NULL;
|
|
|
|
-- Add index for efficient queries on added_via
|
|
CREATE INDEX idx_usr_added_via ON usr USING gin (added_via);
|