diff --git a/packages/db/drizzle/0037_sturdy_leper_queen.sql b/packages/db/drizzle/0037_sturdy_leper_queen.sql deleted file mode 100644 index e3d187ea..00000000 --- a/packages/db/drizzle/0037_sturdy_leper_queen.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE `bookmarkEmbeddings` ( - `id` text PRIMARY KEY NOT NULL, - `bookmarkId` text NOT NULL, - `userId` text NOT NULL, - `embedding` text NOT NULL, - `embeddingType` text NOT NULL, - `fromOffset` integer, - `toOffset` integer, - FOREIGN KEY (`bookmarkId`) REFERENCES `bookmarks`(`id`) ON UPDATE no action ON DELETE cascade, - FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade -); ---> statement-breakpoint -CREATE INDEX `bookmarkEmbeddings_bookmarkId_idx` ON `bookmarkEmbeddings` (`bookmarkId`);--> statement-breakpoint -CREATE INDEX `bookmarkEmbeddings_userId_idx` ON `bookmarkEmbeddings` (`userId`); \ No newline at end of file diff --git a/packages/db/schema.ts b/packages/db/schema.ts index 485713f7..19bf6db5 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -252,32 +252,6 @@ export const bookmarkAssets = sqliteTable("bookmarkAssets", { sourceUrl: text("sourceUrl"), }); -export const bookmarkEmbeddings = sqliteTable( - "bookmarkEmbeddings", - { - id: text("id") - .notNull() - .primaryKey() - .$defaultFn(() => createId()), - bookmarkId: text("bookmarkId") - .notNull() - .references(() => bookmarks.id, { onDelete: "cascade" }), - userId: text("userId") - .notNull() - .references(() => users.id, { onDelete: "cascade" }), - embedding: text("embedding").notNull(), - embeddingType: text("embeddingType", { - enum: ["description", "content_full", "content_chunk"], - }).notNull(), - fromOffset: integer("fromOffset"), - toOffset: integer("toOffset"), - }, - (tb) => ({ - bookmarkIdIdx: index("bookmarkEmbeddings_bookmarkId_idx").on(tb.bookmarkId), - userIdIdx: index("bookmarkEmbeddings_userId_idx").on(tb.userId), - }), -); - export const bookmarkTags = sqliteTable( "bookmarkTags", {