WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node typescript hono htmx atproto
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(appview): embed data migration into 0012 postgres migration

Copy permissions array into role_permissions join table inside the same
migration that drops the column. ON CONFLICT DO NOTHING keeps the script
idempotent for DBs that already ran migrate-permissions.ts manually.

Malpercio d4394af2 09485e22

+9
+9
apps/appview/drizzle/0012_acoustic_swordsman.sql
··· 1 + -- Copy permissions array into the join table before dropping the source column. 2 + -- ON CONFLICT DO NOTHING makes this idempotent: safe to run on a DB where the 3 + -- data was already migrated manually (e.g. via scripts/migrate-permissions.ts). 4 + INSERT INTO "role_permissions" ("role_id", "permission") 5 + SELECT id, unnest(permissions) 6 + FROM "roles" 7 + WHERE permissions IS NOT NULL AND cardinality(permissions) > 0 8 + ON CONFLICT DO NOTHING; 9 + 1 10 ALTER TABLE "roles" DROP COLUMN "permissions";