diff options
| author | Dhravya <[email protected]> | 2024-07-01 20:32:50 -0500 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-07-01 20:32:50 -0500 |
| commit | 46dfc3b4e7ac5958251401a670c1f4cff49706bb (patch) | |
| tree | f9baefd7dfd4cac46ef09cfc8349131e6235dfe1 /apps/web/server | |
| parent | spaces function (diff) | |
| download | supermemory-46dfc3b4e7ac5958251401a670c1f4cff49706bb.tar.xz supermemory-46dfc3b4e7ac5958251401a670c1f4cff49706bb.zip | |
shareable spaces
Diffstat (limited to 'apps/web/server')
| -rw-r--r-- | apps/web/server/db/schema.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/web/server/db/schema.ts b/apps/web/server/db/schema.ts index 01cf202d..979b5152 100644 --- a/apps/web/server/db/schema.ts +++ b/apps/web/server/db/schema.ts @@ -161,6 +161,21 @@ export const space = createTable( }), ); +export const spacesAccess = createTable( + "spacesAccess", + { + spaceId: integer("spaceId") + .notNull() + .references(() => space.id, { onDelete: "cascade" }), + userEmail: text("userEmail").notNull(), + }, + (spaceAccess) => ({ + compoundKey: primaryKey({ + columns: [spaceAccess.spaceId, spaceAccess.userEmail], + }), + }), +); + export type StoredContent = Omit<typeof storedContent.$inferSelect, "user">; export type StoredSpace = typeof space.$inferSelect; export type ChachedSpaceContent = StoredContent & { |