diff options
| author | Yash <[email protected]> | 2024-04-11 04:52:44 +0000 |
|---|---|---|
| committer | Yash <[email protected]> | 2024-04-11 04:52:44 +0000 |
| commit | 6dcc7d18c9be5e3a5e0a3ff60668424ee0158b4e (patch) | |
| tree | 179aa936536510cc707368fc7c330c4c7fbdc3f8 /apps/web/src/server/db/schema.ts | |
| parent | novel editor (diff) | |
| parent | save user ID with url to ensure that same website can be saved by users (diff) | |
| download | supermemory-new-ui.tar.xz supermemory-new-ui.zip | |
Merge branch 'main' of https://github.com/Dhravya/supermemory into new-uinew-ui
Diffstat (limited to 'apps/web/src/server/db/schema.ts')
| -rw-r--r-- | apps/web/src/server/db/schema.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/web/src/server/db/schema.ts b/apps/web/src/server/db/schema.ts index a80eb7cf..e0ddbdbc 100644 --- a/apps/web/src/server/db/schema.ts +++ b/apps/web/src/server/db/schema.ts @@ -6,7 +6,7 @@ import { sqliteTableCreator, text, integer, - unique + unique, } from "drizzle-orm/sqlite-core"; export const createTable = sqliteTableCreator((name) => `${name}`); @@ -78,7 +78,6 @@ export const verificationTokens = createTable( }), ); - export const storedContent = createTable( "storedContent", { @@ -103,8 +102,12 @@ export const storedContent = createTable( export const contentToSpace = createTable( "contentToSpace", { - contentId: integer("contentId").notNull().references(() => storedContent.id), - spaceId: integer("spaceId").notNull().references(() => space.id), + contentId: integer("contentId") + .notNull() + .references(() => storedContent.id), + spaceId: integer("spaceId") + .notNull() + .references(() => space.id), }, (cts) => ({ compoundKey: primaryKey({ columns: [cts.contentId, cts.spaceId] }), @@ -115,7 +118,7 @@ export const space = createTable( "space", { id: integer("id").notNull().primaryKey({ autoIncrement: true }), - name: text('name').notNull().default('all'), + name: text("name").notNull().default("all"), user: text("user", { length: 255 }).references(() => users.id), }, (space) => ({ @@ -124,4 +127,4 @@ export const space = createTable( }), ); -export type StoredContent = Omit<typeof storedContent.$inferSelect, 'user'>
\ No newline at end of file +export type StoredContent = Omit<typeof storedContent.$inferSelect, "user">; |