-
-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(schemas): rename tenant member role to collaborator
- Loading branch information
1 parent
36003b8
commit 24b22c5
Showing
4 changed files
with
55 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...es/schemas/alterations/next-1712041436-rename-organization-member-role-to-collaborator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { sql } from '@silverhand/slonik'; | ||
|
||
import type { AlterationScript } from '../lib/types/alteration.js'; | ||
|
||
const alteration: AlterationScript = { | ||
up: async (pool) => { | ||
await pool.query(sql` | ||
update organization_roles | ||
set id = 'collaborator', name = 'collaborator', description = 'Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings.' | ||
where tenant_id = 'admin' and id = 'member'; | ||
update organization_role_scope_relations | ||
set organization_role_id = 'collaborator' | ||
where tenant_id = 'admin' and organization_role_id = 'member'; | ||
`); | ||
}, | ||
down: async (pool) => { | ||
await pool.query(sql` | ||
update organization_roles | ||
set id = 'member', name = 'member', description = 'Member of the tenant, who has permissions to operate the tenant data, but not the tenant settings.' | ||
where tenant_id = 'admin' and id = 'collaborator'; | ||
update organization_role_scope_relations | ||
set organization_role_id = 'member' | ||
where tenant_id = 'admin' and organization_role_id = 'collaborator'; | ||
`); | ||
}, | ||
}; | ||
|
||
export default alteration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters