From 39003aff23d64ff1d96074d71521f6023c9bec01 Mon Sep 17 00:00:00 2001 From: Mahesh Sanikommmu Date: Sat, 16 Aug 2025 18:50:10 -0700 Subject: [PATCH] New Version of Supermemory Consumer App --- .cursorrules | 1 - .gitignore | 41 +- .gitmodules | 0 .npmrc | 2 - .vscode/settings.json | 17 - CLAUDE.md | 119 ++ Dockerfile | 37 - README.md | 132 +- SELF-HOSTING-GUIDE.md | 90 - apps/backend/.gitignore | 35 - apps/backend/README.md | 8 - apps/backend/drizzle.config.prod.ts | 10 - apps/backend/drizzle.config.ts | 18 - .../drizzle/0000_odd_impossible_man.sql | 189 -- apps/backend/drizzle/0001_seed-types.sql | 3 - .../drizzle/0002_skinny_princess_powerful.sql | 2 - .../drizzle/0003_luxuriant_annihilus.sql | 3 - .../backend/drizzle/0004_early_rick_jones.sql | 19 - .../drizzle/0005_create-access-types.sql | 2 - .../drizzle/0006_wandering_grandmaster.sql | 3 - .../0007_fantastic_serpent_society.sql | 1 - apps/backend/drizzle/0008_add-notion.sql | 2 - .../drizzle/0009_milky_sleepwalker.sql | 1 - apps/backend/drizzle/0010_heavy_preak.sql | 7 - apps/backend/drizzle/0011_new_liz_osborn.sql | 1 - apps/backend/drizzle/0012_small_mystique.sql | 2 - apps/backend/drizzle/0013_sharp_hemingway.sql | 1 - .../drizzle/0014_mighty_the_captain.sql | 2 - .../backend/drizzle/0015_perpetual_mauler.sql | 1 - apps/backend/drizzle/0016_good_deathbird.sql | 7 - apps/backend/drizzle/0018_past_inertia.sql | 7 - .../0019_vengeful_marten_broadcloak.sql | 1 - .../drizzle/0020_opposite_steel_serpent.sql | 2 - apps/backend/drizzle/meta/0000_snapshot.json | 1060 ----------- apps/backend/drizzle/meta/0001_snapshot.json | 1060 ----------- apps/backend/drizzle/meta/0002_snapshot.json | 1067 ----------- apps/backend/drizzle/meta/0003_snapshot.json | 1095 ----------- apps/backend/drizzle/meta/0004_snapshot.json | 1173 ------------ apps/backend/drizzle/meta/0005_snapshot.json | 1173 ------------ apps/backend/drizzle/meta/0006_snapshot.json | 1189 ------------ apps/backend/drizzle/meta/0007_snapshot.json | 1168 ------------ apps/backend/drizzle/meta/0008_snapshot.json | 1168 ------------ apps/backend/drizzle/meta/0009_snapshot.json | 1175 ------------ apps/backend/drizzle/meta/0010_snapshot.json | 1175 ------------ apps/backend/drizzle/meta/0011_snapshot.json | 1181 ------------ apps/backend/drizzle/meta/0012_snapshot.json | 1188 ------------ apps/backend/drizzle/meta/0013_snapshot.json | 1194 ------------ apps/backend/drizzle/meta/0014_snapshot.json | 1207 ------------ apps/backend/drizzle/meta/0015_snapshot.json | 1207 ------------ apps/backend/drizzle/meta/0016_snapshot.json | 1222 ------------ apps/backend/drizzle/meta/0017_snapshot.json | 1222 ------------ apps/backend/drizzle/meta/0018_snapshot.json | 1222 ------------ apps/backend/drizzle/meta/0019_snapshot.json | 1228 ------------- apps/backend/drizzle/meta/0020_snapshot.json | 1127 ------------ apps/backend/drizzle/meta/_journal.json | 146 -- apps/backend/package.json | 36 - apps/backend/public/favicon.ico | Bin 15406 -> 0 bytes apps/backend/public/output.css | 853 --------- apps/backend/scripts/migrate.ts | 37 - apps/backend/src/auth.ts | 151 -- apps/backend/src/components/landing.tsx | 234 --- apps/backend/src/errors/baseError.ts | 45 - apps/backend/src/errors/results.ts | 31 - apps/backend/src/globals.css | 3 - apps/backend/src/index.tsx | 255 --- apps/backend/src/providers.ts | 19 - apps/backend/src/routes/actions.ts | 1171 ------------ apps/backend/src/routes/integrations.ts | 180 -- apps/backend/src/routes/memories.ts | 293 --- apps/backend/src/routes/spaces.ts | 709 ------- apps/backend/src/routes/user.ts | 193 -- apps/backend/src/types.ts | 79 - apps/backend/src/utils/chunkers.ts | 116 -- apps/backend/src/utils/cipher.ts | 79 - .../src/utils/extractDocumentContent.ts | 87 - apps/backend/src/utils/extractor.ts | 50 - apps/backend/src/utils/fetchers.ts | 143 -- apps/backend/src/utils/notion.ts | 239 --- apps/backend/src/utils/tweetsToThreads.ts | 108 -- apps/backend/src/utils/typeDecider.ts | 41 - apps/backend/src/workflow/index.ts | 217 --- apps/backend/tailwind.config.js | 9 - apps/backend/tsconfig.json | 16 - apps/backend/types.d.ts | 3 - apps/backend/wrangler.toml | 55 - apps/docs/README.md | 32 - .../endpoints/connect/connect-app.mdx | 10 - .../connect/connection-information.mdx | 5 - .../memory-management/delete-delete.mdx | 3 - .../endpoints/memory-management/post-add.mdx | 59 - .../memory-management/put-update.mdx | 7 - .../endpoints/search/get-fastsearch.mdx | 5 - .../endpoints/search/post-search.mdx | 12 - .../docs/api-reference/endpoints/settings.mdx | 3 - apps/docs/changelog/overview.mdx | 12 - apps/docs/essentials/metadata-filtering.mdx | 78 - apps/docs/essentials/pricing.mdx | 47 - apps/docs/favicon.png | Bin 23616 -> 0 bytes apps/docs/image.png | Bin 79915 -> 0 bytes apps/docs/images/checks-passed.png | Bin 160724 -> 0 bytes apps/docs/images/hero-dark.svg | 32 - apps/docs/images/hero-light.svg | 32 - apps/docs/images/setup/1.png | Bin 1017363 -> 0 bytes apps/docs/images/setup/2.png | Bin 653266 -> 0 bytes apps/docs/images/setup/3.png | Bin 660688 -> 0 bytes apps/docs/introduction.mdx | 156 -- apps/docs/logo/dark.svg | 3 - apps/docs/logo/light.svg | 3 - apps/docs/mint.json | 75 - apps/docs/openapi.json | 625 ------- apps/docs/quickstart.mdx | 59 - apps/docs/self-hosting.mdx | 94 - apps/docs/snippets/snippet-intro.mdx | 1 - apps/extension/.gitignore | 27 - apps/extension/README.md | 3 - apps/extension/components.json | 21 - apps/extension/css/globals.css | 59 - apps/extension/extension-env.d.ts | 9 - apps/extension/images/icon/128.png | Bin 14307 -> 0 bytes apps/extension/images/icon/16.png | Bin 543 -> 0 bytes apps/extension/images/icon/32.png | Bin 1462 -> 0 bytes apps/extension/images/icon/48.png | Bin 2836 -> 0 bytes apps/extension/images/icon/favicon.ico | Bin 15406 -> 0 bytes apps/extension/lib/utils.ts | 20 - apps/extension/manifest.json | 37 - apps/extension/package.json | 38 - apps/extension/postcss.config.js | 6 - apps/extension/public/globals.css | 1632 ----------------- apps/extension/public/logo.svg | 11 - apps/extension/scripts/content.tsx | 64 - apps/extension/scripts/css.tsx | 1584 ---------------- apps/extension/src/background.ts | 225 --- apps/extension/src/content.tsx | 350 ---- apps/extension/src/helpers.ts | 65 - apps/extension/src/twitter.constants.ts | 32 - apps/extension/src/twitter.ts | 470 ----- apps/extension/tailwind.config.cjs | 50 - apps/extension/tsconfig.json | 22 - apps/extension/ui/hooks/use-spaces.tsx | 147 -- apps/extension/ui/shadcn/badge.tsx | 36 - apps/extension/ui/shadcn/button.tsx | 57 - apps/extension/ui/shadcn/command.tsx | 151 -- apps/extension/ui/shadcn/dialog.tsx | 122 -- apps/extension/ui/shadcn/popover.tsx | 31 - apps/extension/ui/spaces-selector.tsx | 217 --- apps/web/.env.example | 2 + apps/web/.gitignore | 45 +- apps/web/.prettierrc | 19 - apps/web/README.md | 48 +- apps/web/app/(auth)/login/page.tsx | 12 + apps/web/app/api/emails/welcome/route.tsx | 19 + apps/web/app/components/Chat.tsx | 329 ---- apps/web/app/components/ChatInputForm.tsx | 502 ----- apps/web/app/components/Histories.tsx | 42 - apps/web/app/components/Landing/Feature.tsx | 157 -- apps/web/app/components/Landing/Footer.tsx | 142 -- apps/web/app/components/Landing/Hero.tsx | 299 --- apps/web/app/components/Landing/Note.tsx | 73 - apps/web/app/components/Landing/Private.tsx | 62 - apps/web/app/components/Landing/index.tsx | 17 - apps/web/app/components/Landing/plus-grid.tsx | 88 - apps/web/app/components/Navbar.tsx | 155 -- apps/web/app/components/Reminders.tsx | 354 ---- apps/web/app/components/Suggestions.tsx | 43 - .../app/components/editor/plate-editor.tsx | 20 - apps/web/app/components/editor/plate-types.ts | 221 --- .../components/editor/plugins/ai-plugins.tsx | 195 -- .../components/editor/plugins/align-plugin.ts | 17 - .../editor/plugins/autoformat-plugin.ts | 273 --- .../editor/plugins/basic-nodes-plugins.tsx | 14 - .../editor/plugins/block-menu-plugins.ts | 14 - .../editor/plugins/block-selection-plugins.ts | 23 - .../editor/plugins/comments-plugin.tsx | 24 - .../editor/plugins/copilot-plugins.ts | 60 - .../editor/plugins/delete-plugins.ts | 20 - .../components/editor/plugins/dnd-plugins.tsx | 22 - .../editor/plugins/editor-plugins.tsx | 100 - .../editor/plugins/exit-break-plugin.ts | 28 - .../editor/plugins/fixed-toolbar-plugin.tsx | 17 - .../plugins/floating-toolbar-plugin.tsx | 17 - .../editor/plugins/indent-list-plugins.ts | 57 - .../editor/plugins/line-height-plugin.ts | 15 - .../components/editor/plugins/link-plugin.tsx | 9 - .../editor/plugins/media-plugins.tsx | 30 - .../editor/plugins/mention-plugin.ts | 7 - .../editor/plugins/reset-block-type-plugin.ts | 63 - .../editor/plugins/soft-break-plugin.ts | 30 - .../components/editor/plugins/table-plugin.ts | 9 - .../components/editor/plugins/toc-plugin.ts | 10 - apps/web/app/components/editor/transforms.ts | 206 --- apps/web/app/components/editor/use-chat.tsx | 270 --- .../components/editor/use-create-editor.tsx | 137 -- .../components/editor/writing-playground.tsx | 242 --- .../app/components/gradients/gradient1.png | Bin 420630 -> 0 bytes .../app/components/icons/IntegrationIcons.tsx | 70 - apps/web/app/components/icons/Logo.tsx | 14 - .../web/app/components/markdown/codeblock.tsx | 40 - apps/web/app/components/markdown/renderer.tsx | 10 - .../web/app/components/memories/AddMemory.tsx | 583 ------ .../components/memories/CSVUploadModal.tsx | 267 --- .../app/components/memories/Integrations.tsx | 697 ------- .../memories/MarkdownUploadModal.tsx | 294 --- .../app/components/memories/MemoriesPage.tsx | 423 ----- .../app/components/memories/SharedCard.tsx | 892 --------- .../components/memories/SpacesSelector.tsx | 134 -- .../components/plate-ui/ai-chat-editor.tsx | 54 - apps/web/app/components/plate-ui/ai-leaf.tsx | 24 - .../app/components/plate-ui/ai-menu-items.tsx | 301 --- apps/web/app/components/plate-ui/ai-menu.tsx | 165 -- .../components/plate-ui/ai-toolbar-button.tsx | 30 - .../plate-ui/align-dropdown-menu.tsx | 75 - apps/web/app/components/plate-ui/avatar.tsx | 19 - .../plate-ui/block-context-menu.tsx | 206 --- .../components/plate-ui/block-selection.tsx | 42 - .../plate-ui/blockquote-element.tsx | 22 - apps/web/app/components/plate-ui/button.tsx | 57 - apps/web/app/components/plate-ui/calendar.tsx | 68 - apps/web/app/components/plate-ui/caption.tsx | 48 - apps/web/app/components/plate-ui/checkbox.tsx | 26 - .../plate-ui/code-block-combobox.tsx | 202 -- .../plate-ui/code-block-element.css | 404 ---- .../plate-ui/code-block-element.tsx | 39 - .../web/app/components/plate-ui/code-leaf.tsx | 24 - .../components/plate-ui/code-line-element.tsx | 10 - .../components/plate-ui/code-syntax-leaf.tsx | 20 - .../components/plate-ui/color-constants.ts | 436 ----- .../plate-ui/color-dropdown-menu-items.tsx | 111 -- .../plate-ui/color-dropdown-menu.tsx | 58 - .../app/components/plate-ui/color-input.tsx | 31 - .../app/components/plate-ui/color-picker.tsx | 78 - .../app/components/plate-ui/colors-custom.tsx | 73 - .../components/plate-ui/column-element.tsx | 34 - .../plate-ui/column-group-element.tsx | 186 -- apps/web/app/components/plate-ui/command.tsx | 88 - .../components/plate-ui/comment-avatar.tsx | 22 - .../plate-ui/comment-create-form.tsx | 37 - .../app/components/plate-ui/comment-item.tsx | 74 - .../app/components/plate-ui/comment-leaf.tsx | 49 - .../plate-ui/comment-more-dropdown.tsx | 44 - .../plate-ui/comment-reply-items.tsx | 22 - .../plate-ui/comment-resolve-button.tsx | 31 - .../plate-ui/comment-toolbar-button.tsx | 20 - .../app/components/plate-ui/comment-value.tsx | 34 - .../components/plate-ui/comments-popover.tsx | 63 - .../app/components/plate-ui/context-menu.tsx | 229 --- .../components/plate-ui/cursor-overlay.tsx | 64 - .../app/components/plate-ui/date-element.tsx | 85 - apps/web/app/components/plate-ui/dialog.tsx | 62 - .../web/app/components/plate-ui/draggable.tsx | 187 -- .../app/components/plate-ui/dropdown-menu.tsx | 240 --- apps/web/app/components/plate-ui/editor.tsx | 114 -- .../plate-ui/emoji-picker-navigation.tsx | 105 -- .../plate-ui/emoji-picker-preview.tsx | 73 - .../emoji-picker-search-and-clear.tsx | 46 - .../plate-ui/emoji-picker-search-bar.tsx | 33 - .../app/components/plate-ui/emoji-picker.tsx | 79 - .../plate-ui/emoji-toolbar-dropdown.tsx | 29 - .../plate-ui/excalidraw-element.tsx | 30 - .../plate-ui/fixed-toolbar-buttons.tsx | 147 -- .../app/components/plate-ui/fixed-toolbar.tsx | 10 - .../plate-ui/floating-toolbar-buttons.tsx | 91 - .../components/plate-ui/floating-toolbar.tsx | 83 - .../app/components/plate-ui/ghost-text.tsx | 37 - .../components/plate-ui/heading-element.tsx | 40 - .../components/plate-ui/highlight-leaf.tsx | 19 - .../app/components/plate-ui/hr-element.tsx | 32 - .../app/components/plate-ui/image-element.tsx | 80 - .../app/components/plate-ui/image-preview.tsx | 149 -- .../plate-ui/indent-fire-marker.tsx | 22 - .../plate-ui/indent-list-toolbar-button.tsx | 35 - .../plate-ui/indent-todo-marker.tsx | 41 - .../plate-ui/indent-todo-toolbar-button.tsx | 23 - .../plate-ui/indent-toolbar-button.tsx | 21 - .../components/plate-ui/inline-combobox.tsx | 405 ---- apps/web/app/components/plate-ui/input.tsx | 25 - .../plate-ui/insert-dropdown-menu.tsx | 261 --- apps/web/app/components/plate-ui/kbd-leaf.tsx | 22 - .../plate-ui/line-height-dropdown-menu.tsx | 55 - .../app/components/plate-ui/link-element.tsx | 33 - .../plate-ui/link-floating-toolbar.tsx | 162 -- .../plate-ui/link-toolbar-button.tsx | 29 - .../plate-ui/mark-toolbar-button.tsx | 24 - .../plate-ui/media-embed-element.tsx | 132 -- .../app/components/plate-ui/media-popover.tsx | 98 - .../plate-ui/media-toolbar-button.tsx | 28 - .../components/plate-ui/mention-element.tsx | 63 - .../plate-ui/mention-input-element.tsx | 146 -- .../plate-ui/mode-dropdown-menu.tsx | 92 - .../plate-ui/more-dropdown-menu.tsx | 101 - .../plate-ui/outdent-toolbar-button.tsx | 21 - .../components/plate-ui/paragraph-element.tsx | 22 - .../app/components/plate-ui/placeholder.tsx | 54 - .../app/components/plate-ui/plate-element.tsx | 26 - apps/web/app/components/plate-ui/popover.tsx | 31 - .../web/app/components/plate-ui/resizable.tsx | 66 - .../web/app/components/plate-ui/separator.tsx | 25 - .../plate-ui/slash-input-element.tsx | 242 --- .../plate-ui/table-cell-element.tsx | 152 -- .../plate-ui/table-dropdown-menu.tsx | 160 -- .../app/components/plate-ui/table-element.tsx | 330 ---- .../components/plate-ui/table-row-element.tsx | 24 - .../app/components/plate-ui/toc-element.tsx | 65 - .../components/plate-ui/toggle-element.tsx | 44 - .../plate-ui/toggle-toolbar-button.tsx | 25 - apps/web/app/components/plate-ui/toolbar.tsx | 157 -- apps/web/app/components/plate-ui/tooltip.tsx | 86 - .../plate-ui/turn-into-dropdown-menu.tsx | 165 -- .../components/plate-ui/with-draggables.tsx | 148 -- .../skeletons/HistoriesSkeleton.tsx | 26 - .../skeletons/SuggestionsSkeleton.tsx | 17 - apps/web/app/components/theme-button.tsx | 15 - .../web/app/components/twitter/avatar-img.tsx | 9 - .../components/twitter/icons/icons.module.css | 9 - .../web/app/components/twitter/icons/index.ts | 3 - .../twitter/icons/verified-business.tsx | 48 - .../twitter/icons/verified-government.tsx | 13 - .../app/components/twitter/icons/verified.tsx | 9 - .../quoted-tweet/quoted-tweet-body.module.css | 9 - .../quoted-tweet/quoted-tweet-body.tsx | 13 - .../quoted-tweet-container.module.css | 19 - .../quoted-tweet/quoted-tweet-container.tsx | 18 - .../quoted-tweet-header.module.css | 38 - .../quoted-tweet/quoted-tweet-header.tsx | 37 - .../twitter/quoted-tweet/quoted-tweet.tsx | 16 - .../app/components/twitter/render-tweet.tsx | 198 -- .../components/twitter/tweet-body.module.css | 8 - .../twitter/tweet-container.module.css | 25 - .../twitter/tweet-header.module.css | 96 - .../twitter/tweet-in-reply-to.module.css | 13 - .../components/twitter/tweet-link.module.css | 10 - .../twitter/tweet-media-video.module.css | 70 - .../components/twitter/tweet-media-video.tsx | 97 - .../components/twitter/tweet-media.module.css | 53 - .../app/components/twitter/tweet-media.tsx | 87 - .../twitter/verified-badge.module.css | 10 - .../app/components/twitter/verified-badge.tsx | 33 - apps/web/app/components/ui/Loader.tsx | 19 - apps/web/app/components/ui/avatar.tsx | 48 - apps/web/app/components/ui/badge.tsx | 36 - apps/web/app/components/ui/button.tsx | 59 - apps/web/app/components/ui/card.tsx | 76 - apps/web/app/components/ui/checkbox.tsx | 28 - apps/web/app/components/ui/combobox.tsx | 102 -- apps/web/app/components/ui/command.tsx | 143 -- apps/web/app/components/ui/credenza.tsx | 146 -- apps/web/app/components/ui/dialog.tsx | 102 -- apps/web/app/components/ui/drawer.tsx | 116 -- apps/web/app/components/ui/dropdown-menu.tsx | 203 -- apps/web/app/components/ui/input.tsx | 22 - apps/web/app/components/ui/label.tsx | 24 - apps/web/app/components/ui/popover.tsx | 31 - apps/web/app/components/ui/select.tsx | 150 -- apps/web/app/components/ui/switch.tsx | 27 - apps/web/app/components/ui/tabs.tsx | 53 - apps/web/app/components/ui/textarea.tsx | 23 - apps/web/app/config/integrations.tsx | 203 -- apps/web/app/config/util.ts | 11 - apps/web/app/entry.client.tsx | 15 - apps/web/app/entry.server.tsx | 57 - apps/web/app/icon.png | Bin 0 -> 590 bytes apps/web/app/layout.tsx | 69 + apps/web/app/lib/auth/authMiddleware.ts | 45 - apps/web/app/lib/constants/pastelColors.tsx | 9 - apps/web/app/lib/constants/typeIcons.tsx | 57 - apps/web/app/lib/env.server.ts | 19 - apps/web/app/lib/environment.ts | 15 - apps/web/app/lib/hooks/use-auto-scroll.ts | 62 - apps/web/app/lib/hooks/use-chat-stream.ts | 85 - apps/web/app/lib/hooks/use-debounce.ts | 18 - .../lib/hooks/use-fetcher-with-promise.tsx | 44 - apps/web/app/lib/hooks/use-is-touch-device.ts | 26 - apps/web/app/lib/hooks/use-keyboard.tsx | 101 - .../web/app/lib/hooks/use-live-transcript.tsx | 132 -- apps/web/app/lib/hooks/use-media-query.tsx | 19 - apps/web/app/lib/hooks/use-memories.tsx | 276 --- apps/web/app/lib/hooks/use-mounted.ts | 11 - apps/web/app/lib/hooks/use-spaces.tsx | 135 -- apps/web/app/lib/hooks/use-text-overflow.ts | 22 - apps/web/app/lib/hooks/use-upload-file.ts | 30 - apps/web/app/lib/misc.ts | 20 - apps/web/app/lib/stripe.constants.ts | 39 - apps/web/app/lib/stripe.ts | 70 - apps/web/app/lib/theme-provider.tsx | 133 -- apps/web/app/lib/theme.server.ts | 28 - apps/web/app/lib/types/memory.ts | 12 - apps/web/app/lib/types/safety.ts | 8 - apps/web/app/lib/utils.ts | 6 - apps/web/app/lib/utils/metadata.ts | 5 - apps/web/app/lib/utils/tweet.ts | 22 - apps/web/app/manifest.ts | 20 + apps/web/app/not-found.tsx | 27 + apps/web/app/opengraph-image.png | Bin 0 -> 536316 bytes apps/web/app/page.tsx | 681 +++++++ apps/web/app/ref/[code]/page.tsx | 227 +++ apps/web/app/ref/page.tsx | 58 + apps/web/app/root.tsx | 191 -- apps/web/app/routes/_index.tsx | 250 --- apps/web/app/routes/action.chat.tsx | 60 - apps/web/app/routes/action.set-theme.tsx | 23 - apps/web/app/routes/action.sign-out.tsx | 10 - apps/web/app/routes/action.upload.tsx | 69 - apps/web/app/routes/callback.ts | 5 - apps/web/app/routes/chat.$chatId.tsx | 55 - apps/web/app/routes/chat.new.tsx | 42 - apps/web/app/routes/content.$contentid.tsx | 277 --- apps/web/app/routes/editor.tsx | 13 - apps/web/app/routes/extension.ts | 7 - apps/web/app/routes/home.tsx | 5 - apps/web/app/routes/onboarding.add.tsx | 245 --- apps/web/app/routes/onboarding.import.tsx | 171 -- apps/web/app/routes/onboarding.index.tsx | 91 - apps/web/app/routes/onboarding.privacy.tsx | 92 - apps/web/app/routes/pay.stripe.callback.tsx | 21 - apps/web/app/routes/pay.stripe.tsx | 93 - apps/web/app/routes/pay.stripe.webhook.tsx | 69 - apps/web/app/routes/pitch.index.tsx | 93 - apps/web/app/routes/pricing.index.tsx | 253 --- apps/web/app/routes/privacy.tsx | 71 - apps/web/app/routes/ref.tsx | 25 - apps/web/app/routes/signin.tsx | 9 - apps/web/app/routes/space.$spaceId.tsx | 388 ---- .../routes/space.($spaceId).invitation.tsx | 123 -- apps/web/app/routes/tos.tsx | 57 - apps/web/app/sonner.css | 656 ------- apps/web/app/tailwind.css | 253 --- apps/web/app/types/css.d.ts | 9 - apps/web/app/types/stripe.d.ts | 10 - apps/web/app/waitlist/page.tsx | 218 +++ apps/web/assets/logo.svg | 11 - apps/web/biome.json | 10 + apps/web/button.tsx | 58 + apps/web/components.json | 38 +- apps/web/components/connect-ai-modal.tsx | 219 +++ apps/web/components/create-project-dialog.tsx | 119 ++ apps/web/components/glass-menu-effect.tsx | 37 + apps/web/components/install-prompt.tsx | 118 ++ apps/web/components/memory-list-view.tsx | 802 ++++++++ apps/web/components/menu.tsx | 618 +++++++ apps/web/components/project-selector.tsx | 566 ++++++ .../web/components/referral-upgrade-modal.tsx | 290 +++ apps/web/components/spinner.tsx | 8 + apps/web/components/text-shimmer.tsx | 57 + apps/web/components/tour.tsx | 413 +++++ apps/web/components/views/add-memory.tsx | 1425 ++++++++++++++ apps/web/components/views/billing.tsx | 261 +++ .../components/views/chat/chat-messages.tsx | 322 ++++ apps/web/components/views/chat/index.tsx | 124 ++ .../views/connections-tab-content.tsx | 382 ++++ apps/web/components/views/mcp/index.tsx | 311 ++++ .../views/mcp/installation-dialog-content.tsx | 79 + apps/web/components/views/profile.tsx | 266 +++ apps/web/components/views/projects.tsx | 742 ++++++++ apps/web/env.d.ts | 8 - apps/web/eslint.config.mjs | 145 -- apps/web/functions/[[path]].ts | 6 - apps/web/functions/notion.ts | 0 apps/web/globals.css | 2 + apps/web/hooks/use-project-mutations.ts | 89 + apps/web/hooks/use-project-name.ts | 26 + apps/web/hooks/use-resize-observer.ts | 23 + apps/web/instrumentation-client.ts | 24 + apps/web/lib/analytics.ts | 44 + apps/web/lib/mobile-panel-context.tsx | 32 + apps/web/lib/tour-constants.ts | 23 + apps/web/lib/view-mode-context.tsx | 96 + apps/web/load-context.ts | 9 - apps/web/middleware.ts | 50 + apps/web/next.config.ts | 60 + apps/web/open-next.config.ts | 6 + apps/web/package.json | 264 +-- apps/web/postcss.config.js | 6 - apps/web/postcss.config.mjs | 5 + apps/web/public/_headers | 8 +- apps/web/public/_routes.json | 16 - apps/web/public/android-chrome-192x192.png | Bin 26861 -> 0 bytes apps/web/public/android-chrome-512x512.png | Bin 94061 -> 0 bytes apps/web/public/apple-touch-icon.png | Bin 23616 -> 0 bytes apps/web/public/favicon-16x16.png | Bin 601 -> 0 bytes apps/web/public/favicon-32x32.png | Bin 1545 -> 0 bytes apps/web/public/favicon.ico | Bin 15406 -> 0 bytes apps/web/public/images/login-carousel-1.png | Bin 0 -> 395589 bytes apps/web/public/images/login-carousel-2.png | Bin 0 -> 269962 bytes apps/web/public/images/logo.png | Bin 0 -> 102803 bytes apps/web/public/images/sidebar.png | Bin 0 -> 4777067 bytes apps/web/public/landing-page.jpeg | Bin 0 -> 694533 bytes .../web/public/mcp-supported-tools/claude.png | Bin 0 -> 54846 bytes apps/web/public/mcp-supported-tools/cline.png | Bin 0 -> 25126 bytes .../web/public/mcp-supported-tools/cursor.png | Bin 0 -> 104215 bytes .../public/mcp-supported-tools/gemini-cli.png | Bin 0 -> 21598 bytes .../web/public/mcp-supported-tools/vscode.png | Bin 0 -> 70640 bytes apps/web/public/og-image.png | Bin 36164 -> 0 bytes apps/web/public/product-of-the-day.png | Bin 79406 -> 0 bytes apps/web/public/siri.webp | Bin 10208 -> 0 bytes apps/web/public/site.webmanifest | 1 - apps/web/server/index.ts | 420 ----- apps/web/server/proxy.ts | 42 - apps/web/stores/chat.ts | 182 ++ apps/web/stores/highlights.ts | 32 + apps/web/stores/index.ts | 78 + apps/web/tailwind.config.ts | 92 - apps/web/tsconfig.json | 44 +- apps/web/vite.config.ts | 81 - apps/web/worker-configuration.d.ts | 33 - apps/web/wrangler.jsonc | 31 + apps/web/wrangler.toml | 27 - bun.lockb | Bin 0 -> 740848 bytes docker-compose.yml | 15 - package.json | 132 +- packages/db/index.ts | 46 - packages/db/package.json | 8 - packages/db/schema.ts | 264 --- packages/eslint-config/README.md | 3 + packages/eslint-config/base.js | 32 + packages/eslint-config/next.js | 49 + packages/eslint-config/package.json | 24 + packages/eslint-config/react-internal.js | 39 + packages/hooks/package.json | 5 + packages/hooks/tsconfig.json | 11 + packages/hooks/use-keypress.ts | 15 + packages/hooks/use-mobile.ts | 19 + packages/lib/api.ts | 208 +++ packages/lib/auth-context.tsx | 65 + packages/lib/auth.middleware.ts | 26 + packages/lib/auth.ts | 32 + packages/lib/constants.ts | 4 + packages/lib/error-tracking.tsx | 191 ++ packages/lib/generate-id.ts | 6 + packages/lib/glass-effect-manager.ts | 308 ++++ packages/lib/package.json | 12 + packages/lib/posthog.tsx | 84 + packages/lib/queries.ts | 86 + packages/lib/query-client.tsx | 27 + packages/lib/similarity.ts | 115 ++ packages/lib/tsconfig.json | 11 + packages/lib/utils.ts | 8 + packages/shared/icons.tsx | 64 - packages/shared/package.json | 12 - packages/shared/tsconfig.json | 15 - packages/shared/types.ts | 22 - packages/shared/utils.ts | 164 -- packages/typescript-config/base.json | 19 + packages/typescript-config/nextjs.json | 12 + packages/typescript-config/package.json | 9 + packages/typescript-config/react-library.json | 7 + packages/ui/assets/Logo.tsx | 51 + packages/ui/assets/icons.tsx | 208 +++ packages/ui/biome.json | 10 + packages/ui/button/external-auth.tsx | 29 + packages/ui/components.json | 20 + packages/ui/components/accordion.tsx | 65 + packages/ui/components/alert-dialog.tsx | 156 ++ packages/ui/components/avatar.tsx | 52 + packages/ui/components/badge.tsx | 45 + packages/ui/components/breadcrumb.tsx | 109 ++ packages/ui/components/button.tsx | 58 + packages/ui/components/card.tsx | 91 + packages/ui/components/carousel.tsx | 238 +++ packages/ui/components/chart.tsx | 353 ++++ packages/ui/components/checkbox.tsx | 31 + packages/ui/components/collapsible.tsx | 33 + packages/ui/components/combobox.tsx | 161 ++ packages/ui/components/command.tsx | 183 ++ packages/ui/components/dialog.tsx | 142 ++ packages/ui/components/drawer.tsx | 134 ++ packages/ui/components/dropdown-menu.tsx | 256 +++ packages/ui/components/input.tsx | 20 + packages/ui/components/label.tsx | 23 + packages/ui/components/popover.tsx | 47 + packages/ui/components/progress.tsx | 30 + packages/ui/components/scroll-area.tsx | 57 + packages/ui/components/select.tsx | 184 ++ packages/ui/components/separator.tsx | 27 + packages/ui/components/shadcn-io/dropzone.tsx | 202 ++ packages/ui/components/sheet.tsx | 138 ++ packages/ui/components/sidebar.tsx | 725 ++++++++ packages/ui/components/skeleton.tsx | 13 + packages/ui/components/sonner.tsx | 25 + packages/ui/components/table.tsx | 115 ++ packages/ui/components/tabs.tsx | 65 + packages/ui/components/text-separator.tsx | 24 + packages/ui/components/textarea.tsx | 17 + packages/ui/components/toggle-group.tsx | 72 + packages/ui/components/toggle.tsx | 46 + packages/ui/components/tooltip.tsx | 60 + packages/ui/copy-button.tsx | 50 + packages/ui/copyable-cell.tsx | 84 + packages/ui/globals.css | 225 +++ packages/ui/input/labeled-input.tsx | 42 + packages/ui/memory-graph/constants.ts | 100 + packages/ui/memory-graph/controls.tsx | 67 + packages/ui/memory-graph/graph-canvas.tsx | 736 ++++++++ .../ui/memory-graph/graph-webgl-canvas.tsx | 781 ++++++++ .../ui/memory-graph/hooks/use-graph-data.ts | 299 +++ .../hooks/use-graph-interactions.ts | 257 +++ packages/ui/memory-graph/index.ts | 19 + packages/ui/memory-graph/legend.tsx | 323 ++++ .../ui/memory-graph/loading-indicator.tsx | 44 + packages/ui/memory-graph/memory-graph.tsx | 368 ++++ .../ui/memory-graph/node-detail-panel.tsx | 264 +++ packages/ui/memory-graph/spaces-dropdown.tsx | 119 ++ packages/ui/memory-graph/types.ts | 121 ++ packages/ui/other/anonymous-auth.tsx | 150 ++ packages/ui/other/glass-effect.tsx | 18 + packages/ui/package.json | 36 + packages/ui/pages/login.tsx | 354 ++++ packages/ui/text/heading/heading-h1-bold.tsx | 19 + .../ui/text/heading/heading-h1-medium.tsx | 19 + packages/ui/text/heading/heading-h2-bold.tsx | 19 + .../ui/text/heading/heading-h2-medium.tsx | 19 + packages/ui/text/heading/heading-h3-bold.tsx | 19 + .../ui/text/heading/heading-h3-medium.tsx | 19 + packages/ui/text/heading/heading-h4-bold.tsx | 19 + .../ui/text/heading/heading-h4-medium.tsx | 19 + packages/ui/text/label/label-1-medium.tsx | 19 + packages/ui/text/label/label-1-regular.tsx | 19 + packages/ui/text/label/label-2-medium.tsx | 19 + packages/ui/text/label/label-2-regular.tsx | 19 + packages/ui/text/label/label-3-medium.tsx | 19 + packages/ui/text/label/label-3-regular.tsx | 19 + packages/ui/text/title/title-1-bold.tsx | 19 + packages/ui/text/title/title-1-medium.tsx | 19 + packages/ui/text/title/title-2-bold.tsx | 19 + packages/ui/text/title/title-2-medium.tsx | 19 + packages/ui/text/title/title-3-bold.tsx | 19 + packages/ui/text/title/title-3-medium.tsx | 19 + packages/ui/tsconfig.json | 13 + packages/validation/api.ts | 1378 ++++++++++++++ packages/validation/connection.ts | 191 ++ packages/validation/package.json | 6 + packages/validation/schemas.ts | 380 ++++ packages/validation/tsconfig.json | 10 + patches/@udecode%2Fplate-emoji@40.0.0.patch | 26 - patches/raf@3.4.1.patch | 11 - turbo.json | 25 +- 634 files changed, 22332 insertions(+), 64226 deletions(-) delete mode 100644 .cursorrules delete mode 100644 .gitmodules delete mode 100644 .vscode/settings.json create mode 100644 CLAUDE.md delete mode 100644 Dockerfile delete mode 100644 SELF-HOSTING-GUIDE.md delete mode 100644 apps/backend/.gitignore delete mode 100644 apps/backend/README.md delete mode 100644 apps/backend/drizzle.config.prod.ts delete mode 100644 apps/backend/drizzle.config.ts delete mode 100644 apps/backend/drizzle/0000_odd_impossible_man.sql delete mode 100644 apps/backend/drizzle/0001_seed-types.sql delete mode 100644 apps/backend/drizzle/0002_skinny_princess_powerful.sql delete mode 100644 apps/backend/drizzle/0003_luxuriant_annihilus.sql delete mode 100644 apps/backend/drizzle/0004_early_rick_jones.sql delete mode 100644 apps/backend/drizzle/0005_create-access-types.sql delete mode 100644 apps/backend/drizzle/0006_wandering_grandmaster.sql delete mode 100644 apps/backend/drizzle/0007_fantastic_serpent_society.sql delete mode 100644 apps/backend/drizzle/0008_add-notion.sql delete mode 100644 apps/backend/drizzle/0009_milky_sleepwalker.sql delete mode 100644 apps/backend/drizzle/0010_heavy_preak.sql delete mode 100644 apps/backend/drizzle/0011_new_liz_osborn.sql delete mode 100644 apps/backend/drizzle/0012_small_mystique.sql delete mode 100644 apps/backend/drizzle/0013_sharp_hemingway.sql delete mode 100644 apps/backend/drizzle/0014_mighty_the_captain.sql delete mode 100644 apps/backend/drizzle/0015_perpetual_mauler.sql delete mode 100644 apps/backend/drizzle/0016_good_deathbird.sql delete mode 100644 apps/backend/drizzle/0018_past_inertia.sql delete mode 100644 apps/backend/drizzle/0019_vengeful_marten_broadcloak.sql delete mode 100644 apps/backend/drizzle/0020_opposite_steel_serpent.sql delete mode 100644 apps/backend/drizzle/meta/0000_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0001_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0002_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0003_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0004_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0005_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0006_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0007_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0008_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0009_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0010_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0011_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0012_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0013_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0014_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0015_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0016_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0017_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0018_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0019_snapshot.json delete mode 100644 apps/backend/drizzle/meta/0020_snapshot.json delete mode 100644 apps/backend/drizzle/meta/_journal.json delete mode 100644 apps/backend/package.json delete mode 100644 apps/backend/public/favicon.ico delete mode 100644 apps/backend/public/output.css delete mode 100644 apps/backend/scripts/migrate.ts delete mode 100644 apps/backend/src/auth.ts delete mode 100644 apps/backend/src/components/landing.tsx delete mode 100644 apps/backend/src/errors/baseError.ts delete mode 100644 apps/backend/src/errors/results.ts delete mode 100644 apps/backend/src/globals.css delete mode 100644 apps/backend/src/index.tsx delete mode 100644 apps/backend/src/providers.ts delete mode 100644 apps/backend/src/routes/actions.ts delete mode 100644 apps/backend/src/routes/integrations.ts delete mode 100644 apps/backend/src/routes/memories.ts delete mode 100644 apps/backend/src/routes/spaces.ts delete mode 100644 apps/backend/src/routes/user.ts delete mode 100644 apps/backend/src/types.ts delete mode 100644 apps/backend/src/utils/chunkers.ts delete mode 100644 apps/backend/src/utils/cipher.ts delete mode 100644 apps/backend/src/utils/extractDocumentContent.ts delete mode 100644 apps/backend/src/utils/extractor.ts delete mode 100644 apps/backend/src/utils/fetchers.ts delete mode 100644 apps/backend/src/utils/notion.ts delete mode 100644 apps/backend/src/utils/tweetsToThreads.ts delete mode 100644 apps/backend/src/utils/typeDecider.ts delete mode 100644 apps/backend/src/workflow/index.ts delete mode 100644 apps/backend/tailwind.config.js delete mode 100644 apps/backend/tsconfig.json delete mode 100644 apps/backend/types.d.ts delete mode 100644 apps/backend/wrangler.toml delete mode 100644 apps/docs/README.md delete mode 100644 apps/docs/api-reference/endpoints/connect/connect-app.mdx delete mode 100644 apps/docs/api-reference/endpoints/connect/connection-information.mdx delete mode 100644 apps/docs/api-reference/endpoints/memory-management/delete-delete.mdx delete mode 100644 apps/docs/api-reference/endpoints/memory-management/post-add.mdx delete mode 100644 apps/docs/api-reference/endpoints/memory-management/put-update.mdx delete mode 100644 apps/docs/api-reference/endpoints/search/get-fastsearch.mdx delete mode 100644 apps/docs/api-reference/endpoints/search/post-search.mdx delete mode 100644 apps/docs/api-reference/endpoints/settings.mdx delete mode 100644 apps/docs/changelog/overview.mdx delete mode 100644 apps/docs/essentials/metadata-filtering.mdx delete mode 100644 apps/docs/essentials/pricing.mdx delete mode 100644 apps/docs/favicon.png delete mode 100644 apps/docs/image.png delete mode 100644 apps/docs/images/checks-passed.png delete mode 100644 apps/docs/images/hero-dark.svg delete mode 100644 apps/docs/images/hero-light.svg delete mode 100644 apps/docs/images/setup/1.png delete mode 100644 apps/docs/images/setup/2.png delete mode 100644 apps/docs/images/setup/3.png delete mode 100644 apps/docs/introduction.mdx delete mode 100644 apps/docs/logo/dark.svg delete mode 100644 apps/docs/logo/light.svg delete mode 100644 apps/docs/mint.json delete mode 100644 apps/docs/openapi.json delete mode 100644 apps/docs/quickstart.mdx delete mode 100644 apps/docs/self-hosting.mdx delete mode 100644 apps/docs/snippets/snippet-intro.mdx delete mode 100644 apps/extension/.gitignore delete mode 100644 apps/extension/README.md delete mode 100644 apps/extension/components.json delete mode 100644 apps/extension/css/globals.css delete mode 100644 apps/extension/extension-env.d.ts delete mode 100644 apps/extension/images/icon/128.png delete mode 100644 apps/extension/images/icon/16.png delete mode 100644 apps/extension/images/icon/32.png delete mode 100644 apps/extension/images/icon/48.png delete mode 100644 apps/extension/images/icon/favicon.ico delete mode 100644 apps/extension/lib/utils.ts delete mode 100644 apps/extension/manifest.json delete mode 100644 apps/extension/package.json delete mode 100644 apps/extension/postcss.config.js delete mode 100644 apps/extension/public/globals.css delete mode 100644 apps/extension/public/logo.svg delete mode 100644 apps/extension/scripts/content.tsx delete mode 100644 apps/extension/scripts/css.tsx delete mode 100644 apps/extension/src/background.ts delete mode 100644 apps/extension/src/content.tsx delete mode 100644 apps/extension/src/helpers.ts delete mode 100644 apps/extension/src/twitter.constants.ts delete mode 100644 apps/extension/src/twitter.ts delete mode 100644 apps/extension/tailwind.config.cjs delete mode 100644 apps/extension/tsconfig.json delete mode 100644 apps/extension/ui/hooks/use-spaces.tsx delete mode 100644 apps/extension/ui/shadcn/badge.tsx delete mode 100644 apps/extension/ui/shadcn/button.tsx delete mode 100644 apps/extension/ui/shadcn/command.tsx delete mode 100644 apps/extension/ui/shadcn/dialog.tsx delete mode 100644 apps/extension/ui/shadcn/popover.tsx delete mode 100644 apps/extension/ui/spaces-selector.tsx create mode 100644 apps/web/.env.example delete mode 100644 apps/web/.prettierrc create mode 100644 apps/web/app/(auth)/login/page.tsx create mode 100644 apps/web/app/api/emails/welcome/route.tsx delete mode 100644 apps/web/app/components/Chat.tsx delete mode 100644 apps/web/app/components/ChatInputForm.tsx delete mode 100644 apps/web/app/components/Histories.tsx delete mode 100644 apps/web/app/components/Landing/Feature.tsx delete mode 100644 apps/web/app/components/Landing/Footer.tsx delete mode 100644 apps/web/app/components/Landing/Hero.tsx delete mode 100644 apps/web/app/components/Landing/Note.tsx delete mode 100644 apps/web/app/components/Landing/Private.tsx delete mode 100644 apps/web/app/components/Landing/index.tsx delete mode 100644 apps/web/app/components/Landing/plus-grid.tsx delete mode 100644 apps/web/app/components/Navbar.tsx delete mode 100644 apps/web/app/components/Reminders.tsx delete mode 100644 apps/web/app/components/Suggestions.tsx delete mode 100644 apps/web/app/components/editor/plate-editor.tsx delete mode 100644 apps/web/app/components/editor/plate-types.ts delete mode 100644 apps/web/app/components/editor/plugins/ai-plugins.tsx delete mode 100644 apps/web/app/components/editor/plugins/align-plugin.ts delete mode 100644 apps/web/app/components/editor/plugins/autoformat-plugin.ts delete mode 100644 apps/web/app/components/editor/plugins/basic-nodes-plugins.tsx delete mode 100644 apps/web/app/components/editor/plugins/block-menu-plugins.ts delete mode 100644 apps/web/app/components/editor/plugins/block-selection-plugins.ts delete mode 100644 apps/web/app/components/editor/plugins/comments-plugin.tsx delete mode 100644 apps/web/app/components/editor/plugins/copilot-plugins.ts delete mode 100644 apps/web/app/components/editor/plugins/delete-plugins.ts delete mode 100644 apps/web/app/components/editor/plugins/dnd-plugins.tsx delete mode 100644 apps/web/app/components/editor/plugins/editor-plugins.tsx delete mode 100644 apps/web/app/components/editor/plugins/exit-break-plugin.ts delete mode 100644 apps/web/app/components/editor/plugins/fixed-toolbar-plugin.tsx delete mode 100644 apps/web/app/components/editor/plugins/floating-toolbar-plugin.tsx delete mode 100644 apps/web/app/components/editor/plugins/indent-list-plugins.ts delete mode 100644 apps/web/app/components/editor/plugins/line-height-plugin.ts delete mode 100644 apps/web/app/components/editor/plugins/link-plugin.tsx delete mode 100644 apps/web/app/components/editor/plugins/media-plugins.tsx delete mode 100644 apps/web/app/components/editor/plugins/mention-plugin.ts delete mode 100644 apps/web/app/components/editor/plugins/reset-block-type-plugin.ts delete mode 100644 apps/web/app/components/editor/plugins/soft-break-plugin.ts delete mode 100644 apps/web/app/components/editor/plugins/table-plugin.ts delete mode 100644 apps/web/app/components/editor/plugins/toc-plugin.ts delete mode 100644 apps/web/app/components/editor/transforms.ts delete mode 100644 apps/web/app/components/editor/use-chat.tsx delete mode 100644 apps/web/app/components/editor/use-create-editor.tsx delete mode 100644 apps/web/app/components/editor/writing-playground.tsx delete mode 100644 apps/web/app/components/gradients/gradient1.png delete mode 100644 apps/web/app/components/icons/IntegrationIcons.tsx delete mode 100644 apps/web/app/components/icons/Logo.tsx delete mode 100644 apps/web/app/components/markdown/codeblock.tsx delete mode 100644 apps/web/app/components/markdown/renderer.tsx delete mode 100644 apps/web/app/components/memories/AddMemory.tsx delete mode 100644 apps/web/app/components/memories/CSVUploadModal.tsx delete mode 100644 apps/web/app/components/memories/Integrations.tsx delete mode 100644 apps/web/app/components/memories/MarkdownUploadModal.tsx delete mode 100644 apps/web/app/components/memories/MemoriesPage.tsx delete mode 100644 apps/web/app/components/memories/SharedCard.tsx delete mode 100644 apps/web/app/components/memories/SpacesSelector.tsx delete mode 100644 apps/web/app/components/plate-ui/ai-chat-editor.tsx delete mode 100644 apps/web/app/components/plate-ui/ai-leaf.tsx delete mode 100644 apps/web/app/components/plate-ui/ai-menu-items.tsx delete mode 100644 apps/web/app/components/plate-ui/ai-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/ai-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/align-dropdown-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/avatar.tsx delete mode 100644 apps/web/app/components/plate-ui/block-context-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/block-selection.tsx delete mode 100644 apps/web/app/components/plate-ui/blockquote-element.tsx delete mode 100644 apps/web/app/components/plate-ui/button.tsx delete mode 100644 apps/web/app/components/plate-ui/calendar.tsx delete mode 100644 apps/web/app/components/plate-ui/caption.tsx delete mode 100644 apps/web/app/components/plate-ui/checkbox.tsx delete mode 100644 apps/web/app/components/plate-ui/code-block-combobox.tsx delete mode 100644 apps/web/app/components/plate-ui/code-block-element.css delete mode 100644 apps/web/app/components/plate-ui/code-block-element.tsx delete mode 100644 apps/web/app/components/plate-ui/code-leaf.tsx delete mode 100644 apps/web/app/components/plate-ui/code-line-element.tsx delete mode 100644 apps/web/app/components/plate-ui/code-syntax-leaf.tsx delete mode 100644 apps/web/app/components/plate-ui/color-constants.ts delete mode 100644 apps/web/app/components/plate-ui/color-dropdown-menu-items.tsx delete mode 100644 apps/web/app/components/plate-ui/color-dropdown-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/color-input.tsx delete mode 100644 apps/web/app/components/plate-ui/color-picker.tsx delete mode 100644 apps/web/app/components/plate-ui/colors-custom.tsx delete mode 100644 apps/web/app/components/plate-ui/column-element.tsx delete mode 100644 apps/web/app/components/plate-ui/column-group-element.tsx delete mode 100644 apps/web/app/components/plate-ui/command.tsx delete mode 100644 apps/web/app/components/plate-ui/comment-avatar.tsx delete mode 100644 apps/web/app/components/plate-ui/comment-create-form.tsx delete mode 100644 apps/web/app/components/plate-ui/comment-item.tsx delete mode 100644 apps/web/app/components/plate-ui/comment-leaf.tsx delete mode 100644 apps/web/app/components/plate-ui/comment-more-dropdown.tsx delete mode 100644 apps/web/app/components/plate-ui/comment-reply-items.tsx delete mode 100644 apps/web/app/components/plate-ui/comment-resolve-button.tsx delete mode 100644 apps/web/app/components/plate-ui/comment-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/comment-value.tsx delete mode 100644 apps/web/app/components/plate-ui/comments-popover.tsx delete mode 100644 apps/web/app/components/plate-ui/context-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/cursor-overlay.tsx delete mode 100644 apps/web/app/components/plate-ui/date-element.tsx delete mode 100644 apps/web/app/components/plate-ui/dialog.tsx delete mode 100644 apps/web/app/components/plate-ui/draggable.tsx delete mode 100644 apps/web/app/components/plate-ui/dropdown-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/editor.tsx delete mode 100644 apps/web/app/components/plate-ui/emoji-picker-navigation.tsx delete mode 100644 apps/web/app/components/plate-ui/emoji-picker-preview.tsx delete mode 100644 apps/web/app/components/plate-ui/emoji-picker-search-and-clear.tsx delete mode 100644 apps/web/app/components/plate-ui/emoji-picker-search-bar.tsx delete mode 100644 apps/web/app/components/plate-ui/emoji-picker.tsx delete mode 100644 apps/web/app/components/plate-ui/emoji-toolbar-dropdown.tsx delete mode 100644 apps/web/app/components/plate-ui/excalidraw-element.tsx delete mode 100644 apps/web/app/components/plate-ui/fixed-toolbar-buttons.tsx delete mode 100644 apps/web/app/components/plate-ui/fixed-toolbar.tsx delete mode 100644 apps/web/app/components/plate-ui/floating-toolbar-buttons.tsx delete mode 100644 apps/web/app/components/plate-ui/floating-toolbar.tsx delete mode 100644 apps/web/app/components/plate-ui/ghost-text.tsx delete mode 100644 apps/web/app/components/plate-ui/heading-element.tsx delete mode 100644 apps/web/app/components/plate-ui/highlight-leaf.tsx delete mode 100644 apps/web/app/components/plate-ui/hr-element.tsx delete mode 100644 apps/web/app/components/plate-ui/image-element.tsx delete mode 100644 apps/web/app/components/plate-ui/image-preview.tsx delete mode 100644 apps/web/app/components/plate-ui/indent-fire-marker.tsx delete mode 100644 apps/web/app/components/plate-ui/indent-list-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/indent-todo-marker.tsx delete mode 100644 apps/web/app/components/plate-ui/indent-todo-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/indent-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/inline-combobox.tsx delete mode 100644 apps/web/app/components/plate-ui/input.tsx delete mode 100644 apps/web/app/components/plate-ui/insert-dropdown-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/kbd-leaf.tsx delete mode 100644 apps/web/app/components/plate-ui/line-height-dropdown-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/link-element.tsx delete mode 100644 apps/web/app/components/plate-ui/link-floating-toolbar.tsx delete mode 100644 apps/web/app/components/plate-ui/link-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/mark-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/media-embed-element.tsx delete mode 100644 apps/web/app/components/plate-ui/media-popover.tsx delete mode 100644 apps/web/app/components/plate-ui/media-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/mention-element.tsx delete mode 100644 apps/web/app/components/plate-ui/mention-input-element.tsx delete mode 100644 apps/web/app/components/plate-ui/mode-dropdown-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/more-dropdown-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/outdent-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/paragraph-element.tsx delete mode 100644 apps/web/app/components/plate-ui/placeholder.tsx delete mode 100644 apps/web/app/components/plate-ui/plate-element.tsx delete mode 100644 apps/web/app/components/plate-ui/popover.tsx delete mode 100644 apps/web/app/components/plate-ui/resizable.tsx delete mode 100644 apps/web/app/components/plate-ui/separator.tsx delete mode 100644 apps/web/app/components/plate-ui/slash-input-element.tsx delete mode 100644 apps/web/app/components/plate-ui/table-cell-element.tsx delete mode 100644 apps/web/app/components/plate-ui/table-dropdown-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/table-element.tsx delete mode 100644 apps/web/app/components/plate-ui/table-row-element.tsx delete mode 100644 apps/web/app/components/plate-ui/toc-element.tsx delete mode 100644 apps/web/app/components/plate-ui/toggle-element.tsx delete mode 100644 apps/web/app/components/plate-ui/toggle-toolbar-button.tsx delete mode 100644 apps/web/app/components/plate-ui/toolbar.tsx delete mode 100644 apps/web/app/components/plate-ui/tooltip.tsx delete mode 100644 apps/web/app/components/plate-ui/turn-into-dropdown-menu.tsx delete mode 100644 apps/web/app/components/plate-ui/with-draggables.tsx delete mode 100644 apps/web/app/components/skeletons/HistoriesSkeleton.tsx delete mode 100644 apps/web/app/components/skeletons/SuggestionsSkeleton.tsx delete mode 100644 apps/web/app/components/theme-button.tsx delete mode 100644 apps/web/app/components/twitter/avatar-img.tsx delete mode 100644 apps/web/app/components/twitter/icons/icons.module.css delete mode 100644 apps/web/app/components/twitter/icons/index.ts delete mode 100644 apps/web/app/components/twitter/icons/verified-business.tsx delete mode 100644 apps/web/app/components/twitter/icons/verified-government.tsx delete mode 100644 apps/web/app/components/twitter/icons/verified.tsx delete mode 100644 apps/web/app/components/twitter/quoted-tweet/quoted-tweet-body.module.css delete mode 100644 apps/web/app/components/twitter/quoted-tweet/quoted-tweet-body.tsx delete mode 100644 apps/web/app/components/twitter/quoted-tweet/quoted-tweet-container.module.css delete mode 100644 apps/web/app/components/twitter/quoted-tweet/quoted-tweet-container.tsx delete mode 100644 apps/web/app/components/twitter/quoted-tweet/quoted-tweet-header.module.css delete mode 100644 apps/web/app/components/twitter/quoted-tweet/quoted-tweet-header.tsx delete mode 100644 apps/web/app/components/twitter/quoted-tweet/quoted-tweet.tsx delete mode 100644 apps/web/app/components/twitter/render-tweet.tsx delete mode 100644 apps/web/app/components/twitter/tweet-body.module.css delete mode 100644 apps/web/app/components/twitter/tweet-container.module.css delete mode 100644 apps/web/app/components/twitter/tweet-header.module.css delete mode 100644 apps/web/app/components/twitter/tweet-in-reply-to.module.css delete mode 100644 apps/web/app/components/twitter/tweet-link.module.css delete mode 100644 apps/web/app/components/twitter/tweet-media-video.module.css delete mode 100644 apps/web/app/components/twitter/tweet-media-video.tsx delete mode 100644 apps/web/app/components/twitter/tweet-media.module.css delete mode 100644 apps/web/app/components/twitter/tweet-media.tsx delete mode 100644 apps/web/app/components/twitter/verified-badge.module.css delete mode 100644 apps/web/app/components/twitter/verified-badge.tsx delete mode 100644 apps/web/app/components/ui/Loader.tsx delete mode 100644 apps/web/app/components/ui/avatar.tsx delete mode 100644 apps/web/app/components/ui/badge.tsx delete mode 100644 apps/web/app/components/ui/button.tsx delete mode 100644 apps/web/app/components/ui/card.tsx delete mode 100644 apps/web/app/components/ui/checkbox.tsx delete mode 100644 apps/web/app/components/ui/combobox.tsx delete mode 100644 apps/web/app/components/ui/command.tsx delete mode 100644 apps/web/app/components/ui/credenza.tsx delete mode 100644 apps/web/app/components/ui/dialog.tsx delete mode 100644 apps/web/app/components/ui/drawer.tsx delete mode 100644 apps/web/app/components/ui/dropdown-menu.tsx delete mode 100644 apps/web/app/components/ui/input.tsx delete mode 100644 apps/web/app/components/ui/label.tsx delete mode 100644 apps/web/app/components/ui/popover.tsx delete mode 100644 apps/web/app/components/ui/select.tsx delete mode 100644 apps/web/app/components/ui/switch.tsx delete mode 100644 apps/web/app/components/ui/tabs.tsx delete mode 100644 apps/web/app/components/ui/textarea.tsx delete mode 100644 apps/web/app/config/integrations.tsx delete mode 100644 apps/web/app/config/util.ts delete mode 100644 apps/web/app/entry.client.tsx delete mode 100644 apps/web/app/entry.server.tsx create mode 100644 apps/web/app/icon.png create mode 100644 apps/web/app/layout.tsx delete mode 100644 apps/web/app/lib/auth/authMiddleware.ts delete mode 100644 apps/web/app/lib/constants/pastelColors.tsx delete mode 100644 apps/web/app/lib/constants/typeIcons.tsx delete mode 100644 apps/web/app/lib/env.server.ts delete mode 100644 apps/web/app/lib/environment.ts delete mode 100644 apps/web/app/lib/hooks/use-auto-scroll.ts delete mode 100644 apps/web/app/lib/hooks/use-chat-stream.ts delete mode 100644 apps/web/app/lib/hooks/use-debounce.ts delete mode 100644 apps/web/app/lib/hooks/use-fetcher-with-promise.tsx delete mode 100644 apps/web/app/lib/hooks/use-is-touch-device.ts delete mode 100644 apps/web/app/lib/hooks/use-keyboard.tsx delete mode 100644 apps/web/app/lib/hooks/use-live-transcript.tsx delete mode 100644 apps/web/app/lib/hooks/use-media-query.tsx delete mode 100644 apps/web/app/lib/hooks/use-memories.tsx delete mode 100644 apps/web/app/lib/hooks/use-mounted.ts delete mode 100644 apps/web/app/lib/hooks/use-spaces.tsx delete mode 100644 apps/web/app/lib/hooks/use-text-overflow.ts delete mode 100644 apps/web/app/lib/hooks/use-upload-file.ts delete mode 100644 apps/web/app/lib/misc.ts delete mode 100644 apps/web/app/lib/stripe.constants.ts delete mode 100644 apps/web/app/lib/stripe.ts delete mode 100644 apps/web/app/lib/theme-provider.tsx delete mode 100644 apps/web/app/lib/theme.server.ts delete mode 100644 apps/web/app/lib/types/memory.ts delete mode 100644 apps/web/app/lib/types/safety.ts delete mode 100644 apps/web/app/lib/utils.ts delete mode 100644 apps/web/app/lib/utils/metadata.ts delete mode 100644 apps/web/app/lib/utils/tweet.ts create mode 100644 apps/web/app/manifest.ts create mode 100644 apps/web/app/not-found.tsx create mode 100644 apps/web/app/opengraph-image.png create mode 100644 apps/web/app/page.tsx create mode 100644 apps/web/app/ref/[code]/page.tsx create mode 100644 apps/web/app/ref/page.tsx delete mode 100644 apps/web/app/root.tsx delete mode 100644 apps/web/app/routes/_index.tsx delete mode 100644 apps/web/app/routes/action.chat.tsx delete mode 100644 apps/web/app/routes/action.set-theme.tsx delete mode 100644 apps/web/app/routes/action.sign-out.tsx delete mode 100644 apps/web/app/routes/action.upload.tsx delete mode 100644 apps/web/app/routes/callback.ts delete mode 100644 apps/web/app/routes/chat.$chatId.tsx delete mode 100644 apps/web/app/routes/chat.new.tsx delete mode 100644 apps/web/app/routes/content.$contentid.tsx delete mode 100644 apps/web/app/routes/editor.tsx delete mode 100644 apps/web/app/routes/extension.ts delete mode 100644 apps/web/app/routes/home.tsx delete mode 100644 apps/web/app/routes/onboarding.add.tsx delete mode 100644 apps/web/app/routes/onboarding.import.tsx delete mode 100644 apps/web/app/routes/onboarding.index.tsx delete mode 100644 apps/web/app/routes/onboarding.privacy.tsx delete mode 100644 apps/web/app/routes/pay.stripe.callback.tsx delete mode 100644 apps/web/app/routes/pay.stripe.tsx delete mode 100644 apps/web/app/routes/pay.stripe.webhook.tsx delete mode 100644 apps/web/app/routes/pitch.index.tsx delete mode 100644 apps/web/app/routes/pricing.index.tsx delete mode 100644 apps/web/app/routes/privacy.tsx delete mode 100644 apps/web/app/routes/ref.tsx delete mode 100644 apps/web/app/routes/signin.tsx delete mode 100644 apps/web/app/routes/space.$spaceId.tsx delete mode 100644 apps/web/app/routes/space.($spaceId).invitation.tsx delete mode 100644 apps/web/app/routes/tos.tsx delete mode 100644 apps/web/app/sonner.css delete mode 100644 apps/web/app/tailwind.css delete mode 100644 apps/web/app/types/css.d.ts delete mode 100644 apps/web/app/types/stripe.d.ts create mode 100644 apps/web/app/waitlist/page.tsx delete mode 100644 apps/web/assets/logo.svg create mode 100644 apps/web/biome.json create mode 100644 apps/web/button.tsx create mode 100644 apps/web/components/connect-ai-modal.tsx create mode 100644 apps/web/components/create-project-dialog.tsx create mode 100644 apps/web/components/glass-menu-effect.tsx create mode 100644 apps/web/components/install-prompt.tsx create mode 100644 apps/web/components/memory-list-view.tsx create mode 100644 apps/web/components/menu.tsx create mode 100644 apps/web/components/project-selector.tsx create mode 100644 apps/web/components/referral-upgrade-modal.tsx create mode 100644 apps/web/components/spinner.tsx create mode 100644 apps/web/components/text-shimmer.tsx create mode 100644 apps/web/components/tour.tsx create mode 100644 apps/web/components/views/add-memory.tsx create mode 100644 apps/web/components/views/billing.tsx create mode 100644 apps/web/components/views/chat/chat-messages.tsx create mode 100644 apps/web/components/views/chat/index.tsx create mode 100644 apps/web/components/views/connections-tab-content.tsx create mode 100644 apps/web/components/views/mcp/index.tsx create mode 100644 apps/web/components/views/mcp/installation-dialog-content.tsx create mode 100644 apps/web/components/views/profile.tsx create mode 100644 apps/web/components/views/projects.tsx delete mode 100644 apps/web/env.d.ts delete mode 100644 apps/web/eslint.config.mjs delete mode 100644 apps/web/functions/[[path]].ts delete mode 100644 apps/web/functions/notion.ts create mode 100644 apps/web/globals.css create mode 100644 apps/web/hooks/use-project-mutations.ts create mode 100644 apps/web/hooks/use-project-name.ts create mode 100644 apps/web/hooks/use-resize-observer.ts create mode 100644 apps/web/instrumentation-client.ts create mode 100644 apps/web/lib/analytics.ts create mode 100644 apps/web/lib/mobile-panel-context.tsx create mode 100644 apps/web/lib/tour-constants.ts create mode 100644 apps/web/lib/view-mode-context.tsx delete mode 100644 apps/web/load-context.ts create mode 100644 apps/web/middleware.ts create mode 100644 apps/web/next.config.ts create mode 100644 apps/web/open-next.config.ts delete mode 100644 apps/web/postcss.config.js create mode 100644 apps/web/postcss.config.mjs delete mode 100644 apps/web/public/_routes.json delete mode 100644 apps/web/public/android-chrome-192x192.png delete mode 100644 apps/web/public/android-chrome-512x512.png delete mode 100644 apps/web/public/apple-touch-icon.png delete mode 100644 apps/web/public/favicon-16x16.png delete mode 100644 apps/web/public/favicon-32x32.png delete mode 100644 apps/web/public/favicon.ico create mode 100644 apps/web/public/images/login-carousel-1.png create mode 100644 apps/web/public/images/login-carousel-2.png create mode 100644 apps/web/public/images/logo.png create mode 100644 apps/web/public/images/sidebar.png create mode 100644 apps/web/public/landing-page.jpeg create mode 100644 apps/web/public/mcp-supported-tools/claude.png create mode 100644 apps/web/public/mcp-supported-tools/cline.png create mode 100644 apps/web/public/mcp-supported-tools/cursor.png create mode 100644 apps/web/public/mcp-supported-tools/gemini-cli.png create mode 100644 apps/web/public/mcp-supported-tools/vscode.png delete mode 100644 apps/web/public/og-image.png delete mode 100644 apps/web/public/product-of-the-day.png delete mode 100644 apps/web/public/siri.webp delete mode 100644 apps/web/public/site.webmanifest delete mode 100644 apps/web/server/index.ts delete mode 100644 apps/web/server/proxy.ts create mode 100644 apps/web/stores/chat.ts create mode 100644 apps/web/stores/highlights.ts create mode 100644 apps/web/stores/index.ts delete mode 100644 apps/web/tailwind.config.ts delete mode 100644 apps/web/vite.config.ts delete mode 100644 apps/web/worker-configuration.d.ts create mode 100644 apps/web/wrangler.jsonc delete mode 100644 apps/web/wrangler.toml create mode 100755 bun.lockb delete mode 100644 docker-compose.yml delete mode 100644 packages/db/index.ts delete mode 100644 packages/db/package.json delete mode 100644 packages/db/schema.ts create mode 100644 packages/eslint-config/README.md create mode 100644 packages/eslint-config/base.js create mode 100644 packages/eslint-config/next.js create mode 100644 packages/eslint-config/package.json create mode 100644 packages/eslint-config/react-internal.js create mode 100644 packages/hooks/package.json create mode 100644 packages/hooks/tsconfig.json create mode 100644 packages/hooks/use-keypress.ts create mode 100644 packages/hooks/use-mobile.ts create mode 100644 packages/lib/api.ts create mode 100644 packages/lib/auth-context.tsx create mode 100644 packages/lib/auth.middleware.ts create mode 100644 packages/lib/auth.ts create mode 100644 packages/lib/constants.ts create mode 100644 packages/lib/error-tracking.tsx create mode 100644 packages/lib/generate-id.ts create mode 100644 packages/lib/glass-effect-manager.ts create mode 100644 packages/lib/package.json create mode 100644 packages/lib/posthog.tsx create mode 100644 packages/lib/queries.ts create mode 100644 packages/lib/query-client.tsx create mode 100644 packages/lib/similarity.ts create mode 100644 packages/lib/tsconfig.json create mode 100644 packages/lib/utils.ts delete mode 100644 packages/shared/icons.tsx delete mode 100644 packages/shared/package.json delete mode 100644 packages/shared/tsconfig.json delete mode 100644 packages/shared/types.ts delete mode 100644 packages/shared/utils.ts create mode 100644 packages/typescript-config/base.json create mode 100644 packages/typescript-config/nextjs.json create mode 100644 packages/typescript-config/package.json create mode 100644 packages/typescript-config/react-library.json create mode 100644 packages/ui/assets/Logo.tsx create mode 100644 packages/ui/assets/icons.tsx create mode 100644 packages/ui/biome.json create mode 100644 packages/ui/button/external-auth.tsx create mode 100644 packages/ui/components.json create mode 100644 packages/ui/components/accordion.tsx create mode 100644 packages/ui/components/alert-dialog.tsx create mode 100644 packages/ui/components/avatar.tsx create mode 100644 packages/ui/components/badge.tsx create mode 100644 packages/ui/components/breadcrumb.tsx create mode 100644 packages/ui/components/button.tsx create mode 100644 packages/ui/components/card.tsx create mode 100644 packages/ui/components/carousel.tsx create mode 100644 packages/ui/components/chart.tsx create mode 100644 packages/ui/components/checkbox.tsx create mode 100644 packages/ui/components/collapsible.tsx create mode 100644 packages/ui/components/combobox.tsx create mode 100644 packages/ui/components/command.tsx create mode 100644 packages/ui/components/dialog.tsx create mode 100644 packages/ui/components/drawer.tsx create mode 100644 packages/ui/components/dropdown-menu.tsx create mode 100644 packages/ui/components/input.tsx create mode 100644 packages/ui/components/label.tsx create mode 100644 packages/ui/components/popover.tsx create mode 100644 packages/ui/components/progress.tsx create mode 100644 packages/ui/components/scroll-area.tsx create mode 100644 packages/ui/components/select.tsx create mode 100644 packages/ui/components/separator.tsx create mode 100644 packages/ui/components/shadcn-io/dropzone.tsx create mode 100644 packages/ui/components/sheet.tsx create mode 100644 packages/ui/components/sidebar.tsx create mode 100644 packages/ui/components/skeleton.tsx create mode 100644 packages/ui/components/sonner.tsx create mode 100644 packages/ui/components/table.tsx create mode 100644 packages/ui/components/tabs.tsx create mode 100644 packages/ui/components/text-separator.tsx create mode 100644 packages/ui/components/textarea.tsx create mode 100644 packages/ui/components/toggle-group.tsx create mode 100644 packages/ui/components/toggle.tsx create mode 100644 packages/ui/components/tooltip.tsx create mode 100644 packages/ui/copy-button.tsx create mode 100644 packages/ui/copyable-cell.tsx create mode 100644 packages/ui/globals.css create mode 100644 packages/ui/input/labeled-input.tsx create mode 100644 packages/ui/memory-graph/constants.ts create mode 100644 packages/ui/memory-graph/controls.tsx create mode 100644 packages/ui/memory-graph/graph-canvas.tsx create mode 100644 packages/ui/memory-graph/graph-webgl-canvas.tsx create mode 100644 packages/ui/memory-graph/hooks/use-graph-data.ts create mode 100644 packages/ui/memory-graph/hooks/use-graph-interactions.ts create mode 100644 packages/ui/memory-graph/index.ts create mode 100644 packages/ui/memory-graph/legend.tsx create mode 100644 packages/ui/memory-graph/loading-indicator.tsx create mode 100644 packages/ui/memory-graph/memory-graph.tsx create mode 100644 packages/ui/memory-graph/node-detail-panel.tsx create mode 100644 packages/ui/memory-graph/spaces-dropdown.tsx create mode 100644 packages/ui/memory-graph/types.ts create mode 100644 packages/ui/other/anonymous-auth.tsx create mode 100644 packages/ui/other/glass-effect.tsx create mode 100644 packages/ui/package.json create mode 100644 packages/ui/pages/login.tsx create mode 100644 packages/ui/text/heading/heading-h1-bold.tsx create mode 100644 packages/ui/text/heading/heading-h1-medium.tsx create mode 100644 packages/ui/text/heading/heading-h2-bold.tsx create mode 100644 packages/ui/text/heading/heading-h2-medium.tsx create mode 100644 packages/ui/text/heading/heading-h3-bold.tsx create mode 100644 packages/ui/text/heading/heading-h3-medium.tsx create mode 100644 packages/ui/text/heading/heading-h4-bold.tsx create mode 100644 packages/ui/text/heading/heading-h4-medium.tsx create mode 100644 packages/ui/text/label/label-1-medium.tsx create mode 100644 packages/ui/text/label/label-1-regular.tsx create mode 100644 packages/ui/text/label/label-2-medium.tsx create mode 100644 packages/ui/text/label/label-2-regular.tsx create mode 100644 packages/ui/text/label/label-3-medium.tsx create mode 100644 packages/ui/text/label/label-3-regular.tsx create mode 100644 packages/ui/text/title/title-1-bold.tsx create mode 100644 packages/ui/text/title/title-1-medium.tsx create mode 100644 packages/ui/text/title/title-2-bold.tsx create mode 100644 packages/ui/text/title/title-2-medium.tsx create mode 100644 packages/ui/text/title/title-3-bold.tsx create mode 100644 packages/ui/text/title/title-3-medium.tsx create mode 100644 packages/ui/tsconfig.json create mode 100644 packages/validation/api.ts create mode 100644 packages/validation/connection.ts create mode 100644 packages/validation/package.json create mode 100644 packages/validation/schemas.ts create mode 100644 packages/validation/tsconfig.json delete mode 100644 patches/@udecode%2Fplate-emoji@40.0.0.patch delete mode 100644 patches/raf@3.4.1.patch diff --git a/.cursorrules b/.cursorrules deleted file mode 100644 index 9c20c02a..00000000 --- a/.cursorrules +++ /dev/null @@ -1 +0,0 @@ -i am building an app called "supermemory" \ No newline at end of file diff --git a/.gitignore b/.gitignore index f205702f..96fab4fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,8 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. -bun.lockb -tests/ -new-api/ -packages/scripts/* # Dependencies -node_modules/ -/.pnp +node_modules +.pnp .pnp.js # Local env files @@ -15,10 +11,9 @@ node_modules/ .env.development.local .env.test.local .env.production.local -.env*.local # Testing -/coverage +coverage # Turbo .turbo @@ -27,10 +22,11 @@ node_modules/ .vercel # Build Outputs -/.next +.next/ out/ build -/dist +dist + # Debug npm-debug.log* @@ -40,28 +36,3 @@ yarn-error.log* # Misc .DS_Store *.pem - -# IDE specific files -.idea/ -.vscode/ -*.swp -*.swo - -# Sensitive data -*.key -**/credentials.* -**/secrets.* -config.private.* - -# Cache -.cache/ -.npm -.eslintcache - -# Local database files -*.sqlite -*.db - -# Personal notes/todos -TODO.md -NOTES.md diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29b..00000000 diff --git a/.npmrc b/.npmrc index 145d3fa2..e69de29b 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +0,0 @@ -save-exact=true -engine-strict=true diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 2e1683ca..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "always" - }, - "sqltools.connections": [ - { - "previewLimit": 50, - "server": "localhost", - "driver": "PostgreSQL", - "name": "SupermemoryDB", - "connectString": "postgresql://dhravya:DPOSTGRES99%40c22%23hLab27postgres@168.119.111.189/supermemory" - } - ], - "millionLint.disableOutdatedVersionMessage": true -} diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..16cadd13 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,119 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Repository Structure + +This is a **Turbo monorepo** containing multiple applications and shared packages: + +### Applications (`apps/`) +- **`web/`** - Next.js web application + +## Development Commands + +### Root Level (Monorepo) +- `bun run dev` - Start all applications in development mode +- `bun run build` - Build all applications +- `bun run check-types` - Run TypeScript checks across all apps +- `bun run format-lint` - Format and lint code using Biome + +### Web Application (`apps/web/`) +- `bun run dev` - Start Next.js development server +- `bun run build` - Build Next.js application +- `bun run lint` - Run Next.js linting + +## Architecture Overview + +### Core Technology Stack +- **Runtime**: Next.js (web) +- **Framework**: Next.js (web) +- **Language**: TypeScript throughout +- **Package Manager**: Bun +- **Monorepo**: Turbo +- **Authentication**: Better Auth +- **Monitoring**: Sentry + +### API Application (Primary Backend) +The API serves as the core backend with these key features: + +**Key API Routes** +- `/v3/memories` - CRUD operations for documents/memories +- `/v3/search` - Semantic search across indexed content +- `/v3/connections` - External service integrations (Google Drive, Notion, OneDrive) +- `/v3/settings` - Organization and user settings +- `/v3/analytics` - Usage analytics and reporting +- `/api/auth/*` - Authentication endpoints + +### Web Application +Next.js application providing user interface for: + +## Key Libraries & Dependencies + +### Shared Dependencies +- `better-auth` - Authentication system with organization support +- `drizzle-orm` - Database ORM +- `zod` - Schema validation +- `hono` - Web framework (API & MCP) +- `@sentry/*` - Error monitoring +- `turbo` - Monorepo build system + +### Web-Specific +- `next` - React framework +- `@radix-ui/*` - UI components +- `@tanstack/react-query` - Data fetching +- `recharts` - Analytics visualization + +## Development Workflow + +### Content Processing Pipeline +All content goes through the `IngestContentWorkflow` which handles: +- Content type detection and extraction +- AI-powered summarization and automatic tagging +- Vector embedding generation using Cloudflare AI +- Chunking for semantic search optimization +- Space relationship management + +### Environment Configuration +- Uses `wrangler.jsonc` for Cloudflare Workers configuration +- Supports staging and production environments +- Requires Cloudflare bindings: Hyperdrive (DB), AI, KV storage, Workflows +- Cron triggers every 4 hours for connection imports + +### Error Handling & Monitoring +- HTTPException for consistent API error responses +- Sentry integration with user and organization context +- Custom logging that filters analytics noise + +## Code Quality & Standards + +### Linting & Formatting +- **Biome** used for linting and formatting across the monorepo +- Run `bun run format-lint` to format and lint all code +- Configuration in `biome.json` at repository root + +### TypeScript +- Strict TypeScript configuration with `@total-typescript/tsconfig` +- Type checking with `bun run check-types` +- Cloudflare Workers type generation with `cf-typegen` + +### Database Management +- Drizzle ORM with schema located in shared packages +- Database migrations handled through Drizzle Kit +- Schema types automatically generated and shared + +## Security & Best Practices + +### Authentication +- Better Auth handles user authentication and organization management +- API key authentication for external access +- Role-based access control within organizations + +### Data Handling +- Content hashing to prevent duplicate processing +- Secure handling of external service credentials +- Automatic content type detection and validation + +### Deployment +- Cloudflare Workers for scalable serverless deployment +- Source map uploads to Sentry for production debugging +- Environment-specific configuration management \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ad38bd6e..00000000 --- a/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM postgres:17 - -# Install build dependencies -RUN apt-get update && apt-get install -y \ - build-essential \ - git \ - curl \ - pkg-config \ - libssl-dev \ - libclang-dev \ - llvm-dev \ - postgresql-server-dev-all \ - && rm -rf /var/lib/apt/lists/* - -# Install pgvector -RUN git clone --branch v0.5.1 https://github.com/pgvector/pgvector.git \ - && cd pgvector \ - && make \ - && make install - -# Install Rust -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" - -# Install and initialize pgrx -RUN cargo install cargo-pgrx --version 0.12.5 --locked && \ - cargo pgrx init --pg17 pg_config - -# Clone and install pgvectorscale -RUN cd /tmp && \ - git clone --branch 0.5.0 https://github.com/timescale/pgvectorscale && \ - cd pgvectorscale/pgvectorscale && \ - cargo pgrx install --release - -# Create initialization script to enable both extensions -RUN echo 'CREATE EXTENSION IF NOT EXISTS vector;' > /docker-entrypoint-initdb.d/01-init-vector.sql && \ - echo 'CREATE EXTENSION IF NOT EXISTS vectorscale CASCADE;' > /docker-entrypoint-initdb.d/02-init-vectorscale.sql \ No newline at end of file diff --git a/README.md b/README.md index 3f61f8da..afd2af2a 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,99 @@ -
+
supermemory Logo -

