Skip to content

Commit b6d0b67

Browse files
feat: roles array, getDirettivo, setRole into addRole, changes... (#16)
* feat: support multiple roles in tg.permission table * feat: add getDirettivo route * build: generate db migration * fix(getRole): if no role, returns `["user"]` instead of `user` * fix(getDirettivo): better output shape * fix: varchar is bullshit, switching to text TODO: maybe merge the two DB migrations into one * fix: add back logic commented out * feat: not role is now null instead of 'user' * refactor: query optimization, removing DUPLICATE_ROLE error * feat: removeRole procedure * release: v0.11.0
1 parent d3ba574 commit b6d0b67

File tree

9 files changed

+1836
-35
lines changed

9 files changed

+1836
-35
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "tg_permissions" RENAME COLUMN "role" TO "roles";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE "tg_permissions" ALTER COLUMN "roles" DROP DEFAULT;--> statement-breakpoint
2+
ALTER TABLE "tg_permissions" ALTER COLUMN "roles" SET DATA TYPE text[] USING roles::text[];--> statement-breakpoint
3+
ALTER TABLE "tg_permissions" ALTER COLUMN "roles" SET DEFAULT '{"admin"}';

0 commit comments

Comments
 (0)