From aa7d68a00cbe9d7d3733f4cd02061d4586af061c Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Tue, 19 Mar 2024 02:21:54 +0000 Subject: refactor: Change asset storage to be the filesystem instead of sqlite --- packages/db/schema.ts | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'packages/db/schema.ts') diff --git a/packages/db/schema.ts b/packages/db/schema.ts index 769632d9..abfb374b 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -2,7 +2,6 @@ import type { AdapterAccount } from "@auth/core/adapters"; import { createId } from "@paralleldrive/cuid2"; import { relations } from "drizzle-orm"; import { - blob, index, integer, primaryKey, @@ -158,9 +157,7 @@ export const bookmarkAssets = sqliteTable("bookmarkAssets", { .$defaultFn(() => createId()) .references(() => bookmarks.id, { onDelete: "cascade" }), assetType: text("assetType", { enum: ["image"] }).notNull(), - assetId: text("assetId") - .notNull() - .references(() => assets.id, { onDelete: "cascade" }), + assetId: text("assetId").notNull(), }); export const bookmarkTags = sqliteTable( @@ -225,26 +222,6 @@ export const bookmarkLists = sqliteTable( }), ); -export const assets = sqliteTable( - "assets", - { - id: text("id") - .notNull() - .primaryKey() - .$defaultFn(() => createId()), - userId: text("userId") - .notNull() - .references(() => users.id, { onDelete: "cascade" }), - createdAt: createdAtField(), - contentType: text("contentType").notNull(), - encoding: text("encoding", { enum: ["binary"] }).notNull(), - blob: blob("blob").notNull(), - }, - (a) => ({ - userIdIdx: index("assets_userId_idx").on(a.userId), - }), -); - export const bookmarksInLists = sqliteTable( "bookmarksInLists", { -- cgit v1.2.3-70-g09d2