The Memory API for the AI era

-> [!WARNING] -> This repo contains archived code for supermemory v1 and no longer receives updates or support. +
+ supermemory +
-## 🧠 What is supermemory? +## ✨ Features -supermemory is a powerful, developer-friendly API that seamlessly integrates external knowledge into your AI applications. It serves as the perfect memory layer for your AI stack, providing semantic search and retrieval capabilities that enhance your models with relevant context. +### Core Functionality +- **Add Memories from Any Content**: Easily add memories from URLs, PDFs, and plain text—just paste, upload, or link. +- **Chat with Your Memories**: Converse with your stored content using natural language chat. +- **Supermemory MCP Integration**: Seamlessly connect with all major AI tools (Claude, Cursor, etc.) via Supermemory MCP. +- **Graph View for All Memories**: Visualize and explore your memories and their connections in an interactive graph mode. -With supermemory, you can: +## 🏗️ Architecture -- **Store and organize knowledge** in a searchable database that understands meaning, not just keywords -- **Enhance AI responses** with accurate, up-to-date information from your data -- **Eliminate hallucinations** by grounding AI outputs in your trusted content -- **Connect to any source** with pre-built integrations for websites, PDFs, images, and more +This is a **Turborepo monorepo** -## ✨ Key Features +### Technology Stack +- **Frontend**: Next.js 15 with React 19 +- **Backend**: Hono API framework on Cloudflare Workers +- **Database**: PostgreSQL with Drizzle ORM +- **Authentication**: Better Auth with organization support +- **Package Manager**: Bun +- **Monorepo**: Turbo for build optimization +- **Styling**: Tailwind CSS with Radix UI components +- **Monitoring**: Sentry for error tracking and performance monitoring -- **Universal Content Handling**: Automatically process and index content from URLs, PDFs, text, and more -- **Semantic Search**: Find information based on meaning, not just keyword matching -- **Advanced Filtering**: Organize and retrieve information using metadata, categories, and user partitioning -- **Query Enhancement**: Rewriting and reranking for more relevant results -- **Simple Integration**: Clean, consistent API with SDKs for TypeScript and Python +### Project Structure +``` +├── apps/ +│ └── web/ # Next.js web application +├── packages/ # Shared packages and utilities +├── CLAUDE.md # Development guidelines for AI assistants +├── turbo.json # Turborepo configuration +└── package.json # Root package configuration +``` ## 🚀 Getting Started -Getting started with supermemory takes just minutes: +### Prerequisites +- **Bun** package manager -1. Sign up at [console.supermemory.ai](https://console.supermemory.ai) -2. Create your API key -3. Start adding and querying content +### Installation -```javascript -// Install: npm install supermemory -import { supermemory } from 'supermemory'; +1. **Clone the repository** + ```bash + git clone https://github.com/supermemoryai/supermemory-app.git + cd supermemory + ``` -const client = new supermemory({ - apiKey: 'YOUR_API_KEY', -}); +2. **Install dependencies** + ```bash + bun install + ``` -// Add content to your knowledge base -await client.memory.create({ - content: "https://en.wikipedia.org/wiki/Artificial_intelligence", - metadata: { - source: "wikipedia", - category: "AI" - } -}); +3. **Environment Setup** + + Create environment files for each app: + ```bash + # Copy environment templates + cp apps/web/.env.example apps/web/.env.local + ``` -// Query your knowledge base -const results = await client.search.create({ - q: "What are the ethical considerations in AI development?", - limit: 5 -}); +### Development + +#### Start all applications in development mode: +```bash +bun run dev ``` -## 📚 Documentation +This will start: +- Web app at `http://localhost:3000` +- API endpoints available through the web app -We've created comprehensive documentation to help you get the most out of supermemory: -- [Quick Start Guide](https://docs.supermemory.ai/quickstart/overview) -- [API Reference](https://docs.supermemory.ai/api-reference) -- [SDK Documentation](https://docs.supermemory.ai/sdks) -- [Use Cases & Examples](https://docs.supermemory.ai/overview/use-cases) +## 🧪 Development Workflow -## 🌟 Use Cases +### Code Quality +- **Linting & Formatting**: Uses Biome for consistent code style +- **Type Safety**: Strict TypeScript configuration across all packages -supermemory powers a wide range of AI-enhanced applications: +## 🤝 Contributing -- **RAG (Retrieval Augmented Generation)**: Enhance LLM outputs with accurate data -- **Knowledge Bases & Documentation**: Create intelligent, searchable repositories -- **Customer Support**: Build chatbots with access to your support documentation -- **Research Assistants**: Query across papers, notes, and references -- **Content Management**: Organize and retrieve multimedia content semantically +### Development Guidelines +- Follow the code style enforced by Biome +- Write tests for new features +- Update documentation when adding new functionality +- Ensure all checks pass before submitting PRs -## 💬 Support -Have questions or feedback? We're here to help: -- Email: [dhravya@supermemory.com](mailto:dhravya@supermemory.com) -- Documentation: [docs.supermemory.ai](https://docs.supermemory.ai) +## 💬 Support & Community -## 🔄 Updates & Roadmap +- **Issues**: [GitHub Issues](https://github.com/supermemoryai/supermemory-app/issues) +- **Email**: [dhravya@supermemory.com](mailto:dhravya@supermemory.com) +- **Twitter**: [@supermemoryai](https://x.com/supermemoryai) -Stay up to date with the latest improvements: -- [Changelog](https://docs.supermemory.ai/changelog/overview) -- [X](https://x.com/supermemoryai) diff --git a/SELF-HOSTING-GUIDE.md b/SELF-HOSTING-GUIDE.md deleted file mode 100644 index 523369e2..00000000 --- a/SELF-HOSTING-GUIDE.md +++ /dev/null @@ -1,90 +0,0 @@ -# Supermemory self-hosting guide - -## Local Setup - -### 1. Database Setup - -To spin up the database locally, use Docker Compose: - -```bash -docker-compose up -d -``` - -This will start a PostgreSQL database with pgvector extension at `localhost:5432`. - -### 2. Database Migrations - -To generate a migration: - -```bash -bun run generate-migration -``` - -To apply migrations: - -```bash -bun run migrate:local -``` - -> Note: You MUST use the drizzle-orm functions exported from `packages/db` for interacting with the database. Not using them will cause type errors that are hard to debug. - -### 3. Environment Variables - -#### Backend (`apps/backend/.env` and `apps/backend/.dev.vars`): - -```env -WORKOS_API_KEY=your_workos_api_key -WORKOS_CLIENT_ID=your_workos_client_id -WORKOS_COOKIE_PASSWORD=your_cookie_password -DATABASE_URL="postgresql://postgres:postgres@localhost:5432/supermemory" -CONTENT_WORKFLOW=your_content_workflow -GEMINI_API_KEY=your_gemini_api_key -NODE_ENV=development -OPEN_AI_API_KEY=your_openai_api_key -BRAINTRUST_API_KEY=your_braintrust_api_key -RESEND_API_KEY=your_resend_api_key -TURNSTILE_SECRET_KEY=your_turnstile_secret_key -``` - -#### Web (`apps/web/.env` and `apps/web/.dev.vars`): - -```env -WORKOS_CLIENT_ID=your_workos_client_id -WORKOS_API_KEY=your_workos_api_key -WORKOS_REDIRECT_URI="http://localhost:3000/callback" -WORKOS_COOKIE_PASSWORD=your_cookie_password -DATABASE_URL="postgresql://postgres:postgres@localhost:5432/supermemorydhravya" - -CLOUDFLARE_ACCOUNT_ID=your_cloudflare_account_id -R2_ACCESS_KEY_ID=your_r2_access_key_id -R2_SECRET_ACCESS_KEY=your_r2_secret_access_key - -BACKEND_URL=http://localhost:8787 -OPENAI_API_KEY=your_openai_api_key -NOTION_CLIENT_ID=your_notion_client_id -NOTION_CLIENT_SECRET=your_notion_client_secret - -NODE_ENV=development -STRIPE_CHECKOUT_KEY=your_stripe_checkout_key -STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret -``` - -You also need to update the Wrangler config for the web app and backend to your own account's resources on Cloudflare. - -### 4. Schema Changes - -To edit the database schema, modify the files in `packages/db/schema.ts`, and then repeat the steps in the [Database Migrations](#2-database-migrations) section. - -### 5. Running the Application - -1. Install dependencies: - -```bash -bun install -``` - -2. Start the development servers: - -```bash -bun run dev -``` diff --git a/apps/backend/.gitignore b/apps/backend/.gitignore deleted file mode 100644 index e4b00d87..00000000 --- a/apps/backend/.gitignore +++ /dev/null @@ -1,35 +0,0 @@ -# prod -dist/ -.dev.vars -*.vars - -# dev -.yarn/ -!.yarn/releases -.vscode/* -!.vscode/launch.json -!.vscode/*.code-snippets -.idea/workspace.xml -.idea/usage.statistics.xml -.idea/shelf - -# deps -node_modules/ -.wrangler - -# env -.env -.env.production -.dev.vars - -# logs -logs/ -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -# misc -.DS_Store diff --git a/apps/backend/README.md b/apps/backend/README.md deleted file mode 100644 index cc58e962..00000000 --- a/apps/backend/README.md +++ /dev/null @@ -1,8 +0,0 @@ -``` -npm install -npm run dev -``` - -``` -npm run deploy -``` diff --git a/apps/backend/drizzle.config.prod.ts b/apps/backend/drizzle.config.prod.ts deleted file mode 100644 index 4707bf25..00000000 --- a/apps/backend/drizzle.config.prod.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "drizzle-kit"; - -export default defineConfig({ - dialect: "postgresql", - schema: "../../packages/db", - out: "./drizzle", - dbCredentials: { - url: process.env.PROD_DATABASE_URL!, - }, -}); diff --git a/apps/backend/drizzle.config.ts b/apps/backend/drizzle.config.ts deleted file mode 100644 index 3f198a9f..00000000 --- a/apps/backend/drizzle.config.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { config } from "dotenv"; -import { defineConfig } from "drizzle-kit"; -import process from "process"; - -config(); - -if (process.env.NODE_ENV !== "production" && !process.env.DATABASE_URL) { - throw new Error("DATABASE_URL is not set"); -} - -export default defineConfig({ - dialect: "postgresql", - schema: "../../packages/db", - out: "./drizzle", - dbCredentials: { - url: process.env.DATABASE_URL!, - }, -}); diff --git a/apps/backend/drizzle/0000_odd_impossible_man.sql b/apps/backend/drizzle/0000_odd_impossible_man.sql deleted file mode 100644 index 0a4b660c..00000000 --- a/apps/backend/drizzle/0000_odd_impossible_man.sql +++ /dev/null @@ -1,189 +0,0 @@ -CREATE EXTENSION IF NOT EXISTS vectorscale CASCADE; - -CREATE TABLE IF NOT EXISTS "chat_threads" ( - "id" bigserial PRIMARY KEY NOT NULL, - "uuid" varchar(36) NOT NULL, - "firstMessage" text NOT NULL, - "user_id" integer NOT NULL, - "messages" jsonb NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "chat_threads_uuid_unique" UNIQUE("uuid") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "chunks" ( - "id" serial PRIMARY KEY NOT NULL, - "document_id" integer NOT NULL, - "text_content" text, - "order_in_document" integer NOT NULL, - "embeddings" vector(1536), - "metadata" jsonb, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "content_to_space" ( - "content_id" integer NOT NULL, - "space_id" integer NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "document_type" ( - "type" text PRIMARY KEY NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "documents" ( - "id" bigserial PRIMARY KEY NOT NULL, - "uuid" varchar(36) NOT NULL, - "url" text, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone, - "type" text NOT NULL, - "title" text, - "description" text, - "og_image" text, - "raw" text, - "user_id" integer NOT NULL, - "content" text, - CONSTRAINT "documents_uuid_unique" UNIQUE("uuid") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "job" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" integer NOT NULL, - "url" text NOT NULL, - "status" text NOT NULL, - "attempts" integer DEFAULT 0 NOT NULL, - "lastAttemptAt" timestamp with time zone, - "error" text, - "created_at" timestamp with time zone, - "updated_at" timestamp with time zone -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "space_access" ( - "space_id" integer, - "user_email" varchar(512), - "status" text -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "space_access_status" ( - "status" text PRIMARY KEY NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "space_members" ( - "spaceId" integer NOT NULL, - "user_id" integer NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "spaces" ( - "id" bigserial PRIMARY KEY NOT NULL, - "uuid" varchar(36) NOT NULL, - "name" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, - "ownerId" integer NOT NULL, - "is_public" boolean DEFAULT false NOT NULL, - CONSTRAINT "spaces_uuid_unique" UNIQUE("uuid") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "users" ( - "id" serial PRIMARY KEY NOT NULL, - "uuid" varchar(36) NOT NULL, - "email" text NOT NULL, - "first_name" text, - "last_name" text, - "email_verified" boolean DEFAULT false NOT NULL, - "profile_picture_url" text, - "telegram_id" varchar(255), - "has_onboarded" integer DEFAULT 0 NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, - CONSTRAINT "users_uuid_unique" UNIQUE("uuid"), - CONSTRAINT "users_email_unique" UNIQUE("email") -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "chat_threads" ADD CONSTRAINT "chat_threads_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "chunks" ADD CONSTRAINT "chunks_document_id_documents_id_fk" FOREIGN KEY ("document_id") REFERENCES "public"."documents"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "content_to_space" ADD CONSTRAINT "content_to_space_content_id_documents_id_fk" FOREIGN KEY ("content_id") REFERENCES "public"."documents"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "content_to_space" ADD CONSTRAINT "content_to_space_space_id_spaces_id_fk" FOREIGN KEY ("space_id") REFERENCES "public"."spaces"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "documents" ADD CONSTRAINT "documents_type_document_type_type_fk" FOREIGN KEY ("type") REFERENCES "public"."document_type"("type") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "documents" ADD CONSTRAINT "documents_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE restrict ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "job" ADD CONSTRAINT "job_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "space_access" ADD CONSTRAINT "space_access_space_id_spaces_id_fk" FOREIGN KEY ("space_id") REFERENCES "public"."spaces"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "space_access" ADD CONSTRAINT "space_access_status_space_access_status_status_fk" FOREIGN KEY ("status") REFERENCES "public"."space_access_status"("status") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "space_members" ADD CONSTRAINT "space_members_spaceId_users_id_fk" FOREIGN KEY ("spaceId") REFERENCES "public"."users"("id") ON DELETE restrict ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "space_members" ADD CONSTRAINT "space_members_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE restrict ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "chat_threads_user_idx" ON "chat_threads" USING btree ("user_id");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "chunk_id_idx" ON "chunks" USING btree ("id");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "chunk_document_id_idx" ON "chunks" USING btree ("document_id");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "embeddingIndex" ON "chunks" USING diskann ("embeddings" vector_cosine_ops);--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "content_id_space_id_unique" ON "content_to_space" USING btree ("content_id","space_id");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "document_id_idx" ON "documents" USING btree ("id");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "document_uuid_idx" ON "documents" USING btree ("uuid");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "document_type_idx" ON "documents" USING btree ("type");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "document_url_user_id_idx" ON "documents" USING btree ("url","user_id");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "user_id_url_idx" ON "job" USING btree ("user_id","url");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "space_id_user_email_idx" ON "space_access" USING btree ("space_id","user_email");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "space_members_space_user_idx" ON "space_members" USING btree ("spaceId","user_id");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "spaces_id_idx" ON "spaces" USING btree ("id");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "spaces_owner_id_idx" ON "spaces" USING btree ("ownerId");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "spaces_name_idx" ON "spaces" USING btree ("name");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "users_id_idx" ON "users" USING btree ("id");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "users_uuid_idx" ON "users" USING btree ("uuid");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "users_email_idx" ON "users" USING btree ("email");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "users_name_idx" ON "users" USING btree ("first_name","last_name");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "users_created_at_idx" ON "users" USING btree ("created_at");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "users_telegram_id_idx" ON "users" USING btree ("telegram_id"); \ No newline at end of file diff --git a/apps/backend/drizzle/0001_seed-types.sql b/apps/backend/drizzle/0001_seed-types.sql deleted file mode 100644 index 3c409b92..00000000 --- a/apps/backend/drizzle/0001_seed-types.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Custom SQL migration file, put you code below! -- -INSERT INTO "document_type" (type) VALUES ('tweet'), ('page'), ('note') ON CONFLICT DO NOTHING; -INSERT INTO "document_type" (type) VALUES ('document') ON CONFLICT DO NOTHING; \ No newline at end of file diff --git a/apps/backend/drizzle/0002_skinny_princess_powerful.sql b/apps/backend/drizzle/0002_skinny_princess_powerful.sql deleted file mode 100644 index c826811f..00000000 --- a/apps/backend/drizzle/0002_skinny_princess_powerful.sql +++ /dev/null @@ -1,2 +0,0 @@ --- Active: 1732249624784@@_@5432@supermemorymain -ALTER TABLE "documents" ADD COLUMN "is_successfully_processed" boolean DEFAULT false; \ No newline at end of file diff --git a/apps/backend/drizzle/0003_luxuriant_annihilus.sql b/apps/backend/drizzle/0003_luxuriant_annihilus.sql deleted file mode 100644 index fef1b6b1..00000000 --- a/apps/backend/drizzle/0003_luxuriant_annihilus.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE "documents" ALTER COLUMN "is_successfully_processed" DROP NOT NULL;--> statement-breakpoint -ALTER TABLE "space_access" ADD COLUMN "access_type" text DEFAULT 'read' NOT NULL;--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "document_raw_user_idx" ON "documents" USING btree ("raw","user_id");--> statement-breakpoint \ No newline at end of file diff --git a/apps/backend/drizzle/0004_early_rick_jones.sql b/apps/backend/drizzle/0004_early_rick_jones.sql deleted file mode 100644 index b26c0ffc..00000000 --- a/apps/backend/drizzle/0004_early_rick_jones.sql +++ /dev/null @@ -1,19 +0,0 @@ -CREATE TABLE IF NOT EXISTS "saved_spaces" ( - "user_id" integer NOT NULL, - "space_id" integer NOT NULL, - "saved_at" timestamp DEFAULT now() NOT NULL -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "saved_spaces" ADD CONSTRAINT "saved_spaces_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "saved_spaces" ADD CONSTRAINT "saved_spaces_space_id_spaces_id_fk" FOREIGN KEY ("space_id") REFERENCES "public"."spaces"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "saved_spaces_user_space_idx" ON "saved_spaces" USING btree ("user_id","space_id"); \ No newline at end of file diff --git a/apps/backend/drizzle/0005_create-access-types.sql b/apps/backend/drizzle/0005_create-access-types.sql deleted file mode 100644 index 29095454..00000000 --- a/apps/backend/drizzle/0005_create-access-types.sql +++ /dev/null @@ -1,2 +0,0 @@ --- Custom SQL migration file, put you code below! -- -INSERT INTO "space_access_status" (status) VALUES ('pending'), ('accepted'), ('rejected') ON CONFLICT DO NOTHING; \ No newline at end of file diff --git a/apps/backend/drizzle/0006_wandering_grandmaster.sql b/apps/backend/drizzle/0006_wandering_grandmaster.sql deleted file mode 100644 index 0a0066d8..00000000 --- a/apps/backend/drizzle/0006_wandering_grandmaster.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE TABLE IF NOT EXISTS "waitlist" ( - "email" varchar(512) PRIMARY KEY NOT NULL -); diff --git a/apps/backend/drizzle/0007_fantastic_serpent_society.sql b/apps/backend/drizzle/0007_fantastic_serpent_society.sql deleted file mode 100644 index c25c55a3..00000000 --- a/apps/backend/drizzle/0007_fantastic_serpent_society.sql +++ /dev/null @@ -1 +0,0 @@ -DROP INDEX IF EXISTS "document_url_user_id_idx"; \ No newline at end of file diff --git a/apps/backend/drizzle/0008_add-notion.sql b/apps/backend/drizzle/0008_add-notion.sql deleted file mode 100644 index 17cd0206..00000000 --- a/apps/backend/drizzle/0008_add-notion.sql +++ /dev/null @@ -1,2 +0,0 @@ --- Custom SQL migration file, put you code below! -- -INSERT INTO "document_type" (type) VALUES ('notion') ON CONFLICT DO NOTHING; \ No newline at end of file diff --git a/apps/backend/drizzle/0009_milky_sleepwalker.sql b/apps/backend/drizzle/0009_milky_sleepwalker.sql deleted file mode 100644 index d32443c1..00000000 --- a/apps/backend/drizzle/0009_milky_sleepwalker.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "waitlist" ADD COLUMN "created_at" timestamp with time zone DEFAULT now() NOT NULL; \ No newline at end of file diff --git a/apps/backend/drizzle/0010_heavy_preak.sql b/apps/backend/drizzle/0010_heavy_preak.sql deleted file mode 100644 index 003d62ae..00000000 --- a/apps/backend/drizzle/0010_heavy_preak.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE "documents" DROP CONSTRAINT "documents_user_id_users_id_fk"; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "documents" ADD CONSTRAINT "documents_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/apps/backend/drizzle/0011_new_liz_osborn.sql b/apps/backend/drizzle/0011_new_liz_osborn.sql deleted file mode 100644 index b5679196..00000000 --- a/apps/backend/drizzle/0011_new_liz_osborn.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "documents" ADD COLUMN "error_message" text; \ No newline at end of file diff --git a/apps/backend/drizzle/0012_small_mystique.sql b/apps/backend/drizzle/0012_small_mystique.sql deleted file mode 100644 index e89fb98a..00000000 --- a/apps/backend/drizzle/0012_small_mystique.sql +++ /dev/null @@ -1,2 +0,0 @@ --- Active: 1732308352274@@127.0.0.1@5432@supermemorydhravya -ALTER TABLE "users" ADD COLUMN "last_api_key_generated_at" timestamp DEFAULT now(); \ No newline at end of file diff --git a/apps/backend/drizzle/0013_sharp_hemingway.sql b/apps/backend/drizzle/0013_sharp_hemingway.sql deleted file mode 100644 index 1f295677..00000000 --- a/apps/backend/drizzle/0013_sharp_hemingway.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "documents" ADD COLUMN "content_hash" text; \ No newline at end of file diff --git a/apps/backend/drizzle/0014_mighty_the_captain.sql b/apps/backend/drizzle/0014_mighty_the_captain.sql deleted file mode 100644 index 40e7b1b8..00000000 --- a/apps/backend/drizzle/0014_mighty_the_captain.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "users" ADD COLUMN "stripe_customer_id" text;--> statement-breakpoint -ALTER TABLE "users" ADD COLUMN "tier" text DEFAULT 'free' NOT NULL; \ No newline at end of file diff --git a/apps/backend/drizzle/0015_perpetual_mauler.sql b/apps/backend/drizzle/0015_perpetual_mauler.sql deleted file mode 100644 index ec419523..00000000 --- a/apps/backend/drizzle/0015_perpetual_mauler.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "chunks" ALTER COLUMN "embeddings" SET DATA TYPE vector(768); \ No newline at end of file diff --git a/apps/backend/drizzle/0016_good_deathbird.sql b/apps/backend/drizzle/0016_good_deathbird.sql deleted file mode 100644 index 7c6505de..00000000 --- a/apps/backend/drizzle/0016_good_deathbird.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE "chunks" ALTER COLUMN "embeddings" SET DATA TYPE vector(768);--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "documents_search_idx" ON "documents" USING gin (( - setweight(to_tsvector('english', coalesce("content", '')),'A') || - setweight(to_tsvector('english', coalesce("title", '')),'B') || - setweight(to_tsvector('english', coalesce("description", '')),'C') || - setweight(to_tsvector('english', coalesce("url", '')),'D') - )); \ No newline at end of file diff --git a/apps/backend/drizzle/0018_past_inertia.sql b/apps/backend/drizzle/0018_past_inertia.sql deleted file mode 100644 index a7d2e321..00000000 --- a/apps/backend/drizzle/0018_past_inertia.sql +++ /dev/null @@ -1,7 +0,0 @@ -DROP INDEX IF EXISTS "documents_search_idx";--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "documents_search_idx" ON "documents" USING gin (( - setweight(to_tsvector('english', coalesce("content", '')),'A') || - setweight(to_tsvector('english', coalesce("title", '')),'B') || - setweight(to_tsvector('english', coalesce("description", '')),'C') || - setweight(to_tsvector('english', coalesce("url", '')),'D') - )); \ No newline at end of file diff --git a/apps/backend/drizzle/0019_vengeful_marten_broadcloak.sql b/apps/backend/drizzle/0019_vengeful_marten_broadcloak.sql deleted file mode 100644 index 7bed7a59..00000000 --- a/apps/backend/drizzle/0019_vengeful_marten_broadcloak.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "documents" ADD COLUMN "metadata" jsonb; \ No newline at end of file diff --git a/apps/backend/drizzle/0020_opposite_steel_serpent.sql b/apps/backend/drizzle/0020_opposite_steel_serpent.sql deleted file mode 100644 index 3b0e2042..00000000 --- a/apps/backend/drizzle/0020_opposite_steel_serpent.sql +++ /dev/null @@ -1,2 +0,0 @@ --- Active: 1732308352274@@127.0.0.1@5432@supermemorydhravya -DROP TABLE "job"; \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0000_snapshot.json b/apps/backend/drizzle/meta/0000_snapshot.json deleted file mode 100644 index 4d7bf98d..00000000 --- a/apps/backend/drizzle/meta/0000_snapshot.json +++ /dev/null @@ -1,1060 +0,0 @@ -{ - "id": "a40bb20a-1c12-4e15-a7fc-cf46e9d4507f", - "prevId": "00000000-0000-0000-0000-000000000000", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "diskann", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_url_user_id_idx": { - "name": "document_url_user_id_idx", - "columns": [ - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0001_snapshot.json b/apps/backend/drizzle/meta/0001_snapshot.json deleted file mode 100644 index 3c02b35d..00000000 --- a/apps/backend/drizzle/meta/0001_snapshot.json +++ /dev/null @@ -1,1060 +0,0 @@ -{ - "id": "67f177d5-9303-4ae0-ad66-e04d0624dab1", - "prevId": "a40bb20a-1c12-4e15-a7fc-cf46e9d4507f", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "diskann", - "concurrently": false - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "columnsFrom": [ - "document_id" - ], - "tableTo": "documents", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "columnsFrom": [ - "content_id" - ], - "tableTo": "documents", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "columnsFrom": [ - "space_id" - ], - "tableTo": "spaces", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_url_user_id_idx": { - "name": "document_url_user_id_idx", - "columns": [ - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "columnsFrom": [ - "type" - ], - "tableTo": "document_type", - "columnsTo": [ - "type" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "restrict" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "columnsFrom": [ - "space_id" - ], - "tableTo": "spaces", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "columnsFrom": [ - "status" - ], - "tableTo": "space_access_status", - "columnsTo": [ - "status" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "columnsFrom": [ - "spaceId" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "restrict" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "restrict" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - }, - "users_email_unique": { - "name": "users_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0002_snapshot.json b/apps/backend/drizzle/meta/0002_snapshot.json deleted file mode 100644 index c36c66eb..00000000 --- a/apps/backend/drizzle/meta/0002_snapshot.json +++ /dev/null @@ -1,1067 +0,0 @@ -{ - "id": "be517863-31ba-4bf3-9a57-208d29723161", - "prevId": "67f177d5-9303-4ae0-ad66-e04d0624dab1", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "diskann", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_url_user_id_idx": { - "name": "document_url_user_id_idx", - "columns": [ - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0003_snapshot.json b/apps/backend/drizzle/meta/0003_snapshot.json deleted file mode 100644 index a1730bb5..00000000 --- a/apps/backend/drizzle/meta/0003_snapshot.json +++ /dev/null @@ -1,1095 +0,0 @@ -{ - "id": "bce9d9c5-68a2-417c-a9f8-454734bf47fa", - "prevId": "be517863-31ba-4bf3-9a57-208d29723161", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_url_user_id_idx": { - "name": "document_url_user_id_idx", - "columns": [ - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0004_snapshot.json b/apps/backend/drizzle/meta/0004_snapshot.json deleted file mode 100644 index acc4663d..00000000 --- a/apps/backend/drizzle/meta/0004_snapshot.json +++ /dev/null @@ -1,1173 +0,0 @@ -{ - "id": "6f9ba02f-28e8-4a11-8606-847dbc2ad43f", - "prevId": "bce9d9c5-68a2-417c-a9f8-454734bf47fa", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_url_user_id_idx": { - "name": "document_url_user_id_idx", - "columns": [ - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0005_snapshot.json b/apps/backend/drizzle/meta/0005_snapshot.json deleted file mode 100644 index 72fa7e54..00000000 --- a/apps/backend/drizzle/meta/0005_snapshot.json +++ /dev/null @@ -1,1173 +0,0 @@ -{ - "id": "5410ff1a-d1d0-4f47-b84e-a3507bd3f148", - "prevId": "6f9ba02f-28e8-4a11-8606-847dbc2ad43f", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "hnsw", - "concurrently": false - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "columnsFrom": [ - "document_id" - ], - "tableTo": "documents", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "columnsFrom": [ - "content_id" - ], - "tableTo": "documents", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "columnsFrom": [ - "space_id" - ], - "tableTo": "spaces", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_url_user_id_idx": { - "name": "document_url_user_id_idx", - "columns": [ - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "columnsFrom": [ - "type" - ], - "tableTo": "document_type", - "columnsTo": [ - "type" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "restrict" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "columnsFrom": [ - "space_id" - ], - "tableTo": "spaces", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "columnsFrom": [ - "space_id" - ], - "tableTo": "spaces", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "columnsFrom": [ - "status" - ], - "tableTo": "space_access_status", - "columnsTo": [ - "status" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "columnsFrom": [ - "spaceId" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "restrict" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "restrict" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - }, - "users_email_unique": { - "name": "users_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0006_snapshot.json b/apps/backend/drizzle/meta/0006_snapshot.json deleted file mode 100644 index e69b69cb..00000000 --- a/apps/backend/drizzle/meta/0006_snapshot.json +++ /dev/null @@ -1,1189 +0,0 @@ -{ - "id": "d1518064-adca-451e-a41f-f6902c26f3aa", - "prevId": "5410ff1a-d1d0-4f47-b84e-a3507bd3f148", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_url_user_id_idx": { - "name": "document_url_user_id_idx", - "columns": [ - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0007_snapshot.json b/apps/backend/drizzle/meta/0007_snapshot.json deleted file mode 100644 index e91f60a8..00000000 --- a/apps/backend/drizzle/meta/0007_snapshot.json +++ /dev/null @@ -1,1168 +0,0 @@ -{ - "id": "912b42e8-2827-4572-a698-577ba751461e", - "prevId": "d1518064-adca-451e-a41f-f6902c26f3aa", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0008_snapshot.json b/apps/backend/drizzle/meta/0008_snapshot.json deleted file mode 100644 index b4cdeb49..00000000 --- a/apps/backend/drizzle/meta/0008_snapshot.json +++ /dev/null @@ -1,1168 +0,0 @@ -{ - "id": "6f307490-3b7f-4c61-aec9-f51b65aae436", - "prevId": "912b42e8-2827-4572-a698-577ba751461e", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "hnsw", - "concurrently": false - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "columnsFrom": [ - "document_id" - ], - "tableTo": "documents", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "columnsFrom": [ - "content_id" - ], - "tableTo": "documents", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "columnsFrom": [ - "space_id" - ], - "tableTo": "spaces", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "columnsFrom": [ - "type" - ], - "tableTo": "document_type", - "columnsTo": [ - "type" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "restrict" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "columnsFrom": [ - "space_id" - ], - "tableTo": "spaces", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "columnsFrom": [ - "space_id" - ], - "tableTo": "spaces", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "columnsFrom": [ - "status" - ], - "tableTo": "space_access_status", - "columnsTo": [ - "status" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "columnsFrom": [ - "spaceId" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "restrict" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "restrict" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "columns": [ - "uuid" - ], - "nullsNotDistinct": false - }, - "users_email_unique": { - "name": "users_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0009_snapshot.json b/apps/backend/drizzle/meta/0009_snapshot.json deleted file mode 100644 index 33f2bbb5..00000000 --- a/apps/backend/drizzle/meta/0009_snapshot.json +++ /dev/null @@ -1,1175 +0,0 @@ -{ - "id": "b661c516-b919-46cf-81f3-6d7743acaf2f", - "prevId": "6f307490-3b7f-4c61-aec9-f51b65aae436", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0010_snapshot.json b/apps/backend/drizzle/meta/0010_snapshot.json deleted file mode 100644 index 3cb3360c..00000000 --- a/apps/backend/drizzle/meta/0010_snapshot.json +++ /dev/null @@ -1,1175 +0,0 @@ -{ - "id": "6fcd94f9-4308-4619-bc19-ec851edf8964", - "prevId": "b661c516-b919-46cf-81f3-6d7743acaf2f", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0011_snapshot.json b/apps/backend/drizzle/meta/0011_snapshot.json deleted file mode 100644 index b97e0826..00000000 --- a/apps/backend/drizzle/meta/0011_snapshot.json +++ /dev/null @@ -1,1181 +0,0 @@ -{ - "id": "e8a080b4-de5d-4015-945e-7bf5f461f16f", - "prevId": "6fcd94f9-4308-4619-bc19-ec851edf8964", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0012_snapshot.json b/apps/backend/drizzle/meta/0012_snapshot.json deleted file mode 100644 index 829368fe..00000000 --- a/apps/backend/drizzle/meta/0012_snapshot.json +++ /dev/null @@ -1,1188 +0,0 @@ -{ - "id": "15bb0365-73b0-4c03-9aa8-6249e89a4afd", - "prevId": "e8a080b4-de5d-4015-945e-7bf5f461f16f", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_api_key_generated_at": { - "name": "last_api_key_generated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0013_snapshot.json b/apps/backend/drizzle/meta/0013_snapshot.json deleted file mode 100644 index 686ad86a..00000000 --- a/apps/backend/drizzle/meta/0013_snapshot.json +++ /dev/null @@ -1,1194 +0,0 @@ -{ - "id": "8204e351-f30b-41a5-b071-c50bad426920", - "prevId": "15bb0365-73b0-4c03-9aa8-6249e89a4afd", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_api_key_generated_at": { - "name": "last_api_key_generated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0014_snapshot.json b/apps/backend/drizzle/meta/0014_snapshot.json deleted file mode 100644 index 6391612e..00000000 --- a/apps/backend/drizzle/meta/0014_snapshot.json +++ /dev/null @@ -1,1207 +0,0 @@ -{ - "id": "f5cef50a-50ec-4b49-99c2-4da3a0f6a098", - "prevId": "8204e351-f30b-41a5-b071-c50bad426920", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(1536)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_api_key_generated_at": { - "name": "last_api_key_generated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "stripe_customer_id": { - "name": "stripe_customer_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'free'" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0015_snapshot.json b/apps/backend/drizzle/meta/0015_snapshot.json deleted file mode 100644 index d19dbfbb..00000000 --- a/apps/backend/drizzle/meta/0015_snapshot.json +++ /dev/null @@ -1,1207 +0,0 @@ -{ - "id": "8529db1b-2d33-49e0-a413-f517eae7e4e4", - "prevId": "f5cef50a-50ec-4b49-99c2-4da3a0f6a098", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(7)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_api_key_generated_at": { - "name": "last_api_key_generated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "stripe_customer_id": { - "name": "stripe_customer_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'free'" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0016_snapshot.json b/apps/backend/drizzle/meta/0016_snapshot.json deleted file mode 100644 index 2020c691..00000000 --- a/apps/backend/drizzle/meta/0016_snapshot.json +++ /dev/null @@ -1,1222 +0,0 @@ -{ - "id": "23a39e70-a9c2-44cd-a3fb-22b19efef79e", - "prevId": "8529db1b-2d33-49e0-a413-f517eae7e4e4", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(768)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "documents_search_idx": { - "name": "documents_search_idx", - "columns": [ - { - "expression": "(\n setweight(to_tsvector('english', coalesce(\"content\", '')),'A') ||\n setweight(to_tsvector('english', coalesce(\"title\", '')),'B') ||\n setweight(to_tsvector('english', coalesce(\"description\", '')),'C') ||\n setweight(to_tsvector('english', coalesce(\"url\", '')),'D')\n )", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_api_key_generated_at": { - "name": "last_api_key_generated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "stripe_customer_id": { - "name": "stripe_customer_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'free'" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0017_snapshot.json b/apps/backend/drizzle/meta/0017_snapshot.json deleted file mode 100644 index efd17477..00000000 --- a/apps/backend/drizzle/meta/0017_snapshot.json +++ /dev/null @@ -1,1222 +0,0 @@ -{ - "id": "f8d9da82-e3be-46a9-b52e-a70dc2d24505", - "prevId": "23a39e70-a9c2-44cd-a3fb-22b19efef79e", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(768)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "documents_search_idx": { - "name": "documents_search_idx", - "columns": [ - { - "expression": "(\n setweight(to_tsvector('english', coalesce(preprocess_for_text_search(\"content\"), '')),'A') ||\n setweight(to_tsvector('english', coalesce(preprocess_for_text_search(\"title\"), '')),'B') ||\n setweight(to_tsvector('english', coalesce(preprocess_for_text_search(\"description\"), '')),'C') ||\n setweight(to_tsvector('english', coalesce(preprocess_for_text_search(\"url\"), '')),'D')\n )", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_api_key_generated_at": { - "name": "last_api_key_generated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "stripe_customer_id": { - "name": "stripe_customer_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'free'" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0018_snapshot.json b/apps/backend/drizzle/meta/0018_snapshot.json deleted file mode 100644 index 6b11027b..00000000 --- a/apps/backend/drizzle/meta/0018_snapshot.json +++ /dev/null @@ -1,1222 +0,0 @@ -{ - "id": "af318033-5cb6-41bf-9f68-2ebd75bd0a47", - "prevId": "f8d9da82-e3be-46a9-b52e-a70dc2d24505", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(768)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "documents_search_idx": { - "name": "documents_search_idx", - "columns": [ - { - "expression": "(\n setweight(to_tsvector('english', coalesce(\"content\", '')),'A') ||\n setweight(to_tsvector('english', coalesce(\"title\", '')),'B') ||\n setweight(to_tsvector('english', coalesce(\"description\", '')),'C') ||\n setweight(to_tsvector('english', coalesce(\"url\", '')),'D')\n )", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_api_key_generated_at": { - "name": "last_api_key_generated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "stripe_customer_id": { - "name": "stripe_customer_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'free'" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0019_snapshot.json b/apps/backend/drizzle/meta/0019_snapshot.json deleted file mode 100644 index 7c75753c..00000000 --- a/apps/backend/drizzle/meta/0019_snapshot.json +++ /dev/null @@ -1,1228 +0,0 @@ -{ - "id": "0f7b4e6d-295d-481f-84be-6b31178aa1b6", - "prevId": "af318033-5cb6-41bf-9f68-2ebd75bd0a47", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(768)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "documents_search_idx": { - "name": "documents_search_idx", - "columns": [ - { - "expression": "(\n setweight(to_tsvector('english', coalesce(\"content\", '')),'A') ||\n setweight(to_tsvector('english', coalesce(\"title\", '')),'B') ||\n setweight(to_tsvector('english', coalesce(\"description\", '')),'C') ||\n setweight(to_tsvector('english', coalesce(\"url\", '')),'D')\n )", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.job": { - "name": "job", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "lastAttemptAt": { - "name": "lastAttemptAt", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "user_id_url_idx": { - "name": "user_id_url_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "url", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "job_user_id_users_id_fk": { - "name": "job_user_id_users_id_fk", - "tableFrom": "job", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_api_key_generated_at": { - "name": "last_api_key_generated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "stripe_customer_id": { - "name": "stripe_customer_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'free'" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/0020_snapshot.json b/apps/backend/drizzle/meta/0020_snapshot.json deleted file mode 100644 index a6d491d4..00000000 --- a/apps/backend/drizzle/meta/0020_snapshot.json +++ /dev/null @@ -1,1127 +0,0 @@ -{ - "id": "d76a6f6e-ff3d-49d8-b8fe-a5d3f48924da", - "prevId": "0f7b4e6d-295d-481f-84be-6b31178aa1b6", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.chat_threads": { - "name": "chat_threads", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "firstMessage": { - "name": "firstMessage", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "messages": { - "name": "messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chat_threads_user_idx": { - "name": "chat_threads_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "chat_threads_user_id_users_id_fk": { - "name": "chat_threads_user_id_users_id_fk", - "tableFrom": "chat_threads", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "chat_threads_uuid_unique": { - "name": "chat_threads_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.chunks": { - "name": "chunks", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "document_id": { - "name": "document_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "text_content": { - "name": "text_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order_in_document": { - "name": "order_in_document", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "embeddings": { - "name": "embeddings", - "type": "vector(768)", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "chunk_id_idx": { - "name": "chunk_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "chunk_document_id_idx": { - "name": "chunk_document_id_idx", - "columns": [ - { - "expression": "document_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "embeddingIndex": { - "name": "embeddingIndex", - "columns": [ - { - "expression": "embeddings", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "vector_cosine_ops" - } - ], - "isUnique": false, - "concurrently": false, - "method": "hnsw", - "with": {} - } - }, - "foreignKeys": { - "chunks_document_id_documents_id_fk": { - "name": "chunks_document_id_documents_id_fk", - "tableFrom": "chunks", - "tableTo": "documents", - "columnsFrom": [ - "document_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.content_to_space": { - "name": "content_to_space", - "schema": "", - "columns": { - "content_id": { - "name": "content_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "content_id_space_id_unique": { - "name": "content_id_space_id_unique", - "columns": [ - { - "expression": "content_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "content_to_space_content_id_documents_id_fk": { - "name": "content_to_space_content_id_documents_id_fk", - "tableFrom": "content_to_space", - "tableTo": "documents", - "columnsFrom": [ - "content_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "content_to_space_space_id_spaces_id_fk": { - "name": "content_to_space_space_id_spaces_id_fk", - "tableFrom": "content_to_space", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.document_type": { - "name": "document_type", - "schema": "", - "columns": { - "type": { - "name": "type", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.documents": { - "name": "documents", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "og_image": { - "name": "og_image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "raw": { - "name": "raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_successfully_processed": { - "name": "is_successfully_processed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "error_message": { - "name": "error_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "document_id_idx": { - "name": "document_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_uuid_idx": { - "name": "document_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_type_idx": { - "name": "document_type_idx", - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "document_raw_user_idx": { - "name": "document_raw_user_idx", - "columns": [ - { - "expression": "raw", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "documents_search_idx": { - "name": "documents_search_idx", - "columns": [ - { - "expression": "(\n setweight(to_tsvector('english', coalesce(\"content\", '')),'A') ||\n setweight(to_tsvector('english', coalesce(\"title\", '')),'B') ||\n setweight(to_tsvector('english', coalesce(\"description\", '')),'C') ||\n setweight(to_tsvector('english', coalesce(\"url\", '')),'D')\n )", - "asc": true, - "isExpression": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gin", - "with": {} - } - }, - "foreignKeys": { - "documents_type_document_type_type_fk": { - "name": "documents_type_document_type_type_fk", - "tableFrom": "documents", - "tableTo": "document_type", - "columnsFrom": [ - "type" - ], - "columnsTo": [ - "type" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "documents_user_id_users_id_fk": { - "name": "documents_user_id_users_id_fk", - "tableFrom": "documents", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "documents_uuid_unique": { - "name": "documents_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.saved_spaces": { - "name": "saved_spaces", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "saved_at": { - "name": "saved_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "saved_spaces_user_space_idx": { - "name": "saved_spaces_user_space_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "saved_spaces_user_id_users_id_fk": { - "name": "saved_spaces_user_id_users_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "saved_spaces_space_id_spaces_id_fk": { - "name": "saved_spaces_space_id_spaces_id_fk", - "tableFrom": "saved_spaces", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access": { - "name": "space_access", - "schema": "", - "columns": { - "space_id": { - "name": "space_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "user_email": { - "name": "user_email", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_type": { - "name": "access_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'read'" - } - }, - "indexes": { - "space_id_user_email_idx": { - "name": "space_id_user_email_idx", - "columns": [ - { - "expression": "space_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_access_space_id_spaces_id_fk": { - "name": "space_access_space_id_spaces_id_fk", - "tableFrom": "space_access", - "tableTo": "spaces", - "columnsFrom": [ - "space_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "space_access_status_space_access_status_status_fk": { - "name": "space_access_status_space_access_status_status_fk", - "tableFrom": "space_access", - "tableTo": "space_access_status", - "columnsFrom": [ - "status" - ], - "columnsTo": [ - "status" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_access_status": { - "name": "space_access_status", - "schema": "", - "columns": { - "status": { - "name": "status", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.space_members": { - "name": "space_members", - "schema": "", - "columns": { - "spaceId": { - "name": "spaceId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "space_members_space_user_idx": { - "name": "space_members_space_user_idx", - "columns": [ - { - "expression": "spaceId", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "space_members_spaceId_users_id_fk": { - "name": "space_members_spaceId_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "spaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - }, - "space_members_user_id_users_id_fk": { - "name": "space_members_user_id_users_id_fk", - "tableFrom": "space_members", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "restrict", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.spaces": { - "name": "spaces", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "ownerId": { - "name": "ownerId", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "spaces_id_idx": { - "name": "spaces_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_owner_id_idx": { - "name": "spaces_owner_id_idx", - "columns": [ - { - "expression": "ownerId", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "spaces_name_idx": { - "name": "spaces_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "spaces_uuid_unique": { - "name": "spaces_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - } - } - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "uuid": { - "name": "uuid", - "type": "varchar(36)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "profile_picture_url": { - "name": "profile_picture_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "telegram_id": { - "name": "telegram_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "has_onboarded": { - "name": "has_onboarded", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "last_api_key_generated_at": { - "name": "last_api_key_generated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - }, - "stripe_customer_id": { - "name": "stripe_customer_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tier": { - "name": "tier", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'free'" - } - }, - "indexes": { - "users_id_idx": { - "name": "users_id_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_uuid_idx": { - "name": "users_uuid_idx", - "columns": [ - { - "expression": "uuid", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_name_idx": { - "name": "users_name_idx", - "columns": [ - { - "expression": "first_name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "last_name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "users_telegram_id_idx": { - "name": "users_telegram_id_idx", - "columns": [ - { - "expression": "telegram_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_uuid_unique": { - "name": "users_uuid_unique", - "nullsNotDistinct": false, - "columns": [ - "uuid" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.waitlist": { - "name": "waitlist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/apps/backend/drizzle/meta/_journal.json b/apps/backend/drizzle/meta/_journal.json deleted file mode 100644 index ebd7e43a..00000000 --- a/apps/backend/drizzle/meta/_journal.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "entries": [ - { - "idx": 0, - "version": "7", - "when": 1731880515136, - "tag": "0000_odd_impossible_man", - "breakpoints": true - }, - { - "idx": 1, - "version": "7", - "when": 1731880538346, - "tag": "0001_seed-types", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1731970096987, - "tag": "0002_skinny_princess_powerful", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1732290500234, - "tag": "0003_luxuriant_annihilus", - "breakpoints": true - }, - { - "idx": 4, - "version": "7", - "when": 1732291518161, - "tag": "0004_early_rick_jones", - "breakpoints": true - }, - { - "idx": 5, - "version": "7", - "when": 1732292492979, - "tag": "0005_create-access-types", - "breakpoints": true - }, - { - "idx": 6, - "version": "7", - "when": 1732308308233, - "tag": "0006_wandering_grandmaster", - "breakpoints": true - }, - { - "idx": 7, - "version": "7", - "when": 1732476625236, - "tag": "0007_fantastic_serpent_society", - "breakpoints": true - }, - { - "idx": 8, - "version": "7", - "when": 1732575691923, - "tag": "0008_add-notion", - "breakpoints": true - }, - { - "idx": 9, - "version": "7", - "when": 1732693411536, - "tag": "0009_milky_sleepwalker", - "breakpoints": true - }, - { - "idx": 10, - "version": "7", - "when": 1733037679877, - "tag": "0010_heavy_preak", - "breakpoints": true - }, - { - "idx": 11, - "version": "7", - "when": 1733177542412, - "tag": "0011_new_liz_osborn", - "breakpoints": true - }, - { - "idx": 12, - "version": "7", - "when": 1735033070115, - "tag": "0012_small_mystique", - "breakpoints": true - }, - { - "idx": 13, - "version": "7", - "when": 1736500817155, - "tag": "0013_sharp_hemingway", - "breakpoints": true - }, - { - "idx": 14, - "version": "7", - "when": 1736852938881, - "tag": "0014_mighty_the_captain", - "breakpoints": true - }, - { - "idx": 15, - "version": "7", - "when": 1737920848112, - "tag": "0015_perpetual_mauler", - "breakpoints": true - }, - { - "idx": 16, - "version": "7", - "when": 1739937938319, - "tag": "0016_good_deathbird", - "breakpoints": true - }, - { - "idx": 18, - "version": "7", - "when": 1739939254444, - "tag": "0018_past_inertia", - "breakpoints": true - }, - { - "idx": 19, - "version": "7", - "when": 1741025619581, - "tag": "0019_vengeful_marten_broadcloak", - "breakpoints": true - }, - { - "idx": 20, - "version": "7", - "when": 1741026944027, - "tag": "0020_opposite_steel_serpent", - "breakpoints": true - } - ] -} \ No newline at end of file diff --git a/apps/backend/package.json b/apps/backend/package.json deleted file mode 100644 index 664b501d..00000000 --- a/apps/backend/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "supermemory-backend", - "scripts": { - "dev": "bunx wrangler -v && wrangler dev", - "deploy": "bunx wrangler deploy --minify", - "generate-migration": "dotenv -- npx drizzle-kit generate", - "migrate:local": "bun run ./scripts/migrate.ts", - "migrate:prod": "NODE_ENV=production bun run ./scripts/migrate.ts", - "tail": "bunx wrangler tail" - }, - "dependencies": { - "@ai-sdk/google": "^0.0.51", - "@ai-sdk/openai": "^0.0.70", - "@hono/swagger-ui": "^0.5.0", - "@hono/zod-openapi": "^0.18.3", - "@hono/zod-validator": "^0.4.1", - "@supermemory/db": "workspace:*", - "ai": "4.0.16", - "compromise": "^14.14.2", - "dotenv": "^16.4.5", - "drizzle-kit": "^0.25.0", - "drizzle-orm": "^0.34.1", - "hono": "^4.6.4", - "openai": "^4.68.4", - "postgres": "^3.4.4", - "uuid": "^11.0.1", - "wrangler": "^3.111.0", - "zod": "^3.23.8" - }, - "devDependencies": { - "@cloudflare/workers-types": "^4.20250124.3" - }, - "overrides": { - "iron-webcrypto": "^1.2.1" - } -} diff --git a/apps/backend/public/favicon.ico b/apps/backend/public/favicon.ico deleted file mode 100644 index 90d7aafcdd7d25f29b0757caee0cfd501f460098..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15406 zcmeHO`FmB>)xLec{sApWfrKFpB1phMCIblxVah;4LYQPS&Pe?oK5`yVK|)zoMe2x>3QPCn#^=6EtE#S9+#j7aG?0my{ih$$6Qi zb4*Az$KYU&{yIk&H%DzjCSi`MT!RC1jI%h#JPJpanWMI#7h(80GHBw64BE8zbvkrl z7mdm8A+(HQdKxAaP~MXPEj)+5uX8M{Euzb3zNZIw+NksPEgF}TLBP>iUrtvpoTlRJ zOqpY(=BvHI4^%{E068;}}gT>`lvOkEc(Vj+*>T!2x~OIl^}$bMbq4H@t`Q_#FOsL%+ZF z^ynJyH^!lM=k8hTkH5C-*f~-)G9K_x>Hfg83bsr58pAtd=jE)|(5X`P zJFv47)^F&z_#f6U_#oH|{7^pIZtlRY1lxl@%29t}eL?7#;^*)$$ryTwuYunK2KYX~ zz&MK8UjW0X!M~zs1;Y~#1N@<2;PrF*cM-ohJOzfKF+b@rSf2|%sJ{y_K(9kSz|LUv zz@dBqhFtJLFj&8ugu(k+=pA%MZJ;8Kf$bp)1NdNNp?rvA@O&^B3?I5sNIPUvn{RaA zV8{@EpM-(s0N)Qk{R3oS=vN=BNA|I57mVRApM5BC8?jr4r6220%kzt9?6}7n$Ox;G+x%qZ5iD%75$Id2O|eDTRIL(&=L^cL*_H{YkvO z`lxX^y=ZIm`}F0Wtu!IGAKPdT=O5rJ;~1b5(e(rRZQNM)+<1<=XI$>#*0*`gU;q3m zwd~kLEjvG#1!jhR|>0aAa`iXNF zrF*%bxst9m+Fh_3_&9v%bxO31?MWGebq7ZK}S-jo8v zz4q%=UC@{FACou0MogLSyZuCH^&hJB2 zJYHKolm5ETKuHyq+%E~#K#NB0x`q*Kc7=T9*SktyT6O9AII?Hy>@E7@B>{v ze@X`U@gv*Dj*V+=%0E(vN#9=U1}cwI^W!FNFW2`f=8Ke%&~RxPNZ6>}?OET2O~D{=|>*_?f&f|qt5ngbZFl;I=FWWea!>D8g}~S z?#)IPHlK6x+r}*;bEP-%f7buhajv}MPiv^Ny)}ss_aXn${b?%8p!LEjsw>JevS4}4 zEYGI*SN(>jj~$jamqPqjdW8qp7a5-fECv^TYuUCTdHvg1zaOukMb|Ezq-m_LlE>J% zRWXudrp;?7a2|!dMLdU)^{wAiEYYLE@bNn@r(GZT4({Dd8{T}0W{rKC<99E~=a5&r z_{}~FeoA~)kk`7kk}!la$)p)$o}|MpYsehBhjHK1k2#*N$f35YXXV}ps}|av(&RCw z4iL>_ln=^dgTwnChfDOpV1X_i*wO6PZ@+e4c#miC+o{6`^Dp_TXJ(0RX)G}z_cP>y^a&!u#)BYOIxI~+1EysP1adGmgf*pr2JD}+K!dO4DBl&g9tD41hM|G^5B#ZU zK+Ord6v+|n-qz4y^hj$zPM27R+}?&|@bA#zbjj8s6uUoit*DQeQ4RaL93zL2=SmCiNep}(4IC3;51K2g9O8Cu z>Q27qqIRt^a5jxSUZ77}{{a4EdjS4qT>=e|gTyHpJD^LZH={OzcplnAT$f~D%s#1% z`!1m_g>nELT0`?T?fp_Jo6b?27JCTs`*Y#H#4;Oy9UX>-xIKUlBL{B}Zf`F%82_p@ zVbBoPg&_x}Lu=HcOX8OTU9z=mS1V>(P?yu%oazsbnx|;I);uE2XVTk)_e)+5o(8RB zDh(osczg(IHxW5Vt+|VI9zV;@yl@-(ep zI*&H5Z=yB7`!!V;J>_Ctlm=6ykL!|;bKbW`?7_+)l!Nj;a%39fa){F4`x?6EXeb>@ z`?*$jx9u7|xZBRh>(u=IYg{wx>0-6|SFPu&T^9}E{_D`5zMd$tI!c4lB@?SdT{8N^ z`InOe@;D<0p@HwG(2eov_0e$)VPlM@0Dh-1IDjZ3T}I_HL`fkJ{1j}9XF`?-B)Pc zTgzp9^u{t;!+y4L$`~4-lWA)Cum#@B!6r05poT2DhK<$E9)eh{G&s!6YmeFcA|n^B zxpSTGn=d|hH8#}w9!JA%wvj2L2Fmv}ksiL*8ExOz>_<)B3L2CS?PG%$kps&j>}SKb zI{d0L_Ne-##}^w)=-T;{5&Vy%!QdYt-yi6H6#1U!-?AS~M?(u$orue>WbJFzfXxj9S!$c|2Mt=s(cHyfxidB*u3s7uBo4v z9I5rSPi6Ahl=vJ7jS7yMt-@5By5Q9quKdk6EoX8r}*e|UTA7yGA=DQxP&*(QT zDhKRG4d$qhq_k;E8{$BF>-op>A9SIo_5GoJl5ZUUdM|x<@C*LlaW5TXtVd<+;o}}U zd*ZNsI|-Xcez9OmiLnXkZ88mkF1bB~%{SCGadi6QsIqOrmMIo^}5LI=$E_blMhzWM(!VDe9WU|do$hVo-y*L3qKsAIhFZ>UuzqP za~Po<)Hexc=txXY+;!}?DTU^{(@Uq1(nDTTv8Fnrmxlf#WQ?9adb!Qq@2n~49jUuc zEg8i3SJDCA%dMC{ne&ZIS91joumxui9P2bj;QOR7PI>-=-#Uy1x&(O`JGI!9*CEc}p77sYvpkrmi|a?zH~Y45PIDtkkKq4} z{hImfS#Q?A@uK;5tFuk=*_F>%ORdc7689iP4qRIbzW>$yd%Wh~)*if_hWw4{N}TU< z4LU3>_)g<<_LFg2zIEk{_#J&8^uE1h7W>glLhA$m&Y@}9Y{8HEhSCszGaJ&Nd!SGb zI=4B7G=#c>`;Yz&aqZ%%Bkr3Ve4BJ=-&XmaUDts8@GZi=E$jH(!K3uIU7O@u_`vub z4b~=H{hMGIQtS+%md0dJy8E0s>%5%YF`Hwm9-97C2ILEdQ{(b{F9`xPw#mE$M z%`6*43##+zInE~#Pn163*E*Bhwb%mV5Bm_I95A25XYsgeX9t!h{O&N@b>-UJ$9vEv z#Ht4IFCLrl$-eLAkIZG}h|pkb-@bP2dnqah&wpMkGGDN^U03&P6S5rd!M zIYM1hn~u})C?3dMg2m6NGIBIyy(GK=FCA?LlcOU(uf-hViRhAz)oRl?BG(9?H|GHl z?Aj5mAs#tTeqQJF?-`!sKJNMZmM=+j2J{DVketK*PmapL=>b3I<^^w*KjFE^R)34> zlgeG6QJlfNW`6s=%pcO?$&hQ;MR~~sR5gMRNyeEZU^0-1gpu=9