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.

feat(db): add role_permissions table to Postgres schema (permissions column still present)

Malpercio c54eca02 54e33bc4

+15
+15
packages/db/src/schema.ts
··· 8 8 bigint, 9 9 uniqueIndex, 10 10 index, 11 + primaryKey, 11 12 } from "drizzle-orm/pg-core"; 12 13 import { sql } from "drizzle-orm"; 13 14 ··· 212 213 index("roles_did_idx").on(table.did), 213 214 index("roles_did_name_idx").on(table.did, table.name), 214 215 ] 216 + ); 217 + 218 + // ── role_permissions ───────────────────────────────────────────────────────── 219 + // Normalized join table replacing the permissions text[] column. 220 + // Cascade delete ensures permissions are cleaned up when a role is deleted. 221 + export const rolePermissions = pgTable( 222 + "role_permissions", 223 + { 224 + roleId: bigint("role_id", { mode: "bigint" }) 225 + .notNull() 226 + .references(() => roles.id, { onDelete: "cascade" }), 227 + permission: text("permission").notNull(), 228 + }, 229 + (t) => [primaryKey({ columns: [t.roleId, t.permission] })] 215 230 ); 216 231 217 232 // ── backfill_progress ───────────────────────────────────