From 13616e345930b6c9e7cca898fcb98a8c4ff896b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Feb 2026 00:23:58 +0000 Subject: [PATCH 01/95] Update VOUCHED list https://github.com/anomalyco/opencode/issues/14616#issuecomment-3939773562 --- .github/VOUCHED.td | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/VOUCHED.td b/.github/VOUCHED.td index 412716a18dd8..4be318d51892 100644 --- a/.github/VOUCHED.td +++ b/.github/VOUCHED.td @@ -8,6 +8,7 @@ # - Denounce with minus prefix: -username or -platform:username. # - Optional details after a space following the handle. adamdotdevin +-agusbasari29 AI PR slop ariane-emory -florianleibert fwang From b16f7b426c5be6feea419dca87aad2032f25462b Mon Sep 17 00:00:00 2001 From: Pirro Zani <131965864+pirrozani@users.noreply.github.com> Date: Sun, 22 Feb 2026 10:29:50 +0200 Subject: [PATCH 02/95] docs(tui): correct typo in TUI documentation (#14604) --- packages/web/src/content/docs/tui.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/src/content/docs/tui.mdx b/packages/web/src/content/docs/tui.mdx index 085eb6169f83..1e48d42ccb1e 100644 --- a/packages/web/src/content/docs/tui.mdx +++ b/packages/web/src/content/docs/tui.mdx @@ -235,7 +235,7 @@ Share current session. [Learn more](/docs/share). List available themes. ```bash frame="none" -/theme +/themes ``` **Keybind:** `ctrl+x t` From e70d2b27de3aaed5a19b9ca2c6749ed7fce3ef93 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Sun, 22 Feb 2026 06:17:59 -0600 Subject: [PATCH 03/95] fix(app): terminal issues --- packages/opencode/src/pty/index.ts | 9 ++-- packages/opencode/src/server/routes/pty.ts | 2 +- .../test/pty/pty-output-isolation.test.ts | 48 +++++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/packages/opencode/src/pty/index.ts b/packages/opencode/src/pty/index.ts index 33083485b5f6..fdb46c817c9d 100644 --- a/packages/opencode/src/pty/index.ts +++ b/packages/opencode/src/pty/index.ts @@ -39,8 +39,9 @@ export namespace Pty { return next } - const token = (ws: Socket) => { - const data = ws.data + const token = (ws: unknown) => { + if (!ws || typeof ws !== "object") return ws + const data = (ws as { data?: unknown }).data if (data === undefined) return if (data === null) return if (typeof data !== "object") return data @@ -317,7 +318,7 @@ export namespace Pty { } } - export function connect(id: string, ws: Socket, cursor?: number) { + export function connect(id: string, ws: Socket, cursor?: number, identity?: unknown) { const session = state().get(id) if (!session) { ws.close() @@ -337,7 +338,7 @@ export namespace Pty { } owners.set(ws, id) - session.subscribers.set(ws, { id: socketId, token: token(ws) }) + session.subscribers.set(ws, { id: socketId, token: token(identity ?? ws) }) const cleanup = () => { session.subscribers.delete(ws) diff --git a/packages/opencode/src/server/routes/pty.ts b/packages/opencode/src/server/routes/pty.ts index 368c9612bf42..640cfa33361f 100644 --- a/packages/opencode/src/server/routes/pty.ts +++ b/packages/opencode/src/server/routes/pty.ts @@ -182,7 +182,7 @@ export const PtyRoutes = lazy(() => ws.close() return } - handler = Pty.connect(id, socket, cursor) + handler = Pty.connect(id, socket, cursor, ws) }, onMessage(event) { if (typeof event.data !== "string") return diff --git a/packages/opencode/test/pty/pty-output-isolation.test.ts b/packages/opencode/test/pty/pty-output-isolation.test.ts index 07e86ea97b67..2c9cc5d92660 100644 --- a/packages/opencode/test/pty/pty-output-isolation.test.ts +++ b/packages/opencode/test/pty/pty-output-isolation.test.ts @@ -98,6 +98,54 @@ describe("pty", () => { }) }) + test("does not leak when identity token is only on websocket wrapper", async () => { + await using dir = await tmpdir({ git: true }) + + await Instance.provide({ + directory: dir.path, + fn: async () => { + const a = await Pty.create({ command: "cat", title: "a" }) + try { + const outA: string[] = [] + const outB: string[] = [] + const text = (data: string | Uint8Array | ArrayBuffer) => { + if (typeof data === "string") return data + if (data instanceof ArrayBuffer) return Buffer.from(new Uint8Array(data)).toString("utf8") + return Buffer.from(data).toString("utf8") + } + + const raw: Parameters[1] = { + readyState: 1, + send: (data) => { + outA.push(text(data)) + }, + close: () => { + // no-op + }, + } + + const wrap = { data: { events: { connection: "a" } } } + + Pty.connect(a.id, raw, undefined, wrap) + outA.length = 0 + + // Simulate Bun reusing the raw socket object before the next onOpen, + // while the connection token only exists on the wrapper socket. + raw.send = (data) => { + outB.push(text(data)) + } + + Pty.write(a.id, "AAA\n") + await Bun.sleep(100) + + expect(outB.join("")).not.toContain("AAA") + } finally { + await Pty.remove(a.id) + } + }, + }) + }) + test("does not leak output when socket data mutates in-place", async () => { await using dir = await tmpdir({ git: true }) From aaf8317c8290c838212042c96bd0f88c5a2540d9 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Sun, 22 Feb 2026 11:36:00 -0600 Subject: [PATCH 04/95] feat(app): feed customization options --- .../app/src/components/settings-general.tsx | 36 +- packages/app/src/context/settings.tsx | 18 + packages/app/src/i18n/ar.ts | 7 + packages/app/src/i18n/br.ts | 7 + packages/app/src/i18n/bs.ts | 7 + packages/app/src/i18n/da.ts | 6 + packages/app/src/i18n/de.ts | 7 + packages/app/src/i18n/en.ts | 7 + packages/app/src/i18n/es.ts | 7 + packages/app/src/i18n/fr.ts | 7 + packages/app/src/i18n/ja.ts | 7 + packages/app/src/i18n/ko.ts | 7 + packages/app/src/i18n/no.ts | 6 + packages/app/src/i18n/pl.ts | 7 + packages/app/src/i18n/ru.ts | 7 + packages/app/src/i18n/th.ts | 6 + packages/app/src/i18n/zh.ts | 5 + packages/app/src/i18n/zht.ts | 5 + .../src/pages/session/message-timeline.tsx | 2 + packages/ui/src/components/message-part.css | 28 +- packages/ui/src/components/message-part.tsx | 322 +++++++++++------- packages/ui/src/components/session-turn.tsx | 4 + 22 files changed, 381 insertions(+), 134 deletions(-) diff --git a/packages/app/src/components/settings-general.tsx b/packages/app/src/components/settings-general.tsx index cf993840dc8f..42ee4092f68c 100644 --- a/packages/app/src/components/settings-general.tsx +++ b/packages/app/src/components/settings-general.tsx @@ -267,18 +267,50 @@ export const SettingsGeneral: Component = () => { )} + + + ) + const FeedSection = () => ( +
+

{language.t("settings.general.section.feed")}

+ +
-
+
settings.general.setShowReasoningSummaries(checked)} />
+ + +
+ settings.general.setShellToolPartsExpanded(checked)} + /> +
+
+ + +
+ settings.general.setEditToolPartsExpanded(checked)} + /> +
+
) @@ -435,6 +467,8 @@ export const SettingsGeneral: Component = () => {
+ + diff --git a/packages/app/src/context/settings.tsx b/packages/app/src/context/settings.tsx index d279a7f321bb..b43469b5c37c 100644 --- a/packages/app/src/context/settings.tsx +++ b/packages/app/src/context/settings.tsx @@ -23,6 +23,8 @@ export interface Settings { autoSave: boolean releaseNotes: boolean showReasoningSummaries: boolean + shellToolPartsExpanded: boolean + editToolPartsExpanded: boolean } updates: { startup: boolean @@ -44,6 +46,8 @@ const defaultSettings: Settings = { autoSave: true, releaseNotes: true, showReasoningSummaries: false, + shellToolPartsExpanded: true, + editToolPartsExpanded: false, }, updates: { startup: true, @@ -129,6 +133,20 @@ export const { use: useSettings, provider: SettingsProvider } = createSimpleCont setShowReasoningSummaries(value: boolean) { setStore("general", "showReasoningSummaries", value) }, + shellToolPartsExpanded: withFallback( + () => store.general?.shellToolPartsExpanded, + defaultSettings.general.shellToolPartsExpanded, + ), + setShellToolPartsExpanded(value: boolean) { + setStore("general", "shellToolPartsExpanded", value) + }, + editToolPartsExpanded: withFallback( + () => store.general?.editToolPartsExpanded, + defaultSettings.general.editToolPartsExpanded, + ), + setEditToolPartsExpanded(value: boolean) { + setStore("general", "editToolPartsExpanded", value) + }, }, updates: { startup: withFallback(() => store.updates?.startup, defaultSettings.updates.startup), diff --git a/packages/app/src/i18n/ar.ts b/packages/app/src/i18n/ar.ts index e860a7e5d564..91a16b3b8532 100644 --- a/packages/app/src/i18n/ar.ts +++ b/packages/app/src/i18n/ar.ts @@ -529,6 +529,7 @@ export const dict = { "settings.general.section.notifications": "إشعارات النظام", "settings.general.section.updates": "التحديثات", "settings.general.section.sounds": "المؤثرات الصوتية", + "settings.general.section.feed": "الخلاصة", "settings.general.section.display": "شاشة العرض", "settings.general.row.language.title": "اللغة", "settings.general.row.language.description": "تغيير لغة العرض لـ OpenCode", @@ -538,6 +539,12 @@ export const dict = { "settings.general.row.theme.description": "تخصيص سمة OpenCode.", "settings.general.row.font.title": "الخط", "settings.general.row.font.description": "تخصيص الخط الأحادي المستخدم في كتل التعليمات البرمجية", + "settings.general.row.shellToolPartsExpanded.title": "توسيع أجزاء أداة shell", + "settings.general.row.shellToolPartsExpanded.description": + "إظهار أجزاء أداة shell موسعة بشكل افتراضي في الشريط الزمني", + "settings.general.row.editToolPartsExpanded.title": "توسيع أجزاء أداة edit", + "settings.general.row.editToolPartsExpanded.description": + "إظهار أجزاء أدوات edit و write و patch موسعة بشكل افتراضي في الشريط الزمني", "settings.general.row.wayland.title": "استخدام Wayland الأصلي", "settings.general.row.wayland.description": "تعطيل التراجع إلى X11 على Wayland. يتطلب إعادة التشغيل.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/br.ts b/packages/app/src/i18n/br.ts index e96a0195df8d..7682a12b6972 100644 --- a/packages/app/src/i18n/br.ts +++ b/packages/app/src/i18n/br.ts @@ -535,6 +535,7 @@ export const dict = { "settings.general.section.notifications": "Notificações do sistema", "settings.general.section.updates": "Atualizações", "settings.general.section.sounds": "Efeitos sonoros", + "settings.general.section.feed": "Feed", "settings.general.section.display": "Tela", "settings.general.row.language.title": "Idioma", "settings.general.row.language.description": "Alterar o idioma de exibição do OpenCode", @@ -544,6 +545,12 @@ export const dict = { "settings.general.row.theme.description": "Personalize como o OpenCode é tematizado.", "settings.general.row.font.title": "Fonte", "settings.general.row.font.description": "Personalize a fonte monoespaçada usada em blocos de código", + "settings.general.row.shellToolPartsExpanded.title": "Expandir partes da ferramenta shell", + "settings.general.row.shellToolPartsExpanded.description": + "Mostrar partes da ferramenta shell expandidas por padrão na linha do tempo", + "settings.general.row.editToolPartsExpanded.title": "Expandir partes da ferramenta de edição", + "settings.general.row.editToolPartsExpanded.description": + "Mostrar partes das ferramentas de edição, escrita e patch expandidas por padrão na linha do tempo", "settings.general.row.wayland.title": "Usar Wayland nativo", "settings.general.row.wayland.description": "Desabilitar fallback X11 no Wayland. Requer reinicialização.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/bs.ts b/packages/app/src/i18n/bs.ts index 1852afcd14c2..d658926268e2 100644 --- a/packages/app/src/i18n/bs.ts +++ b/packages/app/src/i18n/bs.ts @@ -599,6 +599,7 @@ export const dict = { "settings.general.section.notifications": "Sistemske obavijesti", "settings.general.section.updates": "Ažuriranja", "settings.general.section.sounds": "Zvučni efekti", + "settings.general.section.feed": "Feed", "settings.general.section.display": "Prikaz", "settings.general.row.language.title": "Jezik", @@ -610,6 +611,12 @@ export const dict = { "settings.general.row.font.title": "Font", "settings.general.row.font.description": "Prilagodi monospace font koji se koristi u blokovima koda", + "settings.general.row.shellToolPartsExpanded.title": "Proširi dijelove shell alata", + "settings.general.row.shellToolPartsExpanded.description": + "Prikaži dijelove shell alata podrazumijevano proširene na vremenskoj traci", + "settings.general.row.editToolPartsExpanded.title": "Proširi dijelove alata za uređivanje", + "settings.general.row.editToolPartsExpanded.description": + "Prikaži dijelove alata za uređivanje, pisanje i patch podrazumijevano proširene na vremenskoj traci", "settings.general.row.wayland.title": "Koristi nativni Wayland", "settings.general.row.wayland.description": "Onemogući X11 fallback na Waylandu. Zahtijeva restart.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/da.ts b/packages/app/src/i18n/da.ts index c5d2dc25f1fb..fabefcab7562 100644 --- a/packages/app/src/i18n/da.ts +++ b/packages/app/src/i18n/da.ts @@ -594,6 +594,7 @@ export const dict = { "settings.general.section.notifications": "Systemmeddelelser", "settings.general.section.updates": "Opdateringer", "settings.general.section.sounds": "Lydeffekter", + "settings.general.section.feed": "Feed", "settings.general.section.display": "Skærm", "settings.general.row.language.title": "Sprog", @@ -605,6 +606,11 @@ export const dict = { "settings.general.row.font.title": "Skrifttype", "settings.general.row.font.description": "Tilpas mono-skrifttypen brugt i kodeblokke", + "settings.general.row.shellToolPartsExpanded.title": "Udvid shell-værktøjsdele", + "settings.general.row.shellToolPartsExpanded.description": "Vis shell-værktøjsdele udvidet som standard i tidslinjen", + "settings.general.row.editToolPartsExpanded.title": "Udvid edit-værktøjsdele", + "settings.general.row.editToolPartsExpanded.description": + "Vis edit-, write- og patch-værktøjsdele udvidet som standard i tidslinjen", "settings.general.row.wayland.title": "Brug native Wayland", "settings.general.row.wayland.description": "Deaktiver X11-fallback på Wayland. Kræver genstart.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/de.ts b/packages/app/src/i18n/de.ts index 34a80ee4c5f9..3a7bbe927727 100644 --- a/packages/app/src/i18n/de.ts +++ b/packages/app/src/i18n/de.ts @@ -544,6 +544,7 @@ export const dict = { "settings.general.section.notifications": "Systembenachrichtigungen", "settings.general.section.updates": "Updates", "settings.general.section.sounds": "Soundeffekte", + "settings.general.section.feed": "Feed", "settings.general.section.display": "Anzeige", "settings.general.row.language.title": "Sprache", "settings.general.row.language.description": "Die Anzeigesprache für OpenCode ändern", @@ -553,6 +554,12 @@ export const dict = { "settings.general.row.theme.description": "Das Thema von OpenCode anpassen.", "settings.general.row.font.title": "Schriftart", "settings.general.row.font.description": "Die in Codeblöcken verwendete Monospace-Schriftart anpassen", + "settings.general.row.shellToolPartsExpanded.title": "Shell-Tool-Abschnitte ausklappen", + "settings.general.row.shellToolPartsExpanded.description": + "Shell-Tool-Abschnitte standardmäßig in der Timeline ausgeklappt anzeigen", + "settings.general.row.editToolPartsExpanded.title": "Edit-Tool-Abschnitte ausklappen", + "settings.general.row.editToolPartsExpanded.description": + "Edit-, Write- und Patch-Tool-Abschnitte standardmäßig in der Timeline ausgeklappt anzeigen", "settings.general.row.wayland.title": "Natives Wayland verwenden", "settings.general.row.wayland.description": "X11-Fallback unter Wayland deaktivieren. Erfordert Neustart.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/en.ts b/packages/app/src/i18n/en.ts index 7ba82066c785..0fa3777dde63 100644 --- a/packages/app/src/i18n/en.ts +++ b/packages/app/src/i18n/en.ts @@ -600,6 +600,7 @@ export const dict = { "settings.general.section.notifications": "System notifications", "settings.general.section.updates": "Updates", "settings.general.section.sounds": "Sound effects", + "settings.general.section.feed": "Feed", "settings.general.section.display": "Display", "settings.general.row.language.title": "Language", @@ -612,6 +613,12 @@ export const dict = { "settings.general.row.font.description": "Customise the mono font used in code blocks", "settings.general.row.reasoningSummaries.title": "Show reasoning summaries", "settings.general.row.reasoningSummaries.description": "Display model reasoning summaries in the timeline", + "settings.general.row.shellToolPartsExpanded.title": "Expand shell tool parts", + "settings.general.row.shellToolPartsExpanded.description": + "Show shell tool parts expanded by default in the timeline", + "settings.general.row.editToolPartsExpanded.title": "Expand edit tool parts", + "settings.general.row.editToolPartsExpanded.description": + "Show edit, write, and patch tool parts expanded by default in the timeline", "settings.general.row.wayland.title": "Use native Wayland", "settings.general.row.wayland.description": "Disable X11 fallback on Wayland. Requires restart.", diff --git a/packages/app/src/i18n/es.ts b/packages/app/src/i18n/es.ts index 28988bba1e14..b55d54c0ca55 100644 --- a/packages/app/src/i18n/es.ts +++ b/packages/app/src/i18n/es.ts @@ -602,6 +602,7 @@ export const dict = { "settings.general.section.notifications": "Notificaciones del sistema", "settings.general.section.updates": "Actualizaciones", "settings.general.section.sounds": "Efectos de sonido", + "settings.general.section.feed": "Feed", "settings.general.section.display": "Pantalla", "settings.general.row.language.title": "Idioma", @@ -613,6 +614,12 @@ export const dict = { "settings.general.row.font.title": "Fuente", "settings.general.row.font.description": "Personaliza la fuente monoespaciada usada en bloques de código", + "settings.general.row.shellToolPartsExpanded.title": "Expandir partes de la herramienta shell", + "settings.general.row.shellToolPartsExpanded.description": + "Mostrar las partes de la herramienta shell expandidas por defecto en la línea de tiempo", + "settings.general.row.editToolPartsExpanded.title": "Expandir partes de la herramienta de edición", + "settings.general.row.editToolPartsExpanded.description": + "Mostrar las partes de las herramientas de edición, escritura y parcheado expandidas por defecto en la línea de tiempo", "settings.general.row.wayland.title": "Usar Wayland nativo", "settings.general.row.wayland.description": "Deshabilitar fallback a X11 en Wayland. Requiere reinicio.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/fr.ts b/packages/app/src/i18n/fr.ts index 643c5e821134..c961f060e1fd 100644 --- a/packages/app/src/i18n/fr.ts +++ b/packages/app/src/i18n/fr.ts @@ -543,6 +543,7 @@ export const dict = { "settings.general.section.notifications": "Notifications système", "settings.general.section.updates": "Mises à jour", "settings.general.section.sounds": "Effets sonores", + "settings.general.section.feed": "Flux", "settings.general.section.display": "Affichage", "settings.general.row.language.title": "Langue", "settings.general.row.language.description": "Changer la langue d'affichage pour OpenCode", @@ -552,6 +553,12 @@ export const dict = { "settings.general.row.theme.description": "Personnaliser le thème d'OpenCode.", "settings.general.row.font.title": "Police", "settings.general.row.font.description": "Personnaliser la police mono utilisée dans les blocs de code", + "settings.general.row.shellToolPartsExpanded.title": "Développer les parties de l'outil shell", + "settings.general.row.shellToolPartsExpanded.description": + "Afficher les parties de l'outil shell développées par défaut dans la chronologie", + "settings.general.row.editToolPartsExpanded.title": "Développer les parties de l'outil edit", + "settings.general.row.editToolPartsExpanded.description": + "Afficher les parties des outils edit, write et patch développées par défaut dans la chronologie", "settings.general.row.wayland.title": "Utiliser Wayland natif", "settings.general.row.wayland.description": "Désactiver le repli X11 sur Wayland. Nécessite un redémarrage.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/ja.ts b/packages/app/src/i18n/ja.ts index 5f6e92402525..7a62c9de2716 100644 --- a/packages/app/src/i18n/ja.ts +++ b/packages/app/src/i18n/ja.ts @@ -533,6 +533,7 @@ export const dict = { "settings.general.section.notifications": "システム通知", "settings.general.section.updates": "アップデート", "settings.general.section.sounds": "効果音", + "settings.general.section.feed": "フィード", "settings.general.section.display": "ディスプレイ", "settings.general.row.language.title": "言語", "settings.general.row.language.description": "OpenCodeの表示言語を変更します", @@ -542,6 +543,12 @@ export const dict = { "settings.general.row.theme.description": "OpenCodeのテーマをカスタマイズします。", "settings.general.row.font.title": "フォント", "settings.general.row.font.description": "コードブロックで使用する等幅フォントをカスタマイズします", + "settings.general.row.shellToolPartsExpanded.title": "shell ツールパーツを展開", + "settings.general.row.shellToolPartsExpanded.description": + "タイムラインで shell ツールパーツをデフォルトで展開して表示します", + "settings.general.row.editToolPartsExpanded.title": "edit ツールパーツを展開", + "settings.general.row.editToolPartsExpanded.description": + "タイムラインで edit、write、patch ツールパーツをデフォルトで展開して表示します", "settings.general.row.wayland.title": "ネイティブWaylandを使用", "settings.general.row.wayland.description": "WaylandでのX11フォールバックを無効にします。再起動が必要です。", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/ko.ts b/packages/app/src/i18n/ko.ts index d5a0b090b93d..8967c71cff7d 100644 --- a/packages/app/src/i18n/ko.ts +++ b/packages/app/src/i18n/ko.ts @@ -534,6 +534,7 @@ export const dict = { "settings.general.section.notifications": "시스템 알림", "settings.general.section.updates": "업데이트", "settings.general.section.sounds": "효과음", + "settings.general.section.feed": "피드", "settings.general.section.display": "디스플레이", "settings.general.row.language.title": "언어", "settings.general.row.language.description": "OpenCode 표시 언어 변경", @@ -543,6 +544,12 @@ export const dict = { "settings.general.row.theme.description": "OpenCode 테마 사용자 지정", "settings.general.row.font.title": "글꼴", "settings.general.row.font.description": "코드 블록에 사용되는 고정폭 글꼴 사용자 지정", + "settings.general.row.shellToolPartsExpanded.title": "shell 도구 파트 펼치기", + "settings.general.row.shellToolPartsExpanded.description": + "타임라인에서 기본적으로 shell 도구 파트를 펼친 상태로 표시합니다", + "settings.general.row.editToolPartsExpanded.title": "edit 도구 파트 펼치기", + "settings.general.row.editToolPartsExpanded.description": + "타임라인에서 기본적으로 edit, write, patch 도구 파트를 펼친 상태로 표시합니다", "settings.general.row.wayland.title": "네이티브 Wayland 사용", "settings.general.row.wayland.description": "Wayland에서 X11 폴백을 비활성화합니다. 다시 시작해야 합니다.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/no.ts b/packages/app/src/i18n/no.ts index 10a8c1042fa0..8e1b1ce629dc 100644 --- a/packages/app/src/i18n/no.ts +++ b/packages/app/src/i18n/no.ts @@ -602,6 +602,7 @@ export const dict = { "settings.general.section.notifications": "Systemvarsler", "settings.general.section.updates": "Oppdateringer", "settings.general.section.sounds": "Lydeffekter", + "settings.general.section.feed": "Feed", "settings.general.section.display": "Skjerm", "settings.general.row.language.title": "Språk", @@ -613,6 +614,11 @@ export const dict = { "settings.general.row.font.title": "Skrift", "settings.general.row.font.description": "Tilpass mono-skriften som brukes i kodeblokker", + "settings.general.row.shellToolPartsExpanded.title": "Utvid shell-verktøydeler", + "settings.general.row.shellToolPartsExpanded.description": "Vis shell-verktøydeler utvidet som standard i tidslinjen", + "settings.general.row.editToolPartsExpanded.title": "Utvid edit-verktøydeler", + "settings.general.row.editToolPartsExpanded.description": + "Vis edit-, write- og patch-verktøydeler utvidet som standard i tidslinjen", "settings.general.row.wayland.title": "Bruk innebygd Wayland", "settings.general.row.wayland.description": "Deaktiver X11-fallback på Wayland. Krever omstart.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/pl.ts b/packages/app/src/i18n/pl.ts index 9038fd1ad2f9..9b924fd642ea 100644 --- a/packages/app/src/i18n/pl.ts +++ b/packages/app/src/i18n/pl.ts @@ -534,6 +534,7 @@ export const dict = { "settings.general.section.notifications": "Powiadomienia systemowe", "settings.general.section.updates": "Aktualizacje", "settings.general.section.sounds": "Efekty dźwiękowe", + "settings.general.section.feed": "Kanał", "settings.general.section.display": "Ekran", "settings.general.row.language.title": "Język", "settings.general.row.language.description": "Zmień język wyświetlania dla OpenCode", @@ -543,6 +544,12 @@ export const dict = { "settings.general.row.theme.description": "Dostosuj motyw OpenCode.", "settings.general.row.font.title": "Czcionka", "settings.general.row.font.description": "Dostosuj czcionkę mono używaną w blokach kodu", + "settings.general.row.shellToolPartsExpanded.title": "Rozwijaj elementy narzędzia shell", + "settings.general.row.shellToolPartsExpanded.description": + "Domyślnie pokazuj rozwinięte elementy narzędzia shell na osi czasu", + "settings.general.row.editToolPartsExpanded.title": "Rozwijaj elementy narzędzia edit", + "settings.general.row.editToolPartsExpanded.description": + "Domyślnie pokazuj rozwinięte elementy narzędzi edit, write i patch na osi czasu", "settings.general.row.wayland.title": "Użyj natywnego Wayland", "settings.general.row.wayland.description": "Wyłącz fallback X11 na Wayland. Wymaga restartu.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/ru.ts b/packages/app/src/i18n/ru.ts index 69fee5c89a4f..cf02285821e4 100644 --- a/packages/app/src/i18n/ru.ts +++ b/packages/app/src/i18n/ru.ts @@ -600,6 +600,7 @@ export const dict = { "settings.general.section.notifications": "Системные уведомления", "settings.general.section.updates": "Обновления", "settings.general.section.sounds": "Звуковые эффекты", + "settings.general.section.feed": "Лента", "settings.general.section.display": "Дисплей", "settings.general.row.language.title": "Язык", @@ -611,6 +612,12 @@ export const dict = { "settings.general.row.font.title": "Шрифт", "settings.general.row.font.description": "Настройте моноширинный шрифт для блоков кода", + "settings.general.row.shellToolPartsExpanded.title": "Разворачивать элементы инструмента shell", + "settings.general.row.shellToolPartsExpanded.description": + "Показывать элементы инструмента shell в ленте развернутыми по умолчанию", + "settings.general.row.editToolPartsExpanded.title": "Разворачивать элементы инструмента edit", + "settings.general.row.editToolPartsExpanded.description": + "Показывать элементы инструментов edit, write и patch в ленте развернутыми по умолчанию", "settings.general.row.wayland.title": "Использовать нативный Wayland", "settings.general.row.wayland.description": "Отключить X11 fallback на Wayland. Требуется перезапуск.", "settings.general.row.wayland.tooltip": diff --git a/packages/app/src/i18n/th.ts b/packages/app/src/i18n/th.ts index d66c8f6075b8..1b8abe953b77 100644 --- a/packages/app/src/i18n/th.ts +++ b/packages/app/src/i18n/th.ts @@ -594,6 +594,7 @@ export const dict = { "settings.general.section.notifications": "การแจ้งเตือนระบบ", "settings.general.section.updates": "การอัปเดต", "settings.general.section.sounds": "เสียงเอฟเฟกต์", + "settings.general.section.feed": "ฟีด", "settings.general.section.display": "การแสดงผล", "settings.general.row.language.title": "ภาษา", @@ -605,6 +606,11 @@ export const dict = { "settings.general.row.font.title": "ฟอนต์", "settings.general.row.font.description": "ปรับแต่งฟอนต์โมโนที่ใช้ในบล็อกโค้ด", + "settings.general.row.shellToolPartsExpanded.title": "ขยายส่วนเครื่องมือ shell", + "settings.general.row.shellToolPartsExpanded.description": "แสดงส่วนเครื่องมือ shell แบบขยายตามค่าเริ่มต้นในไทม์ไลน์", + "settings.general.row.editToolPartsExpanded.title": "ขยายส่วนเครื่องมือ edit", + "settings.general.row.editToolPartsExpanded.description": + "แสดงส่วนเครื่องมือ edit, write และ patch แบบขยายตามค่าเริ่มต้นในไทม์ไลน์", "settings.general.row.wayland.title": "ใช้ Wayland แบบเนทีฟ", "settings.general.row.wayland.description": "ปิดใช้งาน X11 fallback บน Wayland ต้องรีสตาร์ท", "settings.general.row.wayland.tooltip": "บน Linux ที่มีจอภาพรีเฟรชเรตแบบผสม Wayland แบบเนทีฟอาจเสถียรกว่า", diff --git a/packages/app/src/i18n/zh.ts b/packages/app/src/i18n/zh.ts index 46daeb701ff4..62c7bb9ff233 100644 --- a/packages/app/src/i18n/zh.ts +++ b/packages/app/src/i18n/zh.ts @@ -595,6 +595,7 @@ export const dict = { "settings.general.section.notifications": "系统通知", "settings.general.section.updates": "更新", "settings.general.section.sounds": "音效", + "settings.general.section.feed": "动态", "settings.general.section.display": "显示", "settings.general.row.language.title": "语言", "settings.general.row.language.description": "更改 OpenCode 的显示语言", @@ -604,6 +605,10 @@ export const dict = { "settings.general.row.theme.description": "自定义 OpenCode 的主题。", "settings.general.row.font.title": "字体", "settings.general.row.font.description": "自定义代码块使用的等宽字体", + "settings.general.row.shellToolPartsExpanded.title": "展开 shell 工具部分", + "settings.general.row.shellToolPartsExpanded.description": "默认在时间线中展开 shell 工具部分", + "settings.general.row.editToolPartsExpanded.title": "展开编辑工具部分", + "settings.general.row.editToolPartsExpanded.description": "默认在时间线中展开 edit、write 和 patch 工具部分", "settings.general.row.wayland.title": "使用原生 Wayland", "settings.general.row.wayland.description": "在 Wayland 上禁用 X11 回退。需要重启。", "settings.general.row.wayland.tooltip": "在混合刷新率显示器的 Linux 系统上,原生 Wayland 可能更稳定。", diff --git a/packages/app/src/i18n/zht.ts b/packages/app/src/i18n/zht.ts index bbb00727b708..cb8f068f63b7 100644 --- a/packages/app/src/i18n/zht.ts +++ b/packages/app/src/i18n/zht.ts @@ -589,6 +589,7 @@ export const dict = { "settings.general.section.notifications": "系統通知", "settings.general.section.updates": "更新", "settings.general.section.sounds": "音效", + "settings.general.section.feed": "資訊流", "settings.general.section.display": "顯示", "settings.general.row.language.title": "語言", @@ -600,6 +601,10 @@ export const dict = { "settings.general.row.font.title": "字型", "settings.general.row.font.description": "自訂程式碼區塊使用的等寬字型", + "settings.general.row.shellToolPartsExpanded.title": "展開 shell 工具區塊", + "settings.general.row.shellToolPartsExpanded.description": "在時間軸中預設展開 shell 工具區塊", + "settings.general.row.editToolPartsExpanded.title": "展開 edit 工具區塊", + "settings.general.row.editToolPartsExpanded.description": "在時間軸中預設展開 edit、write 和 patch 工具區塊", "settings.general.row.wayland.title": "使用原生 Wayland", "settings.general.row.wayland.description": "在 Wayland 上停用 X11 後備模式。需要重新啟動。", "settings.general.row.wayland.tooltip": "在混合更新率螢幕的 Linux 系統上,原生 Wayland 可能更穩定。", diff --git a/packages/app/src/pages/session/message-timeline.tsx b/packages/app/src/pages/session/message-timeline.tsx index b13ccb474ac3..615d1a0bea4d 100644 --- a/packages/app/src/pages/session/message-timeline.tsx +++ b/packages/app/src/pages/session/message-timeline.tsx @@ -539,6 +539,8 @@ export function MessageTimeline(props: { messageID={message.id} lastUserMessageID={props.lastUserMessageID} showReasoningSummaries={settings.general.showReasoningSummaries()} + shellToolDefaultOpen={settings.general.shellToolPartsExpanded()} + editToolDefaultOpen={settings.general.editToolPartsExpanded()} classes={{ root: "min-w-0 w-full relative", content: "flex flex-col justify-between !overflow-visible", diff --git a/packages/ui/src/components/message-part.css b/packages/ui/src/components/message-part.css index 07a718141a9b..ce76d8e18877 100644 --- a/packages/ui/src/components/message-part.css +++ b/packages/ui/src/components/message-part.css @@ -332,14 +332,6 @@ } } -[data-slot="collapsible-content"]:has([data-component="edit-content"]), -[data-slot="collapsible-content"]:has([data-component="write-content"]) { - border: 1px solid var(--border-weak-base); - border-radius: 6px; - background: transparent; - overflow: hidden; -} - [data-component="bash-output"] { width: 100%; border: 1px solid var(--border-weak-base); @@ -399,11 +391,6 @@ } } -[data-slot="collapsible-content"]:has([data-component="edit-content"]) [data-component="edit-content"], -[data-slot="collapsible-content"]:has([data-component="write-content"]) [data-component="write-content"] { - border-top: none; -} - [data-component="edit-trigger"], [data-component="write-trigger"] { display: flex; @@ -492,9 +479,8 @@ [data-component="edit-content"] { border-radius: inherit; border-top: 1px solid var(--border-weaker-base); - max-height: 420px; overflow-x: hidden; - overflow-y: auto; + overflow-y: visible; scrollbar-width: none; -ms-overflow-style: none; @@ -512,9 +498,8 @@ [data-component="write-content"] { border-radius: inherit; border-top: 1px solid var(--border-weaker-base); - max-height: 240px; overflow-x: hidden; - overflow-y: auto; + overflow-y: visible; [data-component="code"] { padding-bottom: 0 !important; @@ -1212,11 +1197,18 @@ } } +[data-component="edit-tool"], +[data-component="write-tool"], [data-component="apply-patch-tool"] { > [data-component="collapsible"].tool-collapsible { gap: 0px; } + > [data-component="collapsible"] > [data-slot="collapsible-content"] { + border: none; + background: transparent; + } + > [data-component="collapsible"] > [data-slot="collapsible-trigger"][aria-expanded="true"] { position: sticky; top: var(--sticky-accordion-top, 0px); @@ -1298,7 +1290,7 @@ [data-component="apply-patch-file-diff"] { border-radius: inherit; overflow-x: hidden; - overflow-y: auto; + overflow-y: visible; scrollbar-width: none; -ms-overflow-style: none; diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index 828ddbe87d8e..adba42ce9306 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -276,12 +276,24 @@ function renderable(part: PartType, showReasoningSummaries = true) { return !!PART_MAPPING[part.type] } +function toolDefaultOpen(tool: string, shell = false, edit = false) { + if (tool === "bash") return shell + if (tool === "edit" || tool === "write" || tool === "apply_patch") return edit +} + +function partDefaultOpen(part: PartType, shell = false, edit = false) { + if (part.type !== "tool") return + return toolDefaultOpen(part.tool, shell, edit) +} + export function AssistantParts(props: { messages: AssistantMessage[] showAssistantCopyPartID?: string | null turnDurationMs?: number working?: boolean showReasoningSummaries?: boolean + shellToolDefaultOpen?: boolean + editToolDefaultOpen?: boolean }) { const data = useData() const emptyParts: PartType[] = [] @@ -372,6 +384,7 @@ export function AssistantParts(props: { message={entry().message} showAssistantCopyPartID={props.showAssistantCopyPartID} turnDurationMs={props.turnDurationMs} + defaultOpen={partDefaultOpen(entry().part, props.shellToolDefaultOpen, props.editToolDefaultOpen)} /> )} @@ -900,6 +913,42 @@ export const ToolRegistry = { render: getTool, } +function ToolFileAccordion(props: { path: string; actions?: JSX.Element; children: JSX.Element }) { + const value = createMemo(() => props.path || "tool-file") + + return ( + + + + +
+
+ +
+ + {`\u202A${getDirectory(props.path)}\u202C`} + + {getFilename(props.path)} +
+
+
+ {props.actions} + +
+
+
+
+ {props.children} +
+
+ ) +} + PART_MAPPING["tool"] = function ToolPartDisplay(props) { const data = useData() const i18n = useI18n() @@ -1479,57 +1528,67 @@ ToolRegistry.register({ const i18n = useI18n() const diffComponent = useDiffComponent() const diagnostics = createMemo(() => getDiagnostics(props.metadata.diagnostics, props.input.filePath)) + const path = createMemo(() => props.metadata?.filediff?.file || props.input.filePath || "") const filename = () => getFilename(props.input.filePath ?? "") const pending = () => props.status === "pending" || props.status === "running" return ( - -
-
- - - +
+ +
+
+ + + + + + + {filename()} - - - {filename()} +
+ +
+ {getDirectory(props.input.filePath!)} +
+
+
+
+ +
- -
- {getDirectory(props.input.filePath!)} -
-
-
-
- - -
-
- } - > - -
- -
-
- - + } + > + + {(diff) => } + } + > +
+ +
+ + + + +
) }, }) @@ -1540,51 +1599,56 @@ ToolRegistry.register({ const i18n = useI18n() const codeComponent = useCodeComponent() const diagnostics = createMemo(() => getDiagnostics(props.metadata.diagnostics, props.input.filePath)) + const path = createMemo(() => props.input.filePath || "") const filename = () => getFilename(props.input.filePath ?? "") const pending = () => props.status === "pending" || props.status === "running" return ( - -
-
- - - +
+ +
+
+ + + + + + + {filename()} - - - {filename()} +
+ +
+ {getDirectory(props.input.filePath!)} +
- -
- {getDirectory(props.input.filePath!)} -
-
+
{/* */}
-
{/* */}
-
- } - > - -
- -
-
- - + } + > + + +
+ +
+
+
+ + +
) }, }) @@ -1731,45 +1795,73 @@ ToolRegistry.register({ } > {(file) => ( - -
-
- - - +
+ +
+
+ + + + + + + {getFilename(file().relativePath)} - +
+ +
+ {getDirectory(file().relativePath)} +
+
+
+
- {getFilename(file().relativePath)} +
- -
- {getDirectory(file().relativePath)} -
-
-
- - - + } + > + + + + {i18n.t("ui.patch.action.created")} + + + + + {i18n.t("ui.patch.action.deleted")} + + + + + {i18n.t("ui.patch.action.moved")} + + + + + + + } + > +
+
-
- } - > -
- -
- + + +
)} ) diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsx index 8e8a3f3875d4..0eceb754c81f 100644 --- a/packages/ui/src/components/session-turn.tsx +++ b/packages/ui/src/components/session-turn.tsx @@ -140,6 +140,8 @@ export function SessionTurn( messageID: string lastUserMessageID?: string showReasoningSummaries?: boolean + shellToolDefaultOpen?: boolean + editToolDefaultOpen?: boolean onUserInteracted?: () => void classes?: { root?: string @@ -369,6 +371,8 @@ export function SessionTurn( turnDurationMs={turnDurationMs()} working={working()} showReasoningSummaries={showReasoningSummaries()} + shellToolDefaultOpen={props.shellToolDefaultOpen} + editToolDefaultOpen={props.editToolDefaultOpen} />
From eb64ce08b8a862c27b7dab58c3a8d2ea1981655f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Feb 2026 22:28:32 +0000 Subject: [PATCH 05/95] Update VOUCHED list https://github.com/anomalyco/opencode/issues/13659#issuecomment-3941825887 --- .github/VOUCHED.td | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/VOUCHED.td b/.github/VOUCHED.td index 4be318d51892..28535b577992 100644 --- a/.github/VOUCHED.td +++ b/.github/VOUCHED.td @@ -10,6 +10,7 @@ adamdotdevin -agusbasari29 AI PR slop ariane-emory +edemaine -florianleibert fwang iamdavidhill From a74fedd23beecc70cb7cf7f07c6a14186787c960 Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Sun, 22 Feb 2026 18:49:05 -0500 Subject: [PATCH 06/95] fix(desktop): change detection on Windows, especially Cygwin (#13659) Co-authored-by: LukeParkerDev <10430890+Hona@users.noreply.github.com> --- packages/app/src/context/file/path.test.ts | 8 ++++ packages/app/src/context/file/path.ts | 24 ++++++----- packages/app/src/i18n/en.ts | 1 + packages/app/src/pages/session.tsx | 7 ++- packages/opencode/src/file/watcher.ts | 43 ++++++++++--------- packages/opencode/src/project/project.ts | 21 +++++++-- packages/opencode/src/tool/bash.ts | 5 +-- packages/opencode/src/util/filesystem.ts | 12 ++++++ .../opencode/test/util/filesystem.test.ts | 34 +++++++++++++++ 9 files changed, 115 insertions(+), 40 deletions(-) diff --git a/packages/app/src/context/file/path.test.ts b/packages/app/src/context/file/path.test.ts index f2a3c44b6c4a..7eb5e8b2a358 100644 --- a/packages/app/src/context/file/path.test.ts +++ b/packages/app/src/context/file/path.test.ts @@ -13,6 +13,14 @@ describe("file path helpers", () => { expect(path.pathFromTab("other://src/app.ts")).toBeUndefined() }) + test("normalizes Windows absolute paths with mixed separators", () => { + const path = createPathHelpers(() => "C:\\repo") + expect(path.normalize("C:\\repo\\src\\app.ts")).toBe("src/app.ts") + expect(path.normalize("C:/repo/src/app.ts")).toBe("src/app.ts") + expect(path.normalize("file://C:/repo/src/app.ts")).toBe("src/app.ts") + expect(path.normalize("c:\\repo\\src\\app.ts")).toBe("src/app.ts") + }) + test("keeps query/hash stripping behavior stable", () => { expect(stripQueryAndHash("a/b.ts#L12?x=1")).toBe("a/b.ts") expect(stripQueryAndHash("a/b.ts?x=1#L12")).toBe("a/b.ts") diff --git a/packages/app/src/context/file/path.ts b/packages/app/src/context/file/path.ts index 859fdc04062f..6be7588f93c6 100644 --- a/packages/app/src/context/file/path.ts +++ b/packages/app/src/context/file/path.ts @@ -103,16 +103,20 @@ export function encodeFilePath(filepath: string): string { export function createPathHelpers(scope: () => string) { const normalize = (input: string) => { - const root = scope() - const prefix = root.endsWith("/") ? root : root + "/" - - let path = unquoteGitPath(decodeFilePath(stripQueryAndHash(stripFileProtocol(input)))) - - if (path.startsWith(prefix)) { - path = path.slice(prefix.length) - } - - if (path.startsWith(root)) { + const root = scope().replace(/\\/g, "/") + + let path = unquoteGitPath(decodeFilePath(stripQueryAndHash(stripFileProtocol(input)))).replace(/\\/g, "/") + + // Remove initial root prefix, if it's a complete match or followed by / + // (don't want /foo/bar to root of /f). + // For Windows paths, also check for case-insensitive match. + const windows = /^[A-Za-z]:/.test(root) + const canonRoot = windows ? root.toLowerCase() : root + const canonPath = windows ? path.toLowerCase() : path + if (canonPath.startsWith(canonRoot) && + (canonRoot.endsWith("/") || canonPath === canonRoot || + canonPath.startsWith(canonRoot + "/"))) { + // If we match canonRoot + "/", the slash will be removed below. path = path.slice(root.length) } diff --git a/packages/app/src/i18n/en.ts b/packages/app/src/i18n/en.ts index 0fa3777dde63..992509fcfa4e 100644 --- a/packages/app/src/i18n/en.ts +++ b/packages/app/src/i18n/en.ts @@ -495,6 +495,7 @@ export const dict = { "session.review.change.other": "Changes", "session.review.loadingChanges": "Loading changes...", "session.review.empty": "No changes in this session yet", + "session.review.noVcs": "No git VCS detected, so session changes will not be detected", "session.review.noChanges": "No changes", "session.files.selectToOpen": "Select a file to open", diff --git a/packages/app/src/pages/session.tsx b/packages/app/src/pages/session.tsx index a3f4b7164b4b..e0ef92682d94 100644 --- a/packages/app/src/pages/session.tsx +++ b/packages/app/src/pages/session.tsx @@ -274,6 +274,11 @@ export default function Page() { if (!hasReview()) return true return sync.data.session_diff[id] !== undefined }) + const reviewEmptyKey = createMemo(() => { + const project = sync.project + if (!project || project.vcs) return "session.review.empty" + return "session.review.noVcs" + }) let inputRef!: HTMLDivElement let promptDock: HTMLDivElement | undefined @@ -531,7 +536,7 @@ export default function Page() { ) : (
-
{language.t("session.review.empty")}
+
{language.t(reviewEmptyKey())}
) } diff --git a/packages/opencode/src/file/watcher.ts b/packages/opencode/src/file/watcher.ts index c4a4747777e2..626a746c832d 100644 --- a/packages/opencode/src/file/watcher.ts +++ b/packages/opencode/src/file/watcher.ts @@ -46,7 +46,6 @@ export namespace FileWatcher { const state = Instance.state( async () => { - if (Instance.project.vcs !== "git") return {} log.info("init") const cfg = await Config.get() const backend = (() => { @@ -88,26 +87,28 @@ export namespace FileWatcher { if (sub) subs.push(sub) } - const vcsDir = await $`git rev-parse --git-dir` - .quiet() - .nothrow() - .cwd(Instance.worktree) - .text() - .then((x) => path.resolve(Instance.worktree, x.trim())) - .catch(() => undefined) - if (vcsDir && !cfgIgnores.includes(".git") && !cfgIgnores.includes(vcsDir)) { - const gitDirContents = await readdir(vcsDir).catch(() => []) - const ignoreList = gitDirContents.filter((entry) => entry !== "HEAD") - const pending = w.subscribe(vcsDir, subscribe, { - ignore: ignoreList, - backend, - }) - const sub = await withTimeout(pending, SUBSCRIBE_TIMEOUT_MS).catch((err) => { - log.error("failed to subscribe to vcsDir", { error: err }) - pending.then((s) => s.unsubscribe()).catch(() => {}) - return undefined - }) - if (sub) subs.push(sub) + if (Instance.project.vcs === "git") { + const vcsDir = await $`git rev-parse --git-dir` + .quiet() + .nothrow() + .cwd(Instance.worktree) + .text() + .then((x) => path.resolve(Instance.worktree, x.trim())) + .catch(() => undefined) + if (vcsDir && !cfgIgnores.includes(".git") && !cfgIgnores.includes(vcsDir)) { + const gitDirContents = await readdir(vcsDir).catch(() => []) + const ignoreList = gitDirContents.filter((entry) => entry !== "HEAD") + const pending = w.subscribe(vcsDir, subscribe, { + ignore: ignoreList, + backend, + }) + const sub = await withTimeout(pending, SUBSCRIBE_TIMEOUT_MS).catch((err) => { + log.error("failed to subscribe to vcsDir", { error: err }) + pending.then((s) => s.unsubscribe()).catch(() => {}) + return undefined + }) + if (sub) subs.push(sub) + } } return { subs } diff --git a/packages/opencode/src/project/project.ts b/packages/opencode/src/project/project.ts index e49d9686136d..adbe2b9fb159 100644 --- a/packages/opencode/src/project/project.ts +++ b/packages/opencode/src/project/project.ts @@ -17,6 +17,19 @@ import { Glob } from "../util/glob" export namespace Project { const log = Log.create({ service: "project" }) + + function gitpath(cwd: string, name: string) { + if (!name) return cwd + // git output includes trailing newlines; keep path whitespace intact. + name = name.replace(/[\r\n]+$/, "") + if (!name) return cwd + + name = Filesystem.windowsPath(name) + + if (path.isAbsolute(name)) return path.normalize(name) + return path.resolve(cwd, name) + } + export const Info = z .object({ id: z.string(), @@ -141,7 +154,7 @@ export namespace Project { const top = await git(["rev-parse", "--show-toplevel"], { cwd: sandbox, }) - .then(async (result) => path.resolve(sandbox, (await result.text()).trim())) + .then(async (result) => gitpath(sandbox, await result.text())) .catch(() => undefined) if (!top) { @@ -159,9 +172,9 @@ export namespace Project { cwd: sandbox, }) .then(async (result) => { - const dirname = path.dirname((await result.text()).trim()) - if (dirname === ".") return sandbox - return dirname + const common = gitpath(sandbox, await result.text()) + // Avoid going to parent of sandbox when git-common-dir is empty. + return common === sandbox ? sandbox : path.dirname(common) }) .catch(() => undefined) diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.ts index ee2279bbfbeb..ee20d20c5068 100644 --- a/packages/opencode/src/tool/bash.ts +++ b/packages/opencode/src/tool/bash.ts @@ -124,11 +124,8 @@ export const BashTool = Tool.define("bash", async () => { .then((x) => x.trim()) log.info("resolved path", { arg, resolved }) if (resolved) { - // Git Bash on Windows returns Unix-style paths like /c/Users/... const normalized = - process.platform === "win32" && resolved.match(/^\/[a-z]\//) - ? resolved.replace(/^\/([a-z])\//, (_, drive) => `${drive.toUpperCase()}:\\`).replace(/\//g, "\\") - : resolved + process.platform === "win32" ? Filesystem.windowsPath(resolved).replace(/\//g, "\\") : resolved if (!Instance.containsPath(normalized)) { const dir = (await Filesystem.isDir(normalized)) ? normalized : path.dirname(normalized) directories.add(dir) diff --git a/packages/opencode/src/util/filesystem.ts b/packages/opencode/src/util/filesystem.ts index 3a1e8b8ec156..a87aaeb98669 100644 --- a/packages/opencode/src/util/filesystem.ts +++ b/packages/opencode/src/util/filesystem.ts @@ -113,6 +113,18 @@ export namespace Filesystem { } } + export function windowsPath(p: string): string { + if (process.platform !== "win32") return p + return ( + p + // Git Bash for Windows paths are typically //... + .replace(/^\/([a-zA-Z])\//, (_, drive) => `${drive.toUpperCase()}:/`) + // Cygwin git paths are typically /cygdrive//... + .replace(/^\/cygdrive\/([a-zA-Z])\//, (_, drive) => `${drive.toUpperCase()}:/`) + // WSL paths are typically /mnt//... + .replace(/^\/mnt\/([a-zA-Z])\//, (_, drive) => `${drive.toUpperCase()}:/`) + ) + } export function overlaps(a: string, b: string) { const relA = relative(a, b) const relB = relative(b, a) diff --git a/packages/opencode/test/util/filesystem.test.ts b/packages/opencode/test/util/filesystem.test.ts index 0f544793734e..a6255db88f56 100644 --- a/packages/opencode/test/util/filesystem.test.ts +++ b/packages/opencode/test/util/filesystem.test.ts @@ -286,6 +286,40 @@ describe("filesystem", () => { }) }) + describe("windowsPath()", () => { + test("converts Git Bash paths", () => { + if (process.platform === "win32") { + expect(Filesystem.windowsPath("/c/Users/test")).toBe("C:/Users/test") + expect(Filesystem.windowsPath("/d/dev/project")).toBe("D:/dev/project") + } else { + expect(Filesystem.windowsPath("/c/Users/test")).toBe("/c/Users/test") + } + }) + + test("converts Cygwin paths", () => { + if (process.platform === "win32") { + expect(Filesystem.windowsPath("/cygdrive/c/Users/test")).toBe("C:/Users/test") + expect(Filesystem.windowsPath("/cygdrive/x/dev/project")).toBe("X:/dev/project") + } else { + expect(Filesystem.windowsPath("/cygdrive/c/Users/test")).toBe("/cygdrive/c/Users/test") + } + }) + + test("converts WSL paths", () => { + if (process.platform === "win32") { + expect(Filesystem.windowsPath("/mnt/c/Users/test")).toBe("C:/Users/test") + expect(Filesystem.windowsPath("/mnt/z/dev/project")).toBe("Z:/dev/project") + } else { + expect(Filesystem.windowsPath("/mnt/c/Users/test")).toBe("/mnt/c/Users/test") + } + }) + + test("ignores normal Windows paths", () => { + expect(Filesystem.windowsPath("C:/Users/test")).toBe("C:/Users/test") + expect(Filesystem.windowsPath("D:\\dev\\project")).toBe("D:\\dev\\project") + }) + }) + describe("writeStream()", () => { test("writes from Web ReadableStream", async () => { await using tmp = await tmpdir() From faa63227ac5136b7f86961206e048a0cd598c514 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Sun, 22 Feb 2026 23:49:51 +0000 Subject: [PATCH 07/95] chore: generate --- packages/app/src/context/file/path.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/app/src/context/file/path.ts b/packages/app/src/context/file/path.ts index 6be7588f93c6..72c058aec6b7 100644 --- a/packages/app/src/context/file/path.ts +++ b/packages/app/src/context/file/path.ts @@ -113,9 +113,10 @@ export function createPathHelpers(scope: () => string) { const windows = /^[A-Za-z]:/.test(root) const canonRoot = windows ? root.toLowerCase() : root const canonPath = windows ? path.toLowerCase() : path - if (canonPath.startsWith(canonRoot) && - (canonRoot.endsWith("/") || canonPath === canonRoot || - canonPath.startsWith(canonRoot + "/"))) { + if ( + canonPath.startsWith(canonRoot) && + (canonRoot.endsWith("/") || canonPath === canonRoot || canonPath.startsWith(canonRoot + "/")) + ) { // If we match canonRoot + "/", the slash will be removed below. path = path.slice(root.length) } From a4ed020a943014d94ff405ff2e7960643e026527 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 23 Feb 2026 00:51:50 +0100 Subject: [PATCH 08/95] upgrade opentui to v0.1.81 (#14605) --- bun.lock | 22 +++++++++++----------- packages/opencode/package.json | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bun.lock b/bun.lock index 04da112cf791..d68a9228fe77 100644 --- a/bun.lock +++ b/bun.lock @@ -304,8 +304,8 @@ "@opencode-ai/sdk": "workspace:*", "@opencode-ai/util": "workspace:*", "@openrouter/ai-sdk-provider": "1.5.4", - "@opentui/core": "0.1.79", - "@opentui/solid": "0.1.79", + "@opentui/core": "0.1.81", + "@opentui/solid": "0.1.81", "@parcel/watcher": "2.5.1", "@pierre/diffs": "catalog:", "@solid-primitives/event-bus": "1.1.2", @@ -1314,21 +1314,21 @@ "@opentelemetry/api": ["@opentelemetry/api@1.9.0", "", {}, "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg=="], - "@opentui/core": ["@opentui/core@0.1.79", "", { "dependencies": { "bun-ffi-structs": "0.1.2", "diff": "8.0.2", "jimp": "1.6.0", "marked": "17.0.1", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@dimforge/rapier2d-simd-compat": "^0.17.3", "@opentui/core-darwin-arm64": "0.1.79", "@opentui/core-darwin-x64": "0.1.79", "@opentui/core-linux-arm64": "0.1.79", "@opentui/core-linux-x64": "0.1.79", "@opentui/core-win32-arm64": "0.1.79", "@opentui/core-win32-x64": "0.1.79", "bun-webgpu": "0.1.4", "planck": "^1.4.2", "three": "0.177.0" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-job/t09w8A/aHb/WuaVbimu5fIffyN+PCuVO5cYhXEg/NkOkC/WdFi80B8bwncR/DBPyLAh6oJ3EG86grOVo5g=="], + "@opentui/core": ["@opentui/core@0.1.81", "", { "dependencies": { "bun-ffi-structs": "0.1.2", "diff": "8.0.2", "jimp": "1.6.0", "marked": "17.0.1", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@dimforge/rapier2d-simd-compat": "^0.17.3", "@opentui/core-darwin-arm64": "0.1.81", "@opentui/core-darwin-x64": "0.1.81", "@opentui/core-linux-arm64": "0.1.81", "@opentui/core-linux-x64": "0.1.81", "@opentui/core-win32-arm64": "0.1.81", "@opentui/core-win32-x64": "0.1.81", "bun-webgpu": "0.1.5", "planck": "^1.4.2", "three": "0.177.0" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-ooFjkkQ80DDC4X5eLvH8dBcLAtWwGp9RTaWsaeWet3GOv4N0SDcN8mi1XGhYnUlTuxmofby5eQrPegjtWHODlA=="], - "@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.1.79", "", { "os": "darwin", "cpu": "arm64" }, "sha512-kgsGniV+DM5G1P3GideyJhvfnthNKcVCAm2mPTIr9InQ3L0gS/Feh7zgwOS/jxDvdlQbOWGKMk2Z3JApeC1MLw=="], + "@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.1.81", "", { "os": "darwin", "cpu": "arm64" }, "sha512-I3Ry5JbkSQXs2g1me8yYr0v3CUcIIfLHzbWz9WMFla8kQDSa+HOr8IpZbqZDeIFgOVzolAXBmZhg0VJI3bZ7MA=="], - "@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.1.79", "", { "os": "darwin", "cpu": "x64" }, "sha512-OpyAmFqAAKQ2CeFmf/oLWcNksmP6Ryx/3R5dbKXThOudMCeQvfvInJTRbc2jTn9VFpf+Qj4BgHkJg1h90tf/EA=="], + "@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.1.81", "", { "os": "darwin", "cpu": "x64" }, "sha512-CrtNKu41D6+bOQdUOmDX4Q3hTL6p+sT55wugPzbDq7cdqFZabCeguBAyOlvRl2g2aJ93kmOWW6MXG0bPPklEFg=="], - "@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.1.79", "", { "os": "linux", "cpu": "arm64" }, "sha512-DCa5YaknS4bWhFt8TMEGH+qmTinyzuY8hoZbO4crtWXAxofPP7Pas76Cwxlvis/PyLffA+pPxAl1l5sUZpsvqw=="], + "@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.1.81", "", { "os": "linux", "cpu": "arm64" }, "sha512-FJw9zmJop9WiMvtT07nSrfBLPLqskxL6xfV3GNft0mSYV+C3hdJ0qkiczGSHUX/6V7fmouM84RWwmY53Rb6hYQ=="], - "@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.1.79", "", { "os": "linux", "cpu": "x64" }, "sha512-V6xjvFfHh3NGvsuuDae1KHPRZXHMEE8XL0A/GM6v4I4OCC23kDmkK60Vn6OptQwAzwwbz0X0IX+Ut/GQU9qGgA=="], + "@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.1.81", "", { "os": "linux", "cpu": "x64" }, "sha512-Rj2AFIiuWI0BEMIvh/Jeuxty9Gp5ZhLuQU7ZHJJhojKo/mpBpMs9X+5kwZPZya/tyR8uVDAVyB6AOLkhdRW5lw=="], - "@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.1.79", "", { "os": "win32", "cpu": "arm64" }, "sha512-sPRKnVzOdT5szI59tte7pxwwkYA+07EQN+6miFAvkFuiLmRUngONUD8HVjL7nCnxcPFqxaU4Rvl1y40ST86g8g=="], + "@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.1.81", "", { "os": "win32", "cpu": "arm64" }, "sha512-AiZB+mZ1cVr8plAPrPT98e3kw6D0OdOSe2CQYLgJRbfRlPqq3jl26lHPzDb3ZO2OR0oVGRPJvXraus939mvoiQ=="], - "@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.1.79", "", { "os": "win32", "cpu": "x64" }, "sha512-vmQcFTvKf9fqajnDtgU6/uAsiTGwx8//khqHVBmiTEXUsiT792Ki9l8sgNughbuldqG5iZOiF6IaAWU1H67UpA=="], + "@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.1.81", "", { "os": "win32", "cpu": "x64" }, "sha512-l8R2Ni1CR4eHi3DTmSkEL/EjHAtOZ/sndYs3VVw+Ej2esL3Mf0W7qSO5S0YNBanz2VXZhbkmM6ERm9keH8RD3w=="], - "@opentui/solid": ["@opentui/solid@0.1.79", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.1.79", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.9", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.9" } }, "sha512-c5+0jexKxb8GwRDDkQ/U6isZZqClAzHccXmYiLYmSnqdoQQp2lIGHLartL+K8lfIQrsKClzP2ZHumN6nexRfRg=="], + "@opentui/solid": ["@opentui/solid@0.1.81", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.1.81", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.9", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.9" } }, "sha512-QRjS0wPuIhBRdY8tpG3yprCM4ZnOxWWHTuaZ4hhia2wFZygf7Ome6EuZnLXmtuOQjkjCwu0if8Yik6toc6QylA=="], "@oslojs/asn1": ["@oslojs/asn1@1.0.0", "", { "dependencies": { "@oslojs/binary": "1.0.0" } }, "sha512-zw/wn0sj0j0QKbIXfIlnEcTviaCzYOY3V5rAyjR6YtOByFtJiT574+8p9Wlach0lZH9fddD4yb9laEAIl4vXQA=="], @@ -2226,7 +2226,7 @@ "bun-types": ["bun-types@1.3.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-+UBWWOakIP4Tswh0Bt0QD0alpTY8cb5hvgiYeWCMet9YukHbzuruIEeXC2D7nMJPB12kbh8C7XJykSexEqGKJg=="], - "bun-webgpu": ["bun-webgpu@0.1.4", "", { "dependencies": { "@webgpu/types": "^0.1.60" }, "optionalDependencies": { "bun-webgpu-darwin-arm64": "^0.1.4", "bun-webgpu-darwin-x64": "^0.1.4", "bun-webgpu-linux-x64": "^0.1.4", "bun-webgpu-win32-x64": "^0.1.4" } }, "sha512-Kw+HoXl1PMWJTh9wvh63SSRofTA8vYBFCw0XEP1V1fFdQEDhI8Sgf73sdndE/oDpN/7CMx0Yv/q8FCvO39ROMQ=="], + "bun-webgpu": ["bun-webgpu@0.1.5", "", { "dependencies": { "@webgpu/types": "^0.1.60" }, "optionalDependencies": { "bun-webgpu-darwin-arm64": "^0.1.5", "bun-webgpu-darwin-x64": "^0.1.5", "bun-webgpu-linux-x64": "^0.1.5", "bun-webgpu-win32-x64": "^0.1.5" } }, "sha512-91/K6S5whZKX7CWAm9AylhyKrLGRz6BUiiPiM/kXadSnD4rffljCD/q9cNFftm5YXhx4MvLqw33yEilxogJvwA=="], "bun-webgpu-darwin-arm64": ["bun-webgpu-darwin-arm64@0.1.5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-qM7W5IaFpWYGPDcNiQ8DOng3noQ97gxpH2MFH1mGsdKwI0T4oy++egSh5Z7s6AQx8WKgc9GzAsTUM4KZkFdacw=="], diff --git a/packages/opencode/package.json b/packages/opencode/package.json index f8912737375e..d19376adf38d 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -89,8 +89,8 @@ "@opencode-ai/sdk": "workspace:*", "@opencode-ai/util": "workspace:*", "@openrouter/ai-sdk-provider": "1.5.4", - "@opentui/core": "0.1.79", - "@opentui/solid": "0.1.79", + "@opentui/core": "0.1.81", + "@opentui/solid": "0.1.81", "@parcel/watcher": "2.5.1", "@pierre/diffs": "catalog:", "@solid-primitives/event-bus": "1.1.2", From ab75ef8140d9a298326dd40b787eec5641ee68ed Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Mon, 23 Feb 2026 00:00:47 +0000 Subject: [PATCH 09/95] chore: update nix node_modules hashes --- nix/hashes.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/hashes.json b/nix/hashes.json index d07b8f0f6b47..426f484f0313 100644 --- a/nix/hashes.json +++ b/nix/hashes.json @@ -1,8 +1,8 @@ { "nodeModules": { - "x86_64-linux": "sha256-fjrvCgQ2PHYxzw8NsiEHOcor46qN95/cfilFHFqCp/k=", - "aarch64-linux": "sha256-xWp4LLJrbrCPFL1F6SSbProq/t/az4CqhTcymPvjOBQ=", - "aarch64-darwin": "sha256-Wbfyy/bruFHKUWsyJ2aiPXAzLkk5MNBfN6QdGPQwZS0=", - "x86_64-darwin": "sha256-wDnMbiaBCRj5STkaLoVCZTdXVde+/YKfwWzwJZ1AJXQ=" + "x86_64-linux": "sha256-3hfy6nfEnGq4J6inH0pXANw05oas+81iuayn7J0pj9c=", + "aarch64-linux": "sha256-dxWaLtzSeI5NfHwB6u0K10yxoA0ESz/r+zTEQ3FdKFY=", + "aarch64-darwin": "sha256-kkK4rj4g0j2jJFXVmVH7CJcXlI8Dj/KmL/VC3iE4Z+8=", + "x86_64-darwin": "sha256-jt51irxZd48kb0BItd8InP7lfsELUh0unVYO2es+a98=" } } From 0042a07052ec0db777b2ea8bff46101466f0a942 Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Sun, 22 Feb 2026 19:10:27 -0500 Subject: [PATCH 10/95] fix: Windows path support and canonicalization (#13671) Co-authored-by: LukeParkerDev <10430890+Hona@users.noreply.github.com> --- packages/opencode/src/patch/index.ts | 8 ++++---- packages/opencode/src/snapshot/index.ts | 2 +- packages/opencode/src/tool/apply_patch.ts | 12 ++++++------ packages/opencode/src/tool/bash.ts | 6 +++++- packages/opencode/test/skill/skill.test.ts | 10 +++++----- packages/opencode/test/tool/apply_patch.test.ts | 7 +++++++ 6 files changed, 28 insertions(+), 17 deletions(-) diff --git a/packages/opencode/src/patch/index.ts b/packages/opencode/src/patch/index.ts index 0efeff544f66..b87ad5552865 100644 --- a/packages/opencode/src/patch/index.ts +++ b/packages/opencode/src/patch/index.ts @@ -79,23 +79,23 @@ export namespace Patch { const line = lines[startIdx] if (line.startsWith("*** Add File:")) { - const filePath = line.split(":", 2)[1]?.trim() + const filePath = line.slice("*** Add File:".length).trim() return filePath ? { filePath, nextIdx: startIdx + 1 } : null } if (line.startsWith("*** Delete File:")) { - const filePath = line.split(":", 2)[1]?.trim() + const filePath = line.slice("*** Delete File:".length).trim() return filePath ? { filePath, nextIdx: startIdx + 1 } : null } if (line.startsWith("*** Update File:")) { - const filePath = line.split(":", 2)[1]?.trim() + const filePath = line.slice("*** Update File:".length).trim() let movePath: string | undefined let nextIdx = startIdx + 1 // Check for move directive if (nextIdx < lines.length && lines[nextIdx].startsWith("*** Move to:")) { - movePath = lines[nextIdx].split(":", 2)[1]?.trim() + movePath = lines[nextIdx].slice("*** Move to:".length).trim() nextIdx++ } diff --git a/packages/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.ts index 83cc467e423b..833999e7615e 100644 --- a/packages/opencode/src/snapshot/index.ts +++ b/packages/opencode/src/snapshot/index.ts @@ -105,7 +105,7 @@ export namespace Snapshot { .split("\n") .map((x) => x.trim()) .filter(Boolean) - .map((x) => path.join(Instance.worktree, x)), + .map((x) => path.join(Instance.worktree, x).replaceAll("\\", "/")), } } diff --git a/packages/opencode/src/tool/apply_patch.ts b/packages/opencode/src/tool/apply_patch.ts index 1344467c719f..06293b6eba6e 100644 --- a/packages/opencode/src/tool/apply_patch.ts +++ b/packages/opencode/src/tool/apply_patch.ts @@ -161,7 +161,7 @@ export const ApplyPatchTool = Tool.define("apply_patch", { // Build per-file metadata for UI rendering (used for both permission and result) const files = fileChanges.map((change) => ({ filePath: change.filePath, - relativePath: path.relative(Instance.worktree, change.movePath ?? change.filePath), + relativePath: path.relative(Instance.worktree, change.movePath ?? change.filePath).replaceAll("\\", "/"), type: change.type, diff: change.diff, before: change.oldContent, @@ -172,7 +172,7 @@ export const ApplyPatchTool = Tool.define("apply_patch", { })) // Check permissions if needed - const relativePaths = fileChanges.map((c) => path.relative(Instance.worktree, c.filePath)) + const relativePaths = fileChanges.map((c) => path.relative(Instance.worktree, c.filePath).replaceAll("\\", "/")) await ctx.ask({ permission: "edit", patterns: relativePaths, @@ -242,13 +242,13 @@ export const ApplyPatchTool = Tool.define("apply_patch", { // Generate output summary const summaryLines = fileChanges.map((change) => { if (change.type === "add") { - return `A ${path.relative(Instance.worktree, change.filePath)}` + return `A ${path.relative(Instance.worktree, change.filePath).replaceAll("\\", "/")}` } if (change.type === "delete") { - return `D ${path.relative(Instance.worktree, change.filePath)}` + return `D ${path.relative(Instance.worktree, change.filePath).replaceAll("\\", "/")}` } const target = change.movePath ?? change.filePath - return `M ${path.relative(Instance.worktree, target)}` + return `M ${path.relative(Instance.worktree, target).replaceAll("\\", "/")}` }) let output = `Success. Updated the following files:\n${summaryLines.join("\n")}` @@ -264,7 +264,7 @@ export const ApplyPatchTool = Tool.define("apply_patch", { const limited = errors.slice(0, MAX_DIAGNOSTICS_PER_FILE) const suffix = errors.length > MAX_DIAGNOSTICS_PER_FILE ? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more` : "" - output += `\n\nLSP errors detected in ${path.relative(Instance.worktree, target)}, please fix:\n\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n` + output += `\n\nLSP errors detected in ${path.relative(Instance.worktree, target).replaceAll("\\", "/")}, please fix:\n\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n` } } diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.ts index ee20d20c5068..0751f789b7db 100644 --- a/packages/opencode/src/tool/bash.ts +++ b/packages/opencode/src/tool/bash.ts @@ -142,7 +142,11 @@ export const BashTool = Tool.define("bash", async () => { } if (directories.size > 0) { - const globs = Array.from(directories).map((dir) => path.join(dir, "*")) + const globs = Array.from(directories).map((dir) => { + // Preserve POSIX-looking paths with /s, even on Windows + if (dir.startsWith("/")) return `${dir.replace(/[\\/]+$/, "")}/*` + return path.join(dir, "*") + }) await ctx.ask({ permission: "external_directory", patterns: globs, diff --git a/packages/opencode/test/skill/skill.test.ts b/packages/opencode/test/skill/skill.test.ts index c310256c5e72..2264723a090d 100644 --- a/packages/opencode/test/skill/skill.test.ts +++ b/packages/opencode/test/skill/skill.test.ts @@ -50,7 +50,7 @@ Instructions here. const testSkill = skills.find((s) => s.name === "test-skill") expect(testSkill).toBeDefined() expect(testSkill!.description).toBe("A test skill for verification.") - expect(testSkill!.location).toContain("skill/test-skill/SKILL.md") + expect(testSkill!.location).toContain(path.join("skill", "test-skill", "SKILL.md")) }, }) }) @@ -180,7 +180,7 @@ description: A skill in the .claude/skills directory. expect(skills.length).toBe(1) const claudeSkill = skills.find((s) => s.name === "claude-skill") expect(claudeSkill).toBeDefined() - expect(claudeSkill!.location).toContain(".claude/skills/claude-skill/SKILL.md") + expect(claudeSkill!.location).toContain(path.join(".claude", "skills", "claude-skill", "SKILL.md")) }, }) }) @@ -200,7 +200,7 @@ test("discovers global skills from ~/.claude/skills/ directory", async () => { expect(skills.length).toBe(1) expect(skills[0].name).toBe("global-test-skill") expect(skills[0].description).toBe("A global skill from ~/.claude/skills for testing.") - expect(skills[0].location).toContain(".claude/skills/global-test-skill/SKILL.md") + expect(skills[0].location).toContain(path.join(".claude", "skills", "global-test-skill", "SKILL.md")) }, }) } finally { @@ -245,7 +245,7 @@ description: A skill in the .agents/skills directory. expect(skills.length).toBe(1) const agentSkill = skills.find((s) => s.name === "agent-skill") expect(agentSkill).toBeDefined() - expect(agentSkill!.location).toContain(".agents/skills/agent-skill/SKILL.md") + expect(agentSkill!.location).toContain(path.join(".agents", "skills", "agent-skill", "SKILL.md")) }, }) }) @@ -279,7 +279,7 @@ This skill is loaded from the global home directory. expect(skills.length).toBe(1) expect(skills[0].name).toBe("global-agent-skill") expect(skills[0].description).toBe("A global skill from ~/.agents/skills for testing.") - expect(skills[0].location).toContain(".agents/skills/global-agent-skill/SKILL.md") + expect(skills[0].location).toContain(path.join(".agents", "skills", "global-agent-skill", "SKILL.md")) }, }) } finally { diff --git a/packages/opencode/test/tool/apply_patch.test.ts b/packages/opencode/test/tool/apply_patch.test.ts index a08e235885af..f81723fee097 100644 --- a/packages/opencode/test/tool/apply_patch.test.ts +++ b/packages/opencode/test/tool/apply_patch.test.ts @@ -93,6 +93,13 @@ describe("tool.apply_patch freeform", () => { expect(result.title).toContain("Success. Updated the following files") expect(result.output).toContain("Success. Updated the following files") + // Strict formatting assertions for slashes + expect(result.output).toMatch(/A nested\/new\.txt/) + expect(result.output).toMatch(/D delete\.txt/) + expect(result.output).toMatch(/M modify\.txt/) + if (process.platform === "win32") { + expect(result.output).not.toContain("\\") + } expect(result.metadata.diff).toContain("Index:") expect(calls.length).toBe(1) From ee754c46f992dd4024e56e93246421246d16d13f Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Mon, 23 Feb 2026 12:05:21 +1000 Subject: [PATCH 11/95] fix(win32): normalize paths at permission boundaries (#14738) --- packages/opencode/src/tool/external-directory.ts | 2 +- packages/opencode/src/util/wildcard.ts | 5 ++++- packages/opencode/test/tool/bash.test.ts | 4 ++-- packages/opencode/test/tool/read.test.ts | 4 ++-- packages/opencode/test/util/wildcard.test.ts | 15 +++++++++++++++ 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/opencode/src/tool/external-directory.ts b/packages/opencode/src/tool/external-directory.ts index 1d3958fc464f..5d8885b2ad46 100644 --- a/packages/opencode/src/tool/external-directory.ts +++ b/packages/opencode/src/tool/external-directory.ts @@ -18,7 +18,7 @@ export async function assertExternalDirectory(ctx: Tool.Context, target?: string const kind = options?.kind ?? "file" const parentDir = kind === "directory" ? target : path.dirname(target) - const glob = path.join(parentDir, "*") + const glob = path.join(parentDir, "*").replaceAll("\\", "/") await ctx.ask({ permission: "external_directory", diff --git a/packages/opencode/src/util/wildcard.ts b/packages/opencode/src/util/wildcard.ts index 4a6eba96ff93..f54b6c85fd7f 100644 --- a/packages/opencode/src/util/wildcard.ts +++ b/packages/opencode/src/util/wildcard.ts @@ -2,6 +2,8 @@ import { sortBy, pipe } from "remeda" export namespace Wildcard { export function match(str: string, pattern: string) { + if (str) str = str.replaceAll("\\", "/") + if (pattern) pattern = pattern.replaceAll("\\", "/") let escaped = pattern .replace(/[.+^${}()|[\]\\]/g, "\\$&") // escape special regex chars .replace(/\*/g, ".*") // * becomes .* @@ -13,7 +15,8 @@ export namespace Wildcard { escaped = escaped.slice(0, -3) + "( .*)?" } - return new RegExp("^" + escaped + "$", "s").test(str) + const flags = process.platform === "win32" ? "si" : "s" + return new RegExp("^" + escaped + "$", flags).test(str) } export function all(input: string, patterns: Record) { diff --git a/packages/opencode/test/tool/bash.test.ts b/packages/opencode/test/tool/bash.test.ts index 3bd923b6041b..db05f8f623f6 100644 --- a/packages/opencode/test/tool/bash.test.ts +++ b/packages/opencode/test/tool/bash.test.ts @@ -203,8 +203,8 @@ describe("tool.bash permissions", () => { await bash.execute( { - command: "rm tmpfile", - description: "Remove tmpfile", + command: `rm -rf ${path.join(tmp.path, "nested")}`, + description: "remove nested dir", }, testCtx, ) diff --git a/packages/opencode/test/tool/read.test.ts b/packages/opencode/test/tool/read.test.ts index 88228f14e877..b22fc3e71205 100644 --- a/packages/opencode/test/tool/read.test.ts +++ b/packages/opencode/test/tool/read.test.ts @@ -74,7 +74,7 @@ describe("tool.read external_directory permission", () => { await read.execute({ filePath: path.join(outerTmp.path, "secret.txt") }, testCtx) const extDirReq = requests.find((r) => r.permission === "external_directory") expect(extDirReq).toBeDefined() - expect(extDirReq!.patterns.some((p) => p.includes(outerTmp.path))).toBe(true) + expect(extDirReq!.patterns.some((p) => p.includes(outerTmp.path.replaceAll("\\", "/")))).toBe(true) }, }) }) @@ -100,7 +100,7 @@ describe("tool.read external_directory permission", () => { await read.execute({ filePath: path.join(outerTmp.path, "external") }, testCtx) const extDirReq = requests.find((r) => r.permission === "external_directory") expect(extDirReq).toBeDefined() - expect(extDirReq!.patterns).toContain(path.join(outerTmp.path, "external", "*")) + expect(extDirReq!.patterns).toContain(path.join(outerTmp.path, "external", "*").replaceAll("\\", "/")) }, }) }) diff --git a/packages/opencode/test/util/wildcard.test.ts b/packages/opencode/test/util/wildcard.test.ts index 9cd0e9b94507..56e753d12a34 100644 --- a/packages/opencode/test/util/wildcard.test.ts +++ b/packages/opencode/test/util/wildcard.test.ts @@ -73,3 +73,18 @@ test("allStructured handles sed flags", () => { expect(Wildcard.allStructured({ head: "sed", tail: ["-n", "1p", "file"] }, rules)).toBe("allow") expect(Wildcard.allStructured({ head: "sed", tail: ["-i", "-n", "/./p", "myfile.txt"] }, rules)).toBe("ask") }) + +test("match normalizes slashes for cross-platform globbing", () => { + expect(Wildcard.match("C:\\Windows\\System32\\*", "C:/Windows/System32/*")).toBe(true) + expect(Wildcard.match("C:/Windows/System32/drivers", "C:\\Windows\\System32\\*")).toBe(true) +}) + +test("match handles case-insensitivity on Windows", () => { + if (process.platform === "win32") { + expect(Wildcard.match("C:\\windows\\system32\\hosts", "C:/Windows/System32/*")).toBe(true) + expect(Wildcard.match("c:/windows/system32/hosts", "C:\\Windows\\System32\\*")).toBe(true) + } else { + // Unix paths are case-sensitive + expect(Wildcard.match("/users/test/file", "/Users/test/*")).toBe(false) + } +}) From 5712cff5c453a185ac75a160f76ca06135d6ab2d Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 22 Feb 2026 18:41:34 -0500 Subject: [PATCH 12/95] zen: track session in usage --- infra/console.ts | 42 +- .../workspace/[id]/billing/black-section.tsx | 6 +- .../app/src/routes/zen/util/handler.ts | 20 +- .../migration.sql} | 0 .../20250902065410_fluffy_raza/snapshot.json | 986 +++++++ .../migration.sql} | 0 .../snapshot.json | 986 +++++++ .../migration.sql} | 0 .../snapshot.json | 1000 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1020 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1034 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1034 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1062 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1048 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1062 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1076 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1092 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1106 ++++++++ .../migration.sql} | 0 .../snapshot.json | 1148 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1148 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1162 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1148 +++++++++ .../migration.sql} | 0 .../20250923213126_cold_la_nuit/snapshot.json | 1162 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1176 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1204 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1204 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1190 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1204 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1252 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1284 ++++++++++ .../migration.sql} | 0 .../snapshot.json | 1256 +++++++++ .../migration.sql} | 0 .../20251003210411_legal_joseph/snapshot.json | 1270 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1250 +++++++++ .../migration.sql} | 0 .../20251004045106_hot_wong/snapshot.json | 1222 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1222 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1264 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1381 ++++++++++ .../migration.sql} | 0 .../snapshot.json | 1512 +++++++++++ .../migration.sql} | 0 .../snapshot.json | 1526 +++++++++++ .../migration.sql} | 0 .../snapshot.json | 1540 +++++++++++ .../migration.sql} | 0 .../snapshot.json | 1662 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1648 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1664 ++++++++++++ .../migration.sql} | 0 .../20251031163113_messy_jackal/snapshot.json | 1692 ++++++++++++ .../migration.sql} | 0 .../20251125223403_famous_magik/snapshot.json | 1774 +++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1900 ++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1920 ++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1975 ++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2073 +++++++++++++++ .../migration.sql} | 0 .../20260107022356_lame_calypso/snapshot.json | 2073 +++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2073 +++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2089 +++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2242 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2192 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2192 ++++++++++++++++ .../migration.sql} | 0 .../20260109014234_noisy_domino/snapshot.json | 2206 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2220 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2234 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2248 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2262 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2248 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2262 ++++++++++++++++ .../20260222233442_clever_toxin/migration.sql | 1 + .../20260222233442_clever_toxin/snapshot.json | 2276 +++++++++++++++++ .../core/migrations/meta/0000_snapshot.json | 569 ----- .../core/migrations/meta/0001_snapshot.json | 569 ----- .../core/migrations/meta/0002_snapshot.json | 576 ----- .../core/migrations/meta/0003_snapshot.json | 581 ----- .../core/migrations/meta/0004_snapshot.json | 588 ----- .../core/migrations/meta/0005_snapshot.json | 588 ----- .../core/migrations/meta/0006_snapshot.json | 602 ----- .../core/migrations/meta/0007_snapshot.json | 595 ----- .../core/migrations/meta/0008_snapshot.json | 602 ----- .../core/migrations/meta/0009_snapshot.json | 609 ----- .../core/migrations/meta/0010_snapshot.json | 615 ----- .../core/migrations/meta/0011_snapshot.json | 622 ----- .../core/migrations/meta/0012_snapshot.json | 643 ----- .../core/migrations/meta/0013_snapshot.json | 646 ----- .../core/migrations/meta/0014_snapshot.json | 650 ----- .../core/migrations/meta/0015_snapshot.json | 643 ----- .../core/migrations/meta/0016_snapshot.json | 650 ----- .../core/migrations/meta/0017_snapshot.json | 657 ----- .../core/migrations/meta/0018_snapshot.json | 671 ----- .../core/migrations/meta/0019_snapshot.json | 671 ----- .../core/migrations/meta/0020_snapshot.json | 664 ----- .../core/migrations/meta/0021_snapshot.json | 671 ----- .../core/migrations/meta/0022_snapshot.json | 690 ----- .../core/migrations/meta/0023_snapshot.json | 700 ----- .../core/migrations/meta/0024_snapshot.json | 686 ----- .../core/migrations/meta/0025_snapshot.json | 693 ----- .../core/migrations/meta/0026_snapshot.json | 688 ----- .../core/migrations/meta/0027_snapshot.json | 674 ----- .../core/migrations/meta/0028_snapshot.json | 674 ----- .../core/migrations/meta/0029_snapshot.json | 695 ----- .../core/migrations/meta/0030_snapshot.json | 760 ------ .../core/migrations/meta/0031_snapshot.json | 832 ------ .../core/migrations/meta/0032_snapshot.json | 839 ------ .../core/migrations/meta/0033_snapshot.json | 846 ------ .../core/migrations/meta/0034_snapshot.json | 913 ------- .../core/migrations/meta/0035_snapshot.json | 905 ------- .../core/migrations/meta/0036_snapshot.json | 915 ------- .../core/migrations/meta/0037_snapshot.json | 929 ------- .../core/migrations/meta/0038_snapshot.json | 981 ------- .../core/migrations/meta/0039_snapshot.json | 1053 -------- .../core/migrations/meta/0040_snapshot.json | 1059 -------- .../core/migrations/meta/0041_snapshot.json | 1095 -------- .../core/migrations/meta/0042_snapshot.json | 1144 --------- .../core/migrations/meta/0043_snapshot.json | 1147 --------- .../core/migrations/meta/0044_snapshot.json | 1146 --------- .../core/migrations/meta/0045_snapshot.json | 1149 --------- .../core/migrations/meta/0046_snapshot.json | 1236 --------- .../core/migrations/meta/0047_snapshot.json | 1207 --------- .../core/migrations/meta/0048_snapshot.json | 1207 --------- .../core/migrations/meta/0049_snapshot.json | 1214 --------- .../core/migrations/meta/0050_snapshot.json | 1221 --------- .../core/migrations/meta/0051_snapshot.json | 1228 --------- .../core/migrations/meta/0052_snapshot.json | 1235 --------- .../core/migrations/meta/0053_snapshot.json | 1242 --------- .../core/migrations/meta/0054_snapshot.json | 1235 --------- .../core/migrations/meta/0055_snapshot.json | 1242 --------- .../core/migrations/meta/_journal.json | 398 --- packages/console/core/package.json | 3 + packages/console/core/script/promote-lite.ts | 22 + packages/console/core/script/update-lite.ts | 28 + packages/console/core/src/black.ts | 74 - packages/console/core/src/lite.ts | 28 + .../console/core/src/schema/billing.sql.ts | 5 +- packages/console/core/src/subscription.ts | 75 + packages/console/core/sst-env.d.ts | 9 + packages/console/function/sst-env.d.ts | 9 + packages/console/resource/sst-env.d.ts | 9 + packages/enterprise/sst-env.d.ts | 9 + packages/function/sst-env.d.ts | 9 + sst-env.d.ts | 9 + 187 files changed, 87618 insertions(+), 47656 deletions(-) rename packages/console/core/migrations/{0000_fluffy_raza.sql => 20250902065410_fluffy_raza/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250902065410_fluffy_raza/snapshot.json rename packages/console/core/migrations/{0001_serious_whistler.sql => 20250903035359_serious_whistler/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250903035359_serious_whistler/snapshot.json rename packages/console/core/migrations/{0002_violet_loners.sql => 20250911133331_violet_loners/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250911133331_violet_loners/snapshot.json rename packages/console/core/migrations/{0003_dusty_clint_barton.sql => 20250911141957_dusty_clint_barton/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250911141957_dusty_clint_barton/snapshot.json rename packages/console/core/migrations/{0004_first_mockingbird.sql => 20250911214917_first_mockingbird/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250911214917_first_mockingbird/snapshot.json rename packages/console/core/migrations/{0005_jazzy_skrulls.sql => 20250911231144_jazzy_skrulls/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250911231144_jazzy_skrulls/snapshot.json rename packages/console/core/migrations/{0006_parallel_gauntlet.sql => 20250912021148_parallel_gauntlet/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250912021148_parallel_gauntlet/snapshot.json rename packages/console/core/migrations/{0007_familiar_nightshade.sql => 20250912161749_familiar_nightshade/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250912161749_familiar_nightshade/snapshot.json rename packages/console/core/migrations/{0008_eminent_ultimatum.sql => 20250914213824_eminent_ultimatum/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250914213824_eminent_ultimatum/snapshot.json rename packages/console/core/migrations/{0009_redundant_piledriver.sql => 20250914222302_redundant_piledriver/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250914222302_redundant_piledriver/snapshot.json rename packages/console/core/migrations/{0010_needy_sue_storm.sql => 20250914232505_needy_sue_storm/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250914232505_needy_sue_storm/snapshot.json rename packages/console/core/migrations/{0011_freezing_phil_sheldon.sql => 20250915150801_freezing_phil_sheldon/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250915150801_freezing_phil_sheldon/snapshot.json rename packages/console/core/migrations/{0012_bright_photon.sql => 20250915172014_bright_photon/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250915172014_bright_photon/snapshot.json rename packages/console/core/migrations/{0013_absurd_hobgoblin.sql => 20250915172258_absurd_hobgoblin/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250915172258_absurd_hobgoblin/snapshot.json rename packages/console/core/migrations/{0014_demonic_princess_powerful.sql => 20250919135159_demonic_princess_powerful/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250919135159_demonic_princess_powerful/snapshot.json rename packages/console/core/migrations/{0015_cloudy_revanche.sql => 20250921042124_cloudy_revanche/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250921042124_cloudy_revanche/snapshot.json rename packages/console/core/migrations/{0016_cold_la_nuit.sql => 20250923213126_cold_la_nuit/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250923213126_cold_la_nuit/snapshot.json rename packages/console/core/migrations/{0017_woozy_thaddeus_ross.sql => 20250924230623_woozy_thaddeus_ross/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/snapshot.json rename packages/console/core/migrations/{0018_nervous_iron_lad.sql => 20250928163425_nervous_iron_lad/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250928163425_nervous_iron_lad/snapshot.json rename packages/console/core/migrations/{0019_dazzling_cable.sql => 20250928235456_dazzling_cable/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250928235456_dazzling_cable/snapshot.json rename packages/console/core/migrations/{0020_supreme_jack_power.sql => 20250929181457_supreme_jack_power/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250929181457_supreme_jack_power/snapshot.json rename packages/console/core/migrations/{0021_flawless_clea.sql => 20250929224703_flawless_clea/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20250929224703_flawless_clea/snapshot.json rename packages/console/core/migrations/{0022_nice_dreadnoughts.sql => 20251002175032_nice_dreadnoughts/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251002175032_nice_dreadnoughts/snapshot.json rename packages/console/core/migrations/{0023_optimal_paibok.sql => 20251002223020_optimal_paibok/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251002223020_optimal_paibok/snapshot.json rename packages/console/core/migrations/{0024_early_black_crow.sql => 20251003202205_early_black_crow/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251003202205_early_black_crow/snapshot.json rename packages/console/core/migrations/{0025_legal_joseph.sql => 20251003210411_legal_joseph/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251003210411_legal_joseph/snapshot.json rename packages/console/core/migrations/{0026_numerous_prodigy.sql => 20251004030300_numerous_prodigy/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251004030300_numerous_prodigy/snapshot.json rename packages/console/core/migrations/{0027_hot_wong.sql => 20251004045106_hot_wong/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251004045106_hot_wong/snapshot.json rename packages/console/core/migrations/{0028_careful_cerise.sql => 20251007024345_careful_cerise/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251007024345_careful_cerise/snapshot.json rename packages/console/core/migrations/{0029_panoramic_harrier.sql => 20251007043715_panoramic_harrier/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251007043715_panoramic_harrier/snapshot.json rename packages/console/core/migrations/{0030_ordinary_ultragirl.sql => 20251007230438_ordinary_ultragirl/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251007230438_ordinary_ultragirl/snapshot.json rename packages/console/core/migrations/{0031_outgoing_outlaw_kid.sql => 20251008161718_outgoing_outlaw_kid/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/snapshot.json rename packages/console/core/migrations/{0032_white_doctor_doom.sql => 20251009021849_white_doctor_doom/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251009021849_white_doctor_doom/snapshot.json rename packages/console/core/migrations/{0033_cynical_jack_flag.sql => 20251016175624_cynical_jack_flag/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251016175624_cynical_jack_flag/snapshot.json rename packages/console/core/migrations/{0034_short_bulldozer.sql => 20251016214520_short_bulldozer/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251016214520_short_bulldozer/snapshot.json rename packages/console/core/migrations/{0035_narrow_blindfold.sql => 20251017015733_narrow_blindfold/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251017015733_narrow_blindfold/snapshot.json rename packages/console/core/migrations/{0036_slimy_energizer.sql => 20251017024232_slimy_energizer/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251017024232_slimy_energizer/snapshot.json rename packages/console/core/migrations/{0037_messy_jackal.sql => 20251031163113_messy_jackal/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251031163113_messy_jackal/snapshot.json rename packages/console/core/migrations/{0038_famous_magik.sql => 20251125223403_famous_magik/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251125223403_famous_magik/snapshot.json rename packages/console/core/migrations/{0039_striped_forge.sql => 20251228182259_striped_forge/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20251228182259_striped_forge/snapshot.json rename packages/console/core/migrations/{0040_broken_gamora.sql => 20260105034337_broken_gamora/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260105034337_broken_gamora/snapshot.json rename packages/console/core/migrations/{0041_odd_misty_knight.sql => 20260106204919_odd_misty_knight/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260106204919_odd_misty_knight/snapshot.json rename packages/console/core/migrations/{0042_flat_nightmare.sql => 20260107000117_flat_nightmare/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260107000117_flat_nightmare/snapshot.json rename packages/console/core/migrations/{0043_lame_calypso.sql => 20260107022356_lame_calypso/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260107022356_lame_calypso/snapshot.json rename packages/console/core/migrations/{0044_tiny_captain_midlands.sql => 20260107041522_tiny_captain_midlands/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260107041522_tiny_captain_midlands/snapshot.json rename packages/console/core/migrations/{0045_cuddly_diamondback.sql => 20260107055817_cuddly_diamondback/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260107055817_cuddly_diamondback/snapshot.json rename packages/console/core/migrations/{0046_charming_black_bolt.sql => 20260108224422_charming_black_bolt/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260108224422_charming_black_bolt/snapshot.json rename packages/console/core/migrations/{0047_huge_omega_red.sql => 20260109000245_huge_omega_red/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260109000245_huge_omega_red/snapshot.json rename packages/console/core/migrations/{0048_mean_frank_castle.sql => 20260109001625_mean_frank_castle/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260109001625_mean_frank_castle/snapshot.json rename packages/console/core/migrations/{0049_noisy_domino.sql => 20260109014234_noisy_domino/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260109014234_noisy_domino/snapshot.json rename packages/console/core/migrations/{0050_bumpy_mephistopheles.sql => 20260109040130_bumpy_mephistopheles/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260109040130_bumpy_mephistopheles/snapshot.json rename packages/console/core/migrations/{0051_jazzy_green_goblin.sql => 20260113215232_jazzy_green_goblin/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260113215232_jazzy_green_goblin/snapshot.json rename packages/console/core/migrations/{0052_aromatic_agent_zero.sql => 20260113223840_aromatic_agent_zero/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260113223840_aromatic_agent_zero/snapshot.json rename packages/console/core/migrations/{0053_gigantic_hardball.sql => 20260116213606_gigantic_hardball/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260116213606_gigantic_hardball/snapshot.json rename packages/console/core/migrations/{0054_numerous_annihilus.sql => 20260116224745_numerous_annihilus/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260116224745_numerous_annihilus/snapshot.json rename packages/console/core/migrations/{0055_moaning_karnak.sql => 20260122190905_moaning_karnak/migration.sql} (100%) create mode 100644 packages/console/core/migrations/20260122190905_moaning_karnak/snapshot.json create mode 100644 packages/console/core/migrations/20260222233442_clever_toxin/migration.sql create mode 100644 packages/console/core/migrations/20260222233442_clever_toxin/snapshot.json delete mode 100644 packages/console/core/migrations/meta/0000_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0001_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0002_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0003_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0004_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0005_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0006_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0007_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0008_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0009_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0010_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0011_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0012_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0013_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0014_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0015_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0016_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0017_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0018_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0019_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0020_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0021_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0022_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0023_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0024_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0025_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0026_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0027_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0028_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0029_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0030_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0031_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0032_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0033_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0034_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0035_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0036_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0037_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0038_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0039_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0040_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0041_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0042_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0043_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0044_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0045_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0046_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0047_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0048_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0049_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0050_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0051_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0052_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0053_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0054_snapshot.json delete mode 100644 packages/console/core/migrations/meta/0055_snapshot.json delete mode 100644 packages/console/core/migrations/meta/_journal.json create mode 100755 packages/console/core/script/promote-lite.ts create mode 100755 packages/console/core/script/update-lite.ts create mode 100644 packages/console/core/src/lite.ts create mode 100644 packages/console/core/src/subscription.ts diff --git a/infra/console.ts b/infra/console.ts index 3f3c2b8d9351..283fe2c37cad 100644 --- a/infra/console.ts +++ b/infra/console.ts @@ -100,26 +100,46 @@ export const stripeWebhook = new stripe.WebhookEndpoint("StripeWebhookEndpoint", ], }) -const zenProduct = new stripe.Product("ZenBlack", { +const zenLiteProduct = new stripe.Product("ZenLite", { + name: "OpenCode Lite", +}) +const zenLitePrice = new stripe.Price("ZenLitePrice", { + product: zenLiteProduct.id, + currency: "usd", + recurring: { + interval: "month", + intervalCount: 1, + }, + unitAmount: 1000, +}) +const ZEN_LITE_PRICE = new sst.Linkable("ZEN_LITE_PRICE", { + properties: { + product: zenLiteProduct.id, + price: zenLitePrice.id, + }, +}) +const ZEN_LITE_LIMITS = new sst.Secret("ZEN_LITE_LIMITS") + +const zenBlackProduct = new stripe.Product("ZenBlack", { name: "OpenCode Black", }) -const zenPriceProps = { - product: zenProduct.id, +const zenBlackPriceProps = { + product: zenBlackProduct.id, currency: "usd", recurring: { interval: "month", intervalCount: 1, }, } -const zenPrice200 = new stripe.Price("ZenBlackPrice", { ...zenPriceProps, unitAmount: 20000 }) -const zenPrice100 = new stripe.Price("ZenBlack100Price", { ...zenPriceProps, unitAmount: 10000 }) -const zenPrice20 = new stripe.Price("ZenBlack20Price", { ...zenPriceProps, unitAmount: 2000 }) +const zenBlackPrice200 = new stripe.Price("ZenBlackPrice", { ...zenBlackPriceProps, unitAmount: 20000 }) +const zenBlackPrice100 = new stripe.Price("ZenBlack100Price", { ...zenBlackPriceProps, unitAmount: 10000 }) +const zenBlackPrice20 = new stripe.Price("ZenBlack20Price", { ...zenBlackPriceProps, unitAmount: 2000 }) const ZEN_BLACK_PRICE = new sst.Linkable("ZEN_BLACK_PRICE", { properties: { - product: zenProduct.id, - plan200: zenPrice200.id, - plan100: zenPrice100.id, - plan20: zenPrice20.id, + product: zenBlackProduct.id, + plan200: zenBlackPrice200.id, + plan100: zenBlackPrice100.id, + plan20: zenBlackPrice20.id, }, }) const ZEN_BLACK_LIMITS = new sst.Secret("ZEN_BLACK_LIMITS") @@ -196,6 +216,8 @@ new sst.cloudflare.x.SolidStart("Console", { AWS_SES_SECRET_ACCESS_KEY, ZEN_BLACK_PRICE, ZEN_BLACK_LIMITS, + ZEN_LITE_PRICE, + ZEN_LITE_LIMITS, new sst.Secret("ZEN_SESSION_SECRET"), ...ZEN_MODELS, ...($dev diff --git a/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx index ce0eb2c6a12b..c7ca496e6e43 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx @@ -5,7 +5,7 @@ import { Billing } from "@opencode-ai/console-core/billing.js" import { Database, eq, and, isNull, sql } from "@opencode-ai/console-core/drizzle/index.js" import { BillingTable, SubscriptionTable } from "@opencode-ai/console-core/schema/billing.sql.js" import { Actor } from "@opencode-ai/console-core/actor.js" -import { Black } from "@opencode-ai/console-core/black.js" +import { Subscription } from "@opencode-ai/console-core/black.js" import { withActor } from "~/context/auth.withActor" import { queryBillingInfo } from "../../common" import styles from "./black-section.module.css" @@ -35,12 +35,12 @@ const querySubscription = query(async (workspaceID: string) => { return { plan: row.subscription.plan, useBalance: row.subscription.useBalance ?? false, - rollingUsage: Black.analyzeRollingUsage({ + rollingUsage: Subscription.analyzeRollingUsage({ plan: row.subscription.plan, usage: row.rollingUsage ?? 0, timeUpdated: row.timeRollingUpdated ?? new Date(), }), - weeklyUsage: Black.analyzeWeeklyUsage({ + weeklyUsage: Subscription.analyzeWeeklyUsage({ plan: row.subscription.plan, usage: row.fixedUsage ?? 0, timeUpdated: row.timeFixedUpdated ?? new Date(), diff --git a/packages/console/app/src/routes/zen/util/handler.ts b/packages/console/app/src/routes/zen/util/handler.ts index 5f2b51c21e95..dc10e1bf9356 100644 --- a/packages/console/app/src/routes/zen/util/handler.ts +++ b/packages/console/app/src/routes/zen/util/handler.ts @@ -9,7 +9,8 @@ import { Billing } from "@opencode-ai/console-core/billing.js" import { Actor } from "@opencode-ai/console-core/actor.js" import { WorkspaceTable } from "@opencode-ai/console-core/schema/workspace.sql.js" import { ZenData } from "@opencode-ai/console-core/model.js" -import { Black, BlackData } from "@opencode-ai/console-core/black.js" +import { Subscription } from "@opencode-ai/console-core/subscription.js" +import { BlackData } from "@opencode-ai/console-core/black.js" import { UserTable } from "@opencode-ai/console-core/schema/user.sql.js" import { ModelTable } from "@opencode-ai/console-core/schema/model.sql.js" import { ProviderTable } from "@opencode-ai/console-core/schema/provider.sql.js" @@ -196,7 +197,7 @@ export async function handler( const costInfo = calculateCost(modelInfo, usageInfo) await trialLimiter?.track(usageInfo) await rateLimiter?.track() - await trackUsage(billingSource, authInfo, modelInfo, providerInfo, usageInfo, costInfo) + await trackUsage(sessionId, billingSource, authInfo, modelInfo, providerInfo, usageInfo, costInfo) await reload(billingSource, authInfo, costInfo) const responseConverter = createResponseConverter(providerInfo.format, opts.format) @@ -246,7 +247,7 @@ export async function handler( const usageInfo = providerInfo.normalizeUsage(usage) const costInfo = calculateCost(modelInfo, usageInfo) await trialLimiter?.track(usageInfo) - await trackUsage(billingSource, authInfo, modelInfo, providerInfo, usageInfo, costInfo) + await trackUsage(sessionId, billingSource, authInfo, modelInfo, providerInfo, usageInfo, costInfo) await reload(billingSource, authInfo, costInfo) cost = calculateOccuredCost(billingSource, costInfo) } @@ -541,8 +542,9 @@ export async function handler( // Check weekly limit if (sub.fixedUsage && sub.timeFixedUpdated) { - const result = Black.analyzeWeeklyUsage({ - plan, + const blackData = BlackData.getLimits({ plan }) + const result = Subscription.analyzeWeeklyUsage({ + limit: blackData.fixedLimit, usage: sub.fixedUsage, timeUpdated: sub.timeFixedUpdated, }) @@ -555,8 +557,10 @@ export async function handler( // Check rolling limit if (sub.rollingUsage && sub.timeRollingUpdated) { - const result = Black.analyzeRollingUsage({ - plan, + const blackData = BlackData.getLimits({ plan }) + const result = Subscription.analyzeRollingUsage({ + limit: blackData.rollingLimit, + window: blackData.rollingWindow, usage: sub.rollingUsage, timeUpdated: sub.timeRollingUpdated, }) @@ -687,6 +691,7 @@ export async function handler( } async function trackUsage( + sessionId: string, billingSource: BillingSource, authInfo: AuthInfo, modelInfo: ModelInfo, @@ -734,6 +739,7 @@ export async function handler( cacheWrite1hTokens, cost, keyID: authInfo.apiKeyId, + sessionID: sessionId.substring(0, 30), enrichment: billingSource === "subscription" ? { plan: "sub" } : undefined, }), db diff --git a/packages/console/core/migrations/0000_fluffy_raza.sql b/packages/console/core/migrations/20250902065410_fluffy_raza/migration.sql similarity index 100% rename from packages/console/core/migrations/0000_fluffy_raza.sql rename to packages/console/core/migrations/20250902065410_fluffy_raza/migration.sql diff --git a/packages/console/core/migrations/20250902065410_fluffy_raza/snapshot.json b/packages/console/core/migrations/20250902065410_fluffy_raza/snapshot.json new file mode 100644 index 000000000000..d4f6ec58c3fd --- /dev/null +++ b/packages/console/core/migrations/20250902065410_fluffy_raza/snapshot.json @@ -0,0 +1,986 @@ +{ + "version": "6", + "id": "aee779c5-db1d-4655-95ec-6451c18455be", + "prevIds": [ + "00000000-0000-0000-0000-000000000000" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0001_serious_whistler.sql b/packages/console/core/migrations/20250903035359_serious_whistler/migration.sql similarity index 100% rename from packages/console/core/migrations/0001_serious_whistler.sql rename to packages/console/core/migrations/20250903035359_serious_whistler/migration.sql diff --git a/packages/console/core/migrations/20250903035359_serious_whistler/snapshot.json b/packages/console/core/migrations/20250903035359_serious_whistler/snapshot.json new file mode 100644 index 000000000000..821fb38968a2 --- /dev/null +++ b/packages/console/core/migrations/20250903035359_serious_whistler/snapshot.json @@ -0,0 +1,986 @@ +{ + "version": "6", + "id": "79b7ee25-1c1c-41ff-9bbf-754af257102b", + "prevIds": [ + "aee779c5-db1d-4655-95ec-6451c18455be" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0002_violet_loners.sql b/packages/console/core/migrations/20250911133331_violet_loners/migration.sql similarity index 100% rename from packages/console/core/migrations/0002_violet_loners.sql rename to packages/console/core/migrations/20250911133331_violet_loners/migration.sql diff --git a/packages/console/core/migrations/20250911133331_violet_loners/snapshot.json b/packages/console/core/migrations/20250911133331_violet_loners/snapshot.json new file mode 100644 index 000000000000..e7b65dfb4c65 --- /dev/null +++ b/packages/console/core/migrations/20250911133331_violet_loners/snapshot.json @@ -0,0 +1,1000 @@ +{ + "version": "6", + "id": "9f51ef52-31ac-4ace-8b6d-39b35efe9c81", + "prevIds": [ + "79b7ee25-1c1c-41ff-9bbf-754af257102b" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0003_dusty_clint_barton.sql b/packages/console/core/migrations/20250911141957_dusty_clint_barton/migration.sql similarity index 100% rename from packages/console/core/migrations/0003_dusty_clint_barton.sql rename to packages/console/core/migrations/20250911141957_dusty_clint_barton/migration.sql diff --git a/packages/console/core/migrations/20250911141957_dusty_clint_barton/snapshot.json b/packages/console/core/migrations/20250911141957_dusty_clint_barton/snapshot.json new file mode 100644 index 000000000000..fc7e5be452c9 --- /dev/null +++ b/packages/console/core/migrations/20250911141957_dusty_clint_barton/snapshot.json @@ -0,0 +1,1020 @@ +{ + "version": "6", + "id": "26cebd59-f553-441c-a2b2-2f9578a0ad2b", + "prevIds": [ + "9f51ef52-31ac-4ace-8b6d-39b35efe9c81" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0004_first_mockingbird.sql b/packages/console/core/migrations/20250911214917_first_mockingbird/migration.sql similarity index 100% rename from packages/console/core/migrations/0004_first_mockingbird.sql rename to packages/console/core/migrations/20250911214917_first_mockingbird/migration.sql diff --git a/packages/console/core/migrations/20250911214917_first_mockingbird/snapshot.json b/packages/console/core/migrations/20250911214917_first_mockingbird/snapshot.json new file mode 100644 index 000000000000..dd17e1580dd9 --- /dev/null +++ b/packages/console/core/migrations/20250911214917_first_mockingbird/snapshot.json @@ -0,0 +1,1034 @@ +{ + "version": "6", + "id": "06dc6226-bfbb-4ccc-b4bc-f26070c3bed5", + "prevIds": [ + "26cebd59-f553-441c-a2b2-2f9578a0ad2b" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0005_jazzy_skrulls.sql b/packages/console/core/migrations/20250911231144_jazzy_skrulls/migration.sql similarity index 100% rename from packages/console/core/migrations/0005_jazzy_skrulls.sql rename to packages/console/core/migrations/20250911231144_jazzy_skrulls/migration.sql diff --git a/packages/console/core/migrations/20250911231144_jazzy_skrulls/snapshot.json b/packages/console/core/migrations/20250911231144_jazzy_skrulls/snapshot.json new file mode 100644 index 000000000000..7b5153446b36 --- /dev/null +++ b/packages/console/core/migrations/20250911231144_jazzy_skrulls/snapshot.json @@ -0,0 +1,1034 @@ +{ + "version": "6", + "id": "d13af80e-3c70-4866-8f14-48e7ff6ff0ff", + "prevIds": [ + "06dc6226-bfbb-4ccc-b4bc-f26070c3bed5" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0006_parallel_gauntlet.sql b/packages/console/core/migrations/20250912021148_parallel_gauntlet/migration.sql similarity index 100% rename from packages/console/core/migrations/0006_parallel_gauntlet.sql rename to packages/console/core/migrations/20250912021148_parallel_gauntlet/migration.sql diff --git a/packages/console/core/migrations/20250912021148_parallel_gauntlet/snapshot.json b/packages/console/core/migrations/20250912021148_parallel_gauntlet/snapshot.json new file mode 100644 index 000000000000..e92cc105d4d0 --- /dev/null +++ b/packages/console/core/migrations/20250912021148_parallel_gauntlet/snapshot.json @@ -0,0 +1,1062 @@ +{ + "version": "6", + "id": "b0ad4b11-b607-46c7-8e2d-3b9823cdc5f7", + "prevIds": [ + "d13af80e-3c70-4866-8f14-48e7ff6ff0ff" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0007_familiar_nightshade.sql b/packages/console/core/migrations/20250912161749_familiar_nightshade/migration.sql similarity index 100% rename from packages/console/core/migrations/0007_familiar_nightshade.sql rename to packages/console/core/migrations/20250912161749_familiar_nightshade/migration.sql diff --git a/packages/console/core/migrations/20250912161749_familiar_nightshade/snapshot.json b/packages/console/core/migrations/20250912161749_familiar_nightshade/snapshot.json new file mode 100644 index 000000000000..36b4dee021f4 --- /dev/null +++ b/packages/console/core/migrations/20250912161749_familiar_nightshade/snapshot.json @@ -0,0 +1,1048 @@ +{ + "version": "6", + "id": "91067cc9-d492-47b3-932a-42dcc0920b3c", + "prevIds": [ + "b0ad4b11-b607-46c7-8e2d-3b9823cdc5f7" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0008_eminent_ultimatum.sql b/packages/console/core/migrations/20250914213824_eminent_ultimatum/migration.sql similarity index 100% rename from packages/console/core/migrations/0008_eminent_ultimatum.sql rename to packages/console/core/migrations/20250914213824_eminent_ultimatum/migration.sql diff --git a/packages/console/core/migrations/20250914213824_eminent_ultimatum/snapshot.json b/packages/console/core/migrations/20250914213824_eminent_ultimatum/snapshot.json new file mode 100644 index 000000000000..87a0cb8b93d7 --- /dev/null +++ b/packages/console/core/migrations/20250914213824_eminent_ultimatum/snapshot.json @@ -0,0 +1,1062 @@ +{ + "version": "6", + "id": "3e080fc0-9efd-411f-b764-ed3aa4abcee5", + "prevIds": [ + "91067cc9-d492-47b3-932a-42dcc0920b3c" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0009_redundant_piledriver.sql b/packages/console/core/migrations/20250914222302_redundant_piledriver/migration.sql similarity index 100% rename from packages/console/core/migrations/0009_redundant_piledriver.sql rename to packages/console/core/migrations/20250914222302_redundant_piledriver/migration.sql diff --git a/packages/console/core/migrations/20250914222302_redundant_piledriver/snapshot.json b/packages/console/core/migrations/20250914222302_redundant_piledriver/snapshot.json new file mode 100644 index 000000000000..54f9249761d5 --- /dev/null +++ b/packages/console/core/migrations/20250914222302_redundant_piledriver/snapshot.json @@ -0,0 +1,1076 @@ +{ + "version": "6", + "id": "b0019e1e-d365-4f67-be3d-a2e69bdddc04", + "prevIds": [ + "3e080fc0-9efd-411f-b764-ed3aa4abcee5" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "error", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0010_needy_sue_storm.sql b/packages/console/core/migrations/20250914232505_needy_sue_storm/migration.sql similarity index 100% rename from packages/console/core/migrations/0010_needy_sue_storm.sql rename to packages/console/core/migrations/20250914232505_needy_sue_storm/migration.sql diff --git a/packages/console/core/migrations/20250914232505_needy_sue_storm/snapshot.json b/packages/console/core/migrations/20250914232505_needy_sue_storm/snapshot.json new file mode 100644 index 000000000000..827303f84375 --- /dev/null +++ b/packages/console/core/migrations/20250914232505_needy_sue_storm/snapshot.json @@ -0,0 +1,1092 @@ +{ + "version": "6", + "id": "1f08bd5a-436d-4905-a585-87b156847402", + "prevIds": [ + "b0019e1e-d365-4f67-be3d-a2e69bdddc04" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "error", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0011_freezing_phil_sheldon.sql b/packages/console/core/migrations/20250915150801_freezing_phil_sheldon/migration.sql similarity index 100% rename from packages/console/core/migrations/0011_freezing_phil_sheldon.sql rename to packages/console/core/migrations/20250915150801_freezing_phil_sheldon/migration.sql diff --git a/packages/console/core/migrations/20250915150801_freezing_phil_sheldon/snapshot.json b/packages/console/core/migrations/20250915150801_freezing_phil_sheldon/snapshot.json new file mode 100644 index 000000000000..d0afdbd108a3 --- /dev/null +++ b/packages/console/core/migrations/20250915150801_freezing_phil_sheldon/snapshot.json @@ -0,0 +1,1106 @@ +{ + "version": "6", + "id": "cd9c94c4-9167-4346-b716-1bd0cff10ffc", + "prevIds": [ + "1f08bd5a-436d-4905-a585-87b156847402" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "last_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_last_error", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0012_bright_photon.sql b/packages/console/core/migrations/20250915172014_bright_photon/migration.sql similarity index 100% rename from packages/console/core/migrations/0012_bright_photon.sql rename to packages/console/core/migrations/20250915172014_bright_photon/migration.sql diff --git a/packages/console/core/migrations/20250915172014_bright_photon/snapshot.json b/packages/console/core/migrations/20250915172014_bright_photon/snapshot.json new file mode 100644 index 000000000000..5afc7dfefba9 --- /dev/null +++ b/packages/console/core/migrations/20250915172014_bright_photon/snapshot.json @@ -0,0 +1,1148 @@ +{ + "version": "6", + "id": "ba801b30-747a-433e-ab43-b407c961a24c", + "prevIds": [ + "cd9c94c4-9167-4346-b716-1bd0cff10ffc" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "last_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_last_error", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0013_absurd_hobgoblin.sql b/packages/console/core/migrations/20250915172258_absurd_hobgoblin/migration.sql similarity index 100% rename from packages/console/core/migrations/0013_absurd_hobgoblin.sql rename to packages/console/core/migrations/20250915172258_absurd_hobgoblin/migration.sql diff --git a/packages/console/core/migrations/20250915172258_absurd_hobgoblin/snapshot.json b/packages/console/core/migrations/20250915172258_absurd_hobgoblin/snapshot.json new file mode 100644 index 000000000000..ca4351d30f91 --- /dev/null +++ b/packages/console/core/migrations/20250915172258_absurd_hobgoblin/snapshot.json @@ -0,0 +1,1148 @@ +{ + "version": "6", + "id": "28336c91-553c-4d1d-9875-1ee761e47582", + "prevIds": [ + "ba801b30-747a-433e-ab43-b407c961a24c" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0014_demonic_princess_powerful.sql b/packages/console/core/migrations/20250919135159_demonic_princess_powerful/migration.sql similarity index 100% rename from packages/console/core/migrations/0014_demonic_princess_powerful.sql rename to packages/console/core/migrations/20250919135159_demonic_princess_powerful/migration.sql diff --git a/packages/console/core/migrations/20250919135159_demonic_princess_powerful/snapshot.json b/packages/console/core/migrations/20250919135159_demonic_princess_powerful/snapshot.json new file mode 100644 index 000000000000..b20d43e8d771 --- /dev/null +++ b/packages/console/core/migrations/20250919135159_demonic_princess_powerful/snapshot.json @@ -0,0 +1,1162 @@ +{ + "version": "6", + "id": "12189a4e-5083-4b17-b8e3-8279c9a3e61a", + "prevIds": [ + "28336c91-553c-4d1d-9875-1ee761e47582" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "data_share", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0015_cloudy_revanche.sql b/packages/console/core/migrations/20250921042124_cloudy_revanche/migration.sql similarity index 100% rename from packages/console/core/migrations/0015_cloudy_revanche.sql rename to packages/console/core/migrations/20250921042124_cloudy_revanche/migration.sql diff --git a/packages/console/core/migrations/20250921042124_cloudy_revanche/snapshot.json b/packages/console/core/migrations/20250921042124_cloudy_revanche/snapshot.json new file mode 100644 index 000000000000..a6d2e451e9de --- /dev/null +++ b/packages/console/core/migrations/20250921042124_cloudy_revanche/snapshot.json @@ -0,0 +1,1148 @@ +{ + "version": "6", + "id": "7f3989cb-3e8b-430e-a0f5-f87051d1d824", + "prevIds": [ + "12189a4e-5083-4b17-b8e3-8279c9a3e61a" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0016_cold_la_nuit.sql b/packages/console/core/migrations/20250923213126_cold_la_nuit/migration.sql similarity index 100% rename from packages/console/core/migrations/0016_cold_la_nuit.sql rename to packages/console/core/migrations/20250923213126_cold_la_nuit/migration.sql diff --git a/packages/console/core/migrations/20250923213126_cold_la_nuit/snapshot.json b/packages/console/core/migrations/20250923213126_cold_la_nuit/snapshot.json new file mode 100644 index 000000000000..12bfe5d6e77f --- /dev/null +++ b/packages/console/core/migrations/20250923213126_cold_la_nuit/snapshot.json @@ -0,0 +1,1162 @@ +{ + "version": "6", + "id": "45b67fb4-77ce-4aa2-b883-1971429c69f5", + "prevIds": [ + "7f3989cb-3e8b-430e-a0f5-f87051d1d824" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0017_woozy_thaddeus_ross.sql b/packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/migration.sql similarity index 100% rename from packages/console/core/migrations/0017_woozy_thaddeus_ross.sql rename to packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/migration.sql diff --git a/packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/snapshot.json b/packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/snapshot.json new file mode 100644 index 000000000000..d6e1020b5119 --- /dev/null +++ b/packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/snapshot.json @@ -0,0 +1,1176 @@ +{ + "version": "6", + "id": "100a21cf-ff9c-476f-bf7d-100c1824b2b2", + "prevIds": [ + "45b67fb4-77ce-4aa2-b883-1971429c69f5" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0018_nervous_iron_lad.sql b/packages/console/core/migrations/20250928163425_nervous_iron_lad/migration.sql similarity index 100% rename from packages/console/core/migrations/0018_nervous_iron_lad.sql rename to packages/console/core/migrations/20250928163425_nervous_iron_lad/migration.sql diff --git a/packages/console/core/migrations/20250928163425_nervous_iron_lad/snapshot.json b/packages/console/core/migrations/20250928163425_nervous_iron_lad/snapshot.json new file mode 100644 index 000000000000..873927d5c2c2 --- /dev/null +++ b/packages/console/core/migrations/20250928163425_nervous_iron_lad/snapshot.json @@ -0,0 +1,1204 @@ +{ + "version": "6", + "id": "e9c91c2d-787d-4234-b98d-1620e4ce80e1", + "prevIds": [ + "100a21cf-ff9c-476f-bf7d-100c1824b2b2" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_joined", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0019_dazzling_cable.sql b/packages/console/core/migrations/20250928235456_dazzling_cable/migration.sql similarity index 100% rename from packages/console/core/migrations/0019_dazzling_cable.sql rename to packages/console/core/migrations/20250928235456_dazzling_cable/migration.sql diff --git a/packages/console/core/migrations/20250928235456_dazzling_cable/snapshot.json b/packages/console/core/migrations/20250928235456_dazzling_cable/snapshot.json new file mode 100644 index 000000000000..406b4039d04a --- /dev/null +++ b/packages/console/core/migrations/20250928235456_dazzling_cable/snapshot.json @@ -0,0 +1,1204 @@ +{ + "version": "6", + "id": "a2bb7222-561c-45f0-8939-8ef9b8e57bb3", + "prevIds": [ + "e9c91c2d-787d-4234-b98d-1620e4ce80e1" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_joined", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0020_supreme_jack_power.sql b/packages/console/core/migrations/20250929181457_supreme_jack_power/migration.sql similarity index 100% rename from packages/console/core/migrations/0020_supreme_jack_power.sql rename to packages/console/core/migrations/20250929181457_supreme_jack_power/migration.sql diff --git a/packages/console/core/migrations/20250929181457_supreme_jack_power/snapshot.json b/packages/console/core/migrations/20250929181457_supreme_jack_power/snapshot.json new file mode 100644 index 000000000000..fadd88005d9b --- /dev/null +++ b/packages/console/core/migrations/20250929181457_supreme_jack_power/snapshot.json @@ -0,0 +1,1190 @@ +{ + "version": "6", + "id": "908437f9-54ed-4c83-b555-614926e326f8", + "prevIds": [ + "a2bb7222-561c-45f0-8939-8ef9b8e57bb3" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0021_flawless_clea.sql b/packages/console/core/migrations/20250929224703_flawless_clea/migration.sql similarity index 100% rename from packages/console/core/migrations/0021_flawless_clea.sql rename to packages/console/core/migrations/20250929224703_flawless_clea/migration.sql diff --git a/packages/console/core/migrations/20250929224703_flawless_clea/snapshot.json b/packages/console/core/migrations/20250929224703_flawless_clea/snapshot.json new file mode 100644 index 000000000000..486ae035a6f2 --- /dev/null +++ b/packages/console/core/migrations/20250929224703_flawless_clea/snapshot.json @@ -0,0 +1,1204 @@ +{ + "version": "6", + "id": "14616ba2-c21e-4787-a289-f2a3eb6de04f", + "prevIds": [ + "908437f9-54ed-4c83-b555-614926e326f8" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0022_nice_dreadnoughts.sql b/packages/console/core/migrations/20251002175032_nice_dreadnoughts/migration.sql similarity index 100% rename from packages/console/core/migrations/0022_nice_dreadnoughts.sql rename to packages/console/core/migrations/20251002175032_nice_dreadnoughts/migration.sql diff --git a/packages/console/core/migrations/20251002175032_nice_dreadnoughts/snapshot.json b/packages/console/core/migrations/20251002175032_nice_dreadnoughts/snapshot.json new file mode 100644 index 000000000000..3c1dc1276029 --- /dev/null +++ b/packages/console/core/migrations/20251002175032_nice_dreadnoughts/snapshot.json @@ -0,0 +1,1252 @@ +{ + "version": "6", + "id": "2296e9e4-bee6-485b-a146-6666ac8dc0d0", + "prevIds": [ + "14616ba2-c21e-4787-a289-f2a3eb6de04f" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0023_optimal_paibok.sql b/packages/console/core/migrations/20251002223020_optimal_paibok/migration.sql similarity index 100% rename from packages/console/core/migrations/0023_optimal_paibok.sql rename to packages/console/core/migrations/20251002223020_optimal_paibok/migration.sql diff --git a/packages/console/core/migrations/20251002223020_optimal_paibok/snapshot.json b/packages/console/core/migrations/20251002223020_optimal_paibok/snapshot.json new file mode 100644 index 000000000000..b2e699608399 --- /dev/null +++ b/packages/console/core/migrations/20251002223020_optimal_paibok/snapshot.json @@ -0,0 +1,1284 @@ +{ + "version": "6", + "id": "6857f409-1b5d-4752-9d65-a82ee70e6ad2", + "prevIds": [ + "2296e9e4-bee6-485b-a146-6666ac8dc0d0" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0024_early_black_crow.sql b/packages/console/core/migrations/20251003202205_early_black_crow/migration.sql similarity index 100% rename from packages/console/core/migrations/0024_early_black_crow.sql rename to packages/console/core/migrations/20251003202205_early_black_crow/migration.sql diff --git a/packages/console/core/migrations/20251003202205_early_black_crow/snapshot.json b/packages/console/core/migrations/20251003202205_early_black_crow/snapshot.json new file mode 100644 index 000000000000..fbbcbe9d7ae3 --- /dev/null +++ b/packages/console/core/migrations/20251003202205_early_black_crow/snapshot.json @@ -0,0 +1,1256 @@ +{ + "version": "6", + "id": "6d546f3e-17b2-4195-bb10-7e6d91774bd7", + "prevIds": [ + "6857f409-1b5d-4752-9d65-a82ee70e6ad2" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0025_legal_joseph.sql b/packages/console/core/migrations/20251003210411_legal_joseph/migration.sql similarity index 100% rename from packages/console/core/migrations/0025_legal_joseph.sql rename to packages/console/core/migrations/20251003210411_legal_joseph/migration.sql diff --git a/packages/console/core/migrations/20251003210411_legal_joseph/snapshot.json b/packages/console/core/migrations/20251003210411_legal_joseph/snapshot.json new file mode 100644 index 000000000000..01b6820aadb2 --- /dev/null +++ b/packages/console/core/migrations/20251003210411_legal_joseph/snapshot.json @@ -0,0 +1,1270 @@ +{ + "version": "6", + "id": "ce444765-0606-4880-970a-2176bc2a78ac", + "prevIds": [ + "6d546f3e-17b2-4195-bb10-7e6d91774bd7" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "name", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "name", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0026_numerous_prodigy.sql b/packages/console/core/migrations/20251004030300_numerous_prodigy/migration.sql similarity index 100% rename from packages/console/core/migrations/0026_numerous_prodigy.sql rename to packages/console/core/migrations/20251004030300_numerous_prodigy/migration.sql diff --git a/packages/console/core/migrations/20251004030300_numerous_prodigy/snapshot.json b/packages/console/core/migrations/20251004030300_numerous_prodigy/snapshot.json new file mode 100644 index 000000000000..aea58e55dfb8 --- /dev/null +++ b/packages/console/core/migrations/20251004030300_numerous_prodigy/snapshot.json @@ -0,0 +1,1250 @@ +{ + "version": "6", + "id": "9e1313c7-ca78-4d2c-b13b-625d9d6fcaa3", + "prevIds": [ + "ce444765-0606-4880-970a-2176bc2a78ac" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "actor", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "old_name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0027_hot_wong.sql b/packages/console/core/migrations/20251004045106_hot_wong/migration.sql similarity index 100% rename from packages/console/core/migrations/0027_hot_wong.sql rename to packages/console/core/migrations/20251004045106_hot_wong/migration.sql diff --git a/packages/console/core/migrations/20251004045106_hot_wong/snapshot.json b/packages/console/core/migrations/20251004045106_hot_wong/snapshot.json new file mode 100644 index 000000000000..59a7a37f279f --- /dev/null +++ b/packages/console/core/migrations/20251004045106_hot_wong/snapshot.json @@ -0,0 +1,1222 @@ +{ + "version": "6", + "id": "05e873f6-1556-4bcb-8e19-14971e37610a", + "prevIds": [ + "9e1313c7-ca78-4d2c-b13b-625d9d6fcaa3" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0028_careful_cerise.sql b/packages/console/core/migrations/20251007024345_careful_cerise/migration.sql similarity index 100% rename from packages/console/core/migrations/0028_careful_cerise.sql rename to packages/console/core/migrations/20251007024345_careful_cerise/migration.sql diff --git a/packages/console/core/migrations/20251007024345_careful_cerise/snapshot.json b/packages/console/core/migrations/20251007024345_careful_cerise/snapshot.json new file mode 100644 index 000000000000..73b658c7822f --- /dev/null +++ b/packages/console/core/migrations/20251007024345_careful_cerise/snapshot.json @@ -0,0 +1,1222 @@ +{ + "version": "6", + "id": "a331e38c-c2e3-406d-a1ff-b0af7229cd85", + "prevIds": [ + "05e873f6-1556-4bcb-8e19-14971e37610a" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0029_panoramic_harrier.sql b/packages/console/core/migrations/20251007043715_panoramic_harrier/migration.sql similarity index 100% rename from packages/console/core/migrations/0029_panoramic_harrier.sql rename to packages/console/core/migrations/20251007043715_panoramic_harrier/migration.sql diff --git a/packages/console/core/migrations/20251007043715_panoramic_harrier/snapshot.json b/packages/console/core/migrations/20251007043715_panoramic_harrier/snapshot.json new file mode 100644 index 000000000000..7e1e74e11c9c --- /dev/null +++ b/packages/console/core/migrations/20251007043715_panoramic_harrier/snapshot.json @@ -0,0 +1,1264 @@ +{ + "version": "6", + "id": "33551b4c-fc2e-4753-8d9d-0971f333e65d", + "prevIds": [ + "a331e38c-c2e3-406d-a1ff-b0af7229cd85" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0030_ordinary_ultragirl.sql b/packages/console/core/migrations/20251007230438_ordinary_ultragirl/migration.sql similarity index 100% rename from packages/console/core/migrations/0030_ordinary_ultragirl.sql rename to packages/console/core/migrations/20251007230438_ordinary_ultragirl/migration.sql diff --git a/packages/console/core/migrations/20251007230438_ordinary_ultragirl/snapshot.json b/packages/console/core/migrations/20251007230438_ordinary_ultragirl/snapshot.json new file mode 100644 index 000000000000..92731b1b0687 --- /dev/null +++ b/packages/console/core/migrations/20251007230438_ordinary_ultragirl/snapshot.json @@ -0,0 +1,1381 @@ +{ + "version": "6", + "id": "eae45fcf-dc0f-4756-bc5d-30791f2965a2", + "prevIds": [ + "33551b4c-fc2e-4753-8d9d-0971f333e65d" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0031_outgoing_outlaw_kid.sql b/packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/migration.sql similarity index 100% rename from packages/console/core/migrations/0031_outgoing_outlaw_kid.sql rename to packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/migration.sql diff --git a/packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/snapshot.json b/packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/snapshot.json new file mode 100644 index 000000000000..ac9833abd4d8 --- /dev/null +++ b/packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/snapshot.json @@ -0,0 +1,1512 @@ +{ + "version": "6", + "id": "9dceb591-8e08-4991-a49c-1f1741ec1e57", + "prevIds": [ + "eae45fcf-dc0f-4756-bc5d-30791f2965a2" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0032_white_doctor_doom.sql b/packages/console/core/migrations/20251009021849_white_doctor_doom/migration.sql similarity index 100% rename from packages/console/core/migrations/0032_white_doctor_doom.sql rename to packages/console/core/migrations/20251009021849_white_doctor_doom/migration.sql diff --git a/packages/console/core/migrations/20251009021849_white_doctor_doom/snapshot.json b/packages/console/core/migrations/20251009021849_white_doctor_doom/snapshot.json new file mode 100644 index 000000000000..b0720848cdd2 --- /dev/null +++ b/packages/console/core/migrations/20251009021849_white_doctor_doom/snapshot.json @@ -0,0 +1,1526 @@ +{ + "version": "6", + "id": "b2406421-f22d-4153-a2a4-6deafe70ee54", + "prevIds": [ + "9dceb591-8e08-4991-a49c-1f1741ec1e57" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0033_cynical_jack_flag.sql b/packages/console/core/migrations/20251016175624_cynical_jack_flag/migration.sql similarity index 100% rename from packages/console/core/migrations/0033_cynical_jack_flag.sql rename to packages/console/core/migrations/20251016175624_cynical_jack_flag/migration.sql diff --git a/packages/console/core/migrations/20251016175624_cynical_jack_flag/snapshot.json b/packages/console/core/migrations/20251016175624_cynical_jack_flag/snapshot.json new file mode 100644 index 000000000000..7d621f1a0302 --- /dev/null +++ b/packages/console/core/migrations/20251016175624_cynical_jack_flag/snapshot.json @@ -0,0 +1,1540 @@ +{ + "version": "6", + "id": "91ef8fda-ca96-4a3f-af29-dd6ae7136398", + "prevIds": [ + "b2406421-f22d-4153-a2a4-6deafe70ee54" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0034_short_bulldozer.sql b/packages/console/core/migrations/20251016214520_short_bulldozer/migration.sql similarity index 100% rename from packages/console/core/migrations/0034_short_bulldozer.sql rename to packages/console/core/migrations/20251016214520_short_bulldozer/migration.sql diff --git a/packages/console/core/migrations/20251016214520_short_bulldozer/snapshot.json b/packages/console/core/migrations/20251016214520_short_bulldozer/snapshot.json new file mode 100644 index 000000000000..6eac1361cfa2 --- /dev/null +++ b/packages/console/core/migrations/20251016214520_short_bulldozer/snapshot.json @@ -0,0 +1,1662 @@ +{ + "version": "6", + "id": "34706440-26d7-43f5-9b39-815aa912e5ef", + "prevIds": [ + "91ef8fda-ca96-4a3f-af29-dd6ae7136398" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "email", + "table": "account", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0035_narrow_blindfold.sql b/packages/console/core/migrations/20251017015733_narrow_blindfold/migration.sql similarity index 100% rename from packages/console/core/migrations/0035_narrow_blindfold.sql rename to packages/console/core/migrations/20251017015733_narrow_blindfold/migration.sql diff --git a/packages/console/core/migrations/20251017015733_narrow_blindfold/snapshot.json b/packages/console/core/migrations/20251017015733_narrow_blindfold/snapshot.json new file mode 100644 index 000000000000..dd5b4b6a6e33 --- /dev/null +++ b/packages/console/core/migrations/20251017015733_narrow_blindfold/snapshot.json @@ -0,0 +1,1648 @@ +{ + "version": "6", + "id": "10169105-4545-4894-838b-004c0a42c584", + "prevIds": [ + "34706440-26d7-43f5-9b39-815aa912e5ef" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0036_slimy_energizer.sql b/packages/console/core/migrations/20251017024232_slimy_energizer/migration.sql similarity index 100% rename from packages/console/core/migrations/0036_slimy_energizer.sql rename to packages/console/core/migrations/20251017024232_slimy_energizer/migration.sql diff --git a/packages/console/core/migrations/20251017024232_slimy_energizer/snapshot.json b/packages/console/core/migrations/20251017024232_slimy_energizer/snapshot.json new file mode 100644 index 000000000000..67299bfdc449 --- /dev/null +++ b/packages/console/core/migrations/20251017024232_slimy_energizer/snapshot.json @@ -0,0 +1,1664 @@ +{ + "version": "6", + "id": "5470c8b4-296d-47bd-85a7-88cfd3b71434", + "prevIds": [ + "10169105-4545-4894-838b-004c0a42c584" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0037_messy_jackal.sql b/packages/console/core/migrations/20251031163113_messy_jackal/migration.sql similarity index 100% rename from packages/console/core/migrations/0037_messy_jackal.sql rename to packages/console/core/migrations/20251031163113_messy_jackal/migration.sql diff --git a/packages/console/core/migrations/20251031163113_messy_jackal/snapshot.json b/packages/console/core/migrations/20251031163113_messy_jackal/snapshot.json new file mode 100644 index 000000000000..91f2c72ebf95 --- /dev/null +++ b/packages/console/core/migrations/20251031163113_messy_jackal/snapshot.json @@ -0,0 +1,1692 @@ +{ + "version": "6", + "id": "8b7fa839-a088-408e-84a4-1a07325c0290", + "prevIds": [ + "5470c8b4-296d-47bd-85a7-88cfd3b71434" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0038_famous_magik.sql b/packages/console/core/migrations/20251125223403_famous_magik/migration.sql similarity index 100% rename from packages/console/core/migrations/0038_famous_magik.sql rename to packages/console/core/migrations/20251125223403_famous_magik/migration.sql diff --git a/packages/console/core/migrations/20251125223403_famous_magik/snapshot.json b/packages/console/core/migrations/20251125223403_famous_magik/snapshot.json new file mode 100644 index 000000000000..0849dcd51f09 --- /dev/null +++ b/packages/console/core/migrations/20251125223403_famous_magik/snapshot.json @@ -0,0 +1,1774 @@ +{ + "version": "6", + "id": "9d5d9885-7ec5-45f6-ac53-45a8e25dede7", + "prevIds": [ + "8b7fa839-a088-408e-84a4-1a07325c0290" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0039_striped_forge.sql b/packages/console/core/migrations/20251228182259_striped_forge/migration.sql similarity index 100% rename from packages/console/core/migrations/0039_striped_forge.sql rename to packages/console/core/migrations/20251228182259_striped_forge/migration.sql diff --git a/packages/console/core/migrations/20251228182259_striped_forge/snapshot.json b/packages/console/core/migrations/20251228182259_striped_forge/snapshot.json new file mode 100644 index 000000000000..164db88a264f --- /dev/null +++ b/packages/console/core/migrations/20251228182259_striped_forge/snapshot.json @@ -0,0 +1,1900 @@ +{ + "version": "6", + "id": "49a1ac05-78ab-4aae-908e-d4aeeb8196fc", + "prevIds": [ + "9d5d9885-7ec5-45f6-ac53-45a8e25dede7" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0040_broken_gamora.sql b/packages/console/core/migrations/20260105034337_broken_gamora/migration.sql similarity index 100% rename from packages/console/core/migrations/0040_broken_gamora.sql rename to packages/console/core/migrations/20260105034337_broken_gamora/migration.sql diff --git a/packages/console/core/migrations/20260105034337_broken_gamora/snapshot.json b/packages/console/core/migrations/20260105034337_broken_gamora/snapshot.json new file mode 100644 index 000000000000..10d01ff1ed0d --- /dev/null +++ b/packages/console/core/migrations/20260105034337_broken_gamora/snapshot.json @@ -0,0 +1,1920 @@ +{ + "version": "6", + "id": "bf19cd74-71f9-4bdf-b50e-67c2436f3408", + "prevIds": [ + "49a1ac05-78ab-4aae-908e-d4aeeb8196fc" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0041_odd_misty_knight.sql b/packages/console/core/migrations/20260106204919_odd_misty_knight/migration.sql similarity index 100% rename from packages/console/core/migrations/0041_odd_misty_knight.sql rename to packages/console/core/migrations/20260106204919_odd_misty_knight/migration.sql diff --git a/packages/console/core/migrations/20260106204919_odd_misty_knight/snapshot.json b/packages/console/core/migrations/20260106204919_odd_misty_knight/snapshot.json new file mode 100644 index 000000000000..8c1da22a293a --- /dev/null +++ b/packages/console/core/migrations/20260106204919_odd_misty_knight/snapshot.json @@ -0,0 +1,1975 @@ +{ + "version": "6", + "id": "9cf10c24-6029-4cb4-866e-ff9b501eaf7e", + "prevIds": [ + "bf19cd74-71f9-4bdf-b50e-67c2436f3408" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0042_flat_nightmare.sql b/packages/console/core/migrations/20260107000117_flat_nightmare/migration.sql similarity index 100% rename from packages/console/core/migrations/0042_flat_nightmare.sql rename to packages/console/core/migrations/20260107000117_flat_nightmare/migration.sql diff --git a/packages/console/core/migrations/20260107000117_flat_nightmare/snapshot.json b/packages/console/core/migrations/20260107000117_flat_nightmare/snapshot.json new file mode 100644 index 000000000000..c526ce8fa1e8 --- /dev/null +++ b/packages/console/core/migrations/20260107000117_flat_nightmare/snapshot.json @@ -0,0 +1,2073 @@ +{ + "version": "6", + "id": "4775571c-ad9c-4104-a202-2374b1963cfe", + "prevIds": [ + "9cf10c24-6029-4cb4-866e-ff9b501eaf7e" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "data", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscribed", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_recent_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_recent_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0043_lame_calypso.sql b/packages/console/core/migrations/20260107022356_lame_calypso/migration.sql similarity index 100% rename from packages/console/core/migrations/0043_lame_calypso.sql rename to packages/console/core/migrations/20260107022356_lame_calypso/migration.sql diff --git a/packages/console/core/migrations/20260107022356_lame_calypso/snapshot.json b/packages/console/core/migrations/20260107022356_lame_calypso/snapshot.json new file mode 100644 index 000000000000..c4a8d7409701 --- /dev/null +++ b/packages/console/core/migrations/20260107022356_lame_calypso/snapshot.json @@ -0,0 +1,2073 @@ +{ + "version": "6", + "id": "3ff862f3-eeb6-4b10-8c78-254de3778ab3", + "prevIds": [ + "4775571c-ad9c-4104-a202-2374b1963cfe" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "data", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscribed", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_interval_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_interval_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0044_tiny_captain_midlands.sql b/packages/console/core/migrations/20260107041522_tiny_captain_midlands/migration.sql similarity index 100% rename from packages/console/core/migrations/0044_tiny_captain_midlands.sql rename to packages/console/core/migrations/20260107041522_tiny_captain_midlands/migration.sql diff --git a/packages/console/core/migrations/20260107041522_tiny_captain_midlands/snapshot.json b/packages/console/core/migrations/20260107041522_tiny_captain_midlands/snapshot.json new file mode 100644 index 000000000000..faca26e79fba --- /dev/null +++ b/packages/console/core/migrations/20260107041522_tiny_captain_midlands/snapshot.json @@ -0,0 +1,2073 @@ +{ + "version": "6", + "id": "70394850-2c28-4012-a3d5-69357e3348b6", + "prevIds": [ + "3ff862f3-eeb6-4b10-8c78-254de3778ab3" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscribed", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_interval_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_interval_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0045_cuddly_diamondback.sql b/packages/console/core/migrations/20260107055817_cuddly_diamondback/migration.sql similarity index 100% rename from packages/console/core/migrations/0045_cuddly_diamondback.sql rename to packages/console/core/migrations/20260107055817_cuddly_diamondback/migration.sql diff --git a/packages/console/core/migrations/20260107055817_cuddly_diamondback/snapshot.json b/packages/console/core/migrations/20260107055817_cuddly_diamondback/snapshot.json new file mode 100644 index 000000000000..8b3abeea5ebe --- /dev/null +++ b/packages/console/core/migrations/20260107055817_cuddly_diamondback/snapshot.json @@ -0,0 +1,2089 @@ +{ + "version": "6", + "id": "27c1a3eb-b125-46d4-b436-abe5764fe4b7", + "prevIds": [ + "70394850-2c28-4012-a3d5-69357e3348b6" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscribed", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_interval_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_interval_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0046_charming_black_bolt.sql b/packages/console/core/migrations/20260108224422_charming_black_bolt/migration.sql similarity index 100% rename from packages/console/core/migrations/0046_charming_black_bolt.sql rename to packages/console/core/migrations/20260108224422_charming_black_bolt/migration.sql diff --git a/packages/console/core/migrations/20260108224422_charming_black_bolt/snapshot.json b/packages/console/core/migrations/20260108224422_charming_black_bolt/snapshot.json new file mode 100644 index 000000000000..83252a23b29e --- /dev/null +++ b/packages/console/core/migrations/20260108224422_charming_black_bolt/snapshot.json @@ -0,0 +1,2242 @@ +{ + "version": "6", + "id": "f3725f6d-5f33-4497-b4ba-cf05c46fb873", + "prevIds": [ + "27c1a3eb-b125-46d4-b436-abe5764fe4b7" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscribed", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_interval_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_interval_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "sub_time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0047_huge_omega_red.sql b/packages/console/core/migrations/20260109000245_huge_omega_red/migration.sql similarity index 100% rename from packages/console/core/migrations/0047_huge_omega_red.sql rename to packages/console/core/migrations/20260109000245_huge_omega_red/migration.sql diff --git a/packages/console/core/migrations/20260109000245_huge_omega_red/snapshot.json b/packages/console/core/migrations/20260109000245_huge_omega_red/snapshot.json new file mode 100644 index 000000000000..3e1837735daf --- /dev/null +++ b/packages/console/core/migrations/20260109000245_huge_omega_red/snapshot.json @@ -0,0 +1,2192 @@ +{ + "version": "6", + "id": "fec4cb15-6f13-465d-a902-b76b026872f4", + "prevIds": [ + "f3725f6d-5f33-4497-b4ba-cf05c46fb873" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "table": "subscription", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0048_mean_frank_castle.sql b/packages/console/core/migrations/20260109001625_mean_frank_castle/migration.sql similarity index 100% rename from packages/console/core/migrations/0048_mean_frank_castle.sql rename to packages/console/core/migrations/20260109001625_mean_frank_castle/migration.sql diff --git a/packages/console/core/migrations/20260109001625_mean_frank_castle/snapshot.json b/packages/console/core/migrations/20260109001625_mean_frank_castle/snapshot.json new file mode 100644 index 000000000000..a54719559f75 --- /dev/null +++ b/packages/console/core/migrations/20260109001625_mean_frank_castle/snapshot.json @@ -0,0 +1,2192 @@ +{ + "version": "6", + "id": "bb90bb3e-fd08-439a-b92f-5f433807480e", + "prevIds": [ + "fec4cb15-6f13-465d-a902-b76b026872f4" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "table": "subscription", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0049_noisy_domino.sql b/packages/console/core/migrations/20260109014234_noisy_domino/migration.sql similarity index 100% rename from packages/console/core/migrations/0049_noisy_domino.sql rename to packages/console/core/migrations/20260109014234_noisy_domino/migration.sql diff --git a/packages/console/core/migrations/20260109014234_noisy_domino/snapshot.json b/packages/console/core/migrations/20260109014234_noisy_domino/snapshot.json new file mode 100644 index 000000000000..2d71c85e8e0a --- /dev/null +++ b/packages/console/core/migrations/20260109014234_noisy_domino/snapshot.json @@ -0,0 +1,2206 @@ +{ + "version": "6", + "id": "2fd0308b-0653-437d-aea3-29428a4de9f1", + "prevIds": [ + "bb90bb3e-fd08-439a-b92f-5f433807480e" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_coupon_id", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "table": "subscription", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0050_bumpy_mephistopheles.sql b/packages/console/core/migrations/20260109040130_bumpy_mephistopheles/migration.sql similarity index 100% rename from packages/console/core/migrations/0050_bumpy_mephistopheles.sql rename to packages/console/core/migrations/20260109040130_bumpy_mephistopheles/migration.sql diff --git a/packages/console/core/migrations/20260109040130_bumpy_mephistopheles/snapshot.json b/packages/console/core/migrations/20260109040130_bumpy_mephistopheles/snapshot.json new file mode 100644 index 000000000000..225f9ad227d8 --- /dev/null +++ b/packages/console/core/migrations/20260109040130_bumpy_mephistopheles/snapshot.json @@ -0,0 +1,2220 @@ +{ + "version": "6", + "id": "a0d18802-c390-47d4-98f1-d1f83869cf0c", + "prevIds": [ + "2fd0308b-0653-437d-aea3-29428a4de9f1" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_coupon_id", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "table": "subscription", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0051_jazzy_green_goblin.sql b/packages/console/core/migrations/20260113215232_jazzy_green_goblin/migration.sql similarity index 100% rename from packages/console/core/migrations/0051_jazzy_green_goblin.sql rename to packages/console/core/migrations/20260113215232_jazzy_green_goblin/migration.sql diff --git a/packages/console/core/migrations/20260113215232_jazzy_green_goblin/snapshot.json b/packages/console/core/migrations/20260113215232_jazzy_green_goblin/snapshot.json new file mode 100644 index 000000000000..aad041fbdb72 --- /dev/null +++ b/packages/console/core/migrations/20260113215232_jazzy_green_goblin/snapshot.json @@ -0,0 +1,2234 @@ +{ + "version": "6", + "id": "14cbf4c8-55f1-4488-956f-56fb5ccb3a5a", + "prevIds": [ + "a0d18802-c390-47d4-98f1-d1f83869cf0c" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_coupon_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_booked", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "table": "subscription", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0052_aromatic_agent_zero.sql b/packages/console/core/migrations/20260113223840_aromatic_agent_zero/migration.sql similarity index 100% rename from packages/console/core/migrations/0052_aromatic_agent_zero.sql rename to packages/console/core/migrations/20260113223840_aromatic_agent_zero/migration.sql diff --git a/packages/console/core/migrations/20260113223840_aromatic_agent_zero/snapshot.json b/packages/console/core/migrations/20260113223840_aromatic_agent_zero/snapshot.json new file mode 100644 index 000000000000..71933a92d692 --- /dev/null +++ b/packages/console/core/migrations/20260113223840_aromatic_agent_zero/snapshot.json @@ -0,0 +1,2248 @@ +{ + "version": "6", + "id": "00774acd-a1e5-49c0-b296-cacc9506a566", + "prevIds": [ + "14cbf4c8-55f1-4488-956f-56fb5ccb3a5a" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_coupon_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "enum('20','100','200')", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_plan", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_booked", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "table": "subscription", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0053_gigantic_hardball.sql b/packages/console/core/migrations/20260116213606_gigantic_hardball/migration.sql similarity index 100% rename from packages/console/core/migrations/0053_gigantic_hardball.sql rename to packages/console/core/migrations/20260116213606_gigantic_hardball/migration.sql diff --git a/packages/console/core/migrations/20260116213606_gigantic_hardball/snapshot.json b/packages/console/core/migrations/20260116213606_gigantic_hardball/snapshot.json new file mode 100644 index 000000000000..f610aae1d707 --- /dev/null +++ b/packages/console/core/migrations/20260116213606_gigantic_hardball/snapshot.json @@ -0,0 +1,2262 @@ +{ + "version": "6", + "id": "32a0c40b-a269-4ad1-a5a0-52b1f18932aa", + "prevIds": [ + "00774acd-a1e5-49c0-b296-cacc9506a566" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_coupon_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "enum('20','100','200')", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_plan", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_booked", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "table": "subscription", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0054_numerous_annihilus.sql b/packages/console/core/migrations/20260116224745_numerous_annihilus/migration.sql similarity index 100% rename from packages/console/core/migrations/0054_numerous_annihilus.sql rename to packages/console/core/migrations/20260116224745_numerous_annihilus/migration.sql diff --git a/packages/console/core/migrations/20260116224745_numerous_annihilus/snapshot.json b/packages/console/core/migrations/20260116224745_numerous_annihilus/snapshot.json new file mode 100644 index 000000000000..13a662d82802 --- /dev/null +++ b/packages/console/core/migrations/20260116224745_numerous_annihilus/snapshot.json @@ -0,0 +1,2248 @@ +{ + "version": "6", + "id": "a0ade64b-b735-4a70-8d39-ebd84bc9e924", + "prevIds": [ + "32a0c40b-a269-4ad1-a5a0-52b1f18932aa" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "enum('20','100','200')", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_plan", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_booked", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "table": "subscription", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/0055_moaning_karnak.sql b/packages/console/core/migrations/20260122190905_moaning_karnak/migration.sql similarity index 100% rename from packages/console/core/migrations/0055_moaning_karnak.sql rename to packages/console/core/migrations/20260122190905_moaning_karnak/migration.sql diff --git a/packages/console/core/migrations/20260122190905_moaning_karnak/snapshot.json b/packages/console/core/migrations/20260122190905_moaning_karnak/snapshot.json new file mode 100644 index 000000000000..6435eb2d38ae --- /dev/null +++ b/packages/console/core/migrations/20260122190905_moaning_karnak/snapshot.json @@ -0,0 +1,2262 @@ +{ + "version": "6", + "id": "e630f63c-04a8-4b59-bf56-03efcdd1b011", + "prevIds": [ + "a0ade64b-b735-4a70-8d39-ebd84bc9e924" + ], + "dialect": "mysql", + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "account", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "account", + "entityType": "columns" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "auth", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "auth", + "entityType": "columns" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "table": "auth", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "auth", + "entityType": "columns" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "table": "benchmark", + "entityType": "columns" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "table": "benchmark", + "entityType": "columns" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "billing", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "billing", + "entityType": "columns" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "table": "billing", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "table": "billing", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription", + "table": "billing", + "entityType": "columns" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "table": "billing", + "entityType": "columns" + }, + { + "type": "enum('20','100','200')", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_plan", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_booked", + "table": "billing", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_selected", + "table": "billing", + "entityType": "columns" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "table": "payment", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "table": "payment", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "table": "payment", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "payment", + "entityType": "columns" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "table": "subscription", + "entityType": "columns" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "usage", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "table": "usage", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "table": "usage", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "table": "usage", + "entityType": "columns" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "table": "usage", + "entityType": "columns" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "table": "ip_rate_limit", + "entityType": "columns" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "ip", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "ip", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "table": "ip", + "entityType": "columns" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "table": "key", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "table": "key", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "table": "key", + "entityType": "columns" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "model", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "model", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "table": "model", + "entityType": "columns" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "provider", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "provider", + "entityType": "columns" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "table": "provider", + "entityType": "columns" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "table": "provider", + "entityType": "columns" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "table": "user", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "table": "user", + "entityType": "columns" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "table": "user", + "entityType": "columns" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "table": "user", + "entityType": "columns" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "table": "user", + "entityType": "columns" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "table": "workspace", + "entityType": "columns" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "table": "workspace", + "entityType": "columns" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "table": "auth", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "table": "benchmark", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "table": "billing", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "table": "subscription", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "table": "usage", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "table": "key", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "table": "model", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "table": "provider", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "table": "user", + "entityType": "indexes" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "table": "workspace", + "entityType": "indexes" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/20260222233442_clever_toxin/migration.sql b/packages/console/core/migrations/20260222233442_clever_toxin/migration.sql new file mode 100644 index 000000000000..03cfe4c033cc --- /dev/null +++ b/packages/console/core/migrations/20260222233442_clever_toxin/migration.sql @@ -0,0 +1 @@ +ALTER TABLE `usage` ADD `session_id` varchar(30); \ No newline at end of file diff --git a/packages/console/core/migrations/20260222233442_clever_toxin/snapshot.json b/packages/console/core/migrations/20260222233442_clever_toxin/snapshot.json new file mode 100644 index 000000000000..a9d26f2dab4b --- /dev/null +++ b/packages/console/core/migrations/20260222233442_clever_toxin/snapshot.json @@ -0,0 +1,2276 @@ +{ + "version": "6", + "dialect": "mysql", + "id": "4bf45b3f-3edd-4db7-94d5-097aa55ca5f7", + "prevIds": [ + "e630f63c-04a8-4b59-bf56-03efcdd1b011" + ], + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "account" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "account" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "account" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "account" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "auth" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "auth" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "auth" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "auth" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "entityType": "columns", + "table": "auth" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "entityType": "columns", + "table": "auth" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "entityType": "columns", + "table": "auth" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "entityType": "columns", + "table": "billing" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "entityType": "columns", + "table": "billing" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "entityType": "columns", + "table": "billing" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "entityType": "columns", + "table": "billing" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "entityType": "columns", + "table": "billing" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "entityType": "columns", + "table": "billing" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "entityType": "columns", + "table": "billing" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "enum('20','100','200')", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_plan", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_booked", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_selected", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "entityType": "columns", + "table": "payment" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "usage" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "usage" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "entityType": "columns", + "table": "ip_rate_limit" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "entityType": "columns", + "table": "ip_rate_limit" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "entityType": "columns", + "table": "ip_rate_limit" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "entityType": "columns", + "table": "ip" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "ip" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "ip" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "ip" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "entityType": "columns", + "table": "ip" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "model" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "model" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "model" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "model" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "model" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "model" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "provider" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "provider" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "provider" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "provider" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "provider" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "entityType": "columns", + "table": "provider" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "entityType": "columns", + "table": "provider" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "entityType": "columns", + "table": "user" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "entityType": "columns", + "table": "user" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "entityType": "columns", + "table": "user" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "entityType": "columns", + "table": "user" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "workspace" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "entityType": "indexes", + "table": "auth" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "entityType": "indexes", + "table": "auth" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "entityType": "indexes", + "table": "benchmark" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "entityType": "indexes", + "table": "billing" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "entityType": "indexes", + "table": "billing" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "entityType": "indexes", + "table": "subscription" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "entityType": "indexes", + "table": "usage" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "entityType": "indexes", + "table": "key" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "entityType": "indexes", + "table": "model" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "entityType": "indexes", + "table": "provider" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "entityType": "indexes", + "table": "workspace" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/migrations/meta/0000_snapshot.json b/packages/console/core/migrations/meta/0000_snapshot.json deleted file mode 100644 index 17d3bd7f9d3f..000000000000 --- a/packages/console/core/migrations/meta/0000_snapshot.json +++ /dev/null @@ -1,569 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "aee779c5-db1d-4655-95ec-6451c18455be", - "prevId": "00000000-0000-0000-0000-000000000000", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_tokens": { - "name": "cache_write_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0001_snapshot.json b/packages/console/core/migrations/meta/0001_snapshot.json deleted file mode 100644 index d23d1601d937..000000000000 --- a/packages/console/core/migrations/meta/0001_snapshot.json +++ /dev/null @@ -1,569 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "79b7ee25-1c1c-41ff-9bbf-754af257102b", - "prevId": "aee779c5-db1d-4655-95ec-6451c18455be", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_tokens": { - "name": "cache_write_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0002_snapshot.json b/packages/console/core/migrations/meta/0002_snapshot.json deleted file mode 100644 index 45d06926c1aa..000000000000 --- a/packages/console/core/migrations/meta/0002_snapshot.json +++ /dev/null @@ -1,576 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "9f51ef52-31ac-4ace-8b6d-39b35efe9c81", - "prevId": "79b7ee25-1c1c-41ff-9bbf-754af257102b", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_tokens": { - "name": "cache_write_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0003_snapshot.json b/packages/console/core/migrations/meta/0003_snapshot.json deleted file mode 100644 index e832ebb00ce7..000000000000 --- a/packages/console/core/migrations/meta/0003_snapshot.json +++ /dev/null @@ -1,581 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "26cebd59-f553-441c-a2b2-2f9578a0ad2b", - "prevId": "9f51ef52-31ac-4ace-8b6d-39b35efe9c81", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_tokens": { - "name": "cache_write_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0004_snapshot.json b/packages/console/core/migrations/meta/0004_snapshot.json deleted file mode 100644 index 6d2695c488e9..000000000000 --- a/packages/console/core/migrations/meta/0004_snapshot.json +++ /dev/null @@ -1,588 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "06dc6226-bfbb-4ccc-b4bc-f26070c3bed5", - "prevId": "26cebd59-f553-441c-a2b2-2f9578a0ad2b", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_tokens": { - "name": "cache_write_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0005_snapshot.json b/packages/console/core/migrations/meta/0005_snapshot.json deleted file mode 100644 index 12246a6d62dc..000000000000 --- a/packages/console/core/migrations/meta/0005_snapshot.json +++ /dev/null @@ -1,588 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "d13af80e-3c70-4866-8f14-48e7ff6ff0ff", - "prevId": "06dc6226-bfbb-4ccc-b4bc-f26070c3bed5", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_tokens": { - "name": "cache_write_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0006_snapshot.json b/packages/console/core/migrations/meta/0006_snapshot.json deleted file mode 100644 index d726b6f67833..000000000000 --- a/packages/console/core/migrations/meta/0006_snapshot.json +++ /dev/null @@ -1,602 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "b0ad4b11-b607-46c7-8e2d-3b9823cdc5f7", - "prevId": "d13af80e-3c70-4866-8f14-48e7ff6ff0ff", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_tokens": { - "name": "cache_write_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0007_snapshot.json b/packages/console/core/migrations/meta/0007_snapshot.json deleted file mode 100644 index 122db42cb909..000000000000 --- a/packages/console/core/migrations/meta/0007_snapshot.json +++ /dev/null @@ -1,595 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "91067cc9-d492-47b3-932a-42dcc0920b3c", - "prevId": "b0ad4b11-b607-46c7-8e2d-3b9823cdc5f7", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0008_snapshot.json b/packages/console/core/migrations/meta/0008_snapshot.json deleted file mode 100644 index 02c473200229..000000000000 --- a/packages/console/core/migrations/meta/0008_snapshot.json +++ /dev/null @@ -1,602 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "3e080fc0-9efd-411f-b764-ed3aa4abcee5", - "prevId": "91067cc9-d492-47b3-932a-42dcc0920b3c", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0009_snapshot.json b/packages/console/core/migrations/meta/0009_snapshot.json deleted file mode 100644 index a3bd57cae751..000000000000 --- a/packages/console/core/migrations/meta/0009_snapshot.json +++ /dev/null @@ -1,609 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "b0019e1e-d365-4f67-be3d-a2e69bdddc04", - "prevId": "3e080fc0-9efd-411f-b764-ed3aa4abcee5", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "error": { - "name": "error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0010_snapshot.json b/packages/console/core/migrations/meta/0010_snapshot.json deleted file mode 100644 index cb55610ae67f..000000000000 --- a/packages/console/core/migrations/meta/0010_snapshot.json +++ /dev/null @@ -1,615 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "1f08bd5a-436d-4905-a585-87b156847402", - "prevId": "b0019e1e-d365-4f67-be3d-a2e69bdddc04", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "error": { - "name": "error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0011_snapshot.json b/packages/console/core/migrations/meta/0011_snapshot.json deleted file mode 100644 index 7eb6fa71ad24..000000000000 --- a/packages/console/core/migrations/meta/0011_snapshot.json +++ /dev/null @@ -1,622 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "cd9c94c4-9167-4346-b716-1bd0cff10ffc", - "prevId": "1f08bd5a-436d-4905-a585-87b156847402", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_error": { - "name": "last_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_last_error": { - "name": "time_last_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0012_snapshot.json b/packages/console/core/migrations/meta/0012_snapshot.json deleted file mode 100644 index 4220c988b2c3..000000000000 --- a/packages/console/core/migrations/meta/0012_snapshot.json +++ /dev/null @@ -1,643 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "ba801b30-747a-433e-ab43-b407c961a24c", - "prevId": "cd9c94c4-9167-4346-b716-1bd0cff10ffc", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_error": { - "name": "last_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_last_error": { - "name": "time_last_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0013_snapshot.json b/packages/console/core/migrations/meta/0013_snapshot.json deleted file mode 100644 index ef805ee83630..000000000000 --- a/packages/console/core/migrations/meta/0013_snapshot.json +++ /dev/null @@ -1,646 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "28336c91-553c-4d1d-9875-1ee761e47582", - "prevId": "ba801b30-747a-433e-ab43-b407c961a24c", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": { - "\"billing\".\"last_error\"": "\"billing\".\"reload_error\"", - "\"billing\".\"time_last_error\"": "\"billing\".\"time_reload_error\"" - } - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0014_snapshot.json b/packages/console/core/migrations/meta/0014_snapshot.json deleted file mode 100644 index b526aeead42b..000000000000 --- a/packages/console/core/migrations/meta/0014_snapshot.json +++ /dev/null @@ -1,650 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "12189a4e-5083-4b17-b8e3-8279c9a3e61a", - "prevId": "28336c91-553c-4d1d-9875-1ee761e47582", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "data_share": { - "name": "data_share", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0015_snapshot.json b/packages/console/core/migrations/meta/0015_snapshot.json deleted file mode 100644 index 57d893cd80bd..000000000000 --- a/packages/console/core/migrations/meta/0015_snapshot.json +++ /dev/null @@ -1,643 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "7f3989cb-3e8b-430e-a0f5-f87051d1d824", - "prevId": "12189a4e-5083-4b17-b8e3-8279c9a3e61a", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0016_snapshot.json b/packages/console/core/migrations/meta/0016_snapshot.json deleted file mode 100644 index eefeb31a7588..000000000000 --- a/packages/console/core/migrations/meta/0016_snapshot.json +++ /dev/null @@ -1,650 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "45b67fb4-77ce-4aa2-b883-1971429c69f5", - "prevId": "7f3989cb-3e8b-430e-a0f5-f87051d1d824", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0017_snapshot.json b/packages/console/core/migrations/meta/0017_snapshot.json deleted file mode 100644 index d7687f9c6cfb..000000000000 --- a/packages/console/core/migrations/meta/0017_snapshot.json +++ /dev/null @@ -1,657 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "100a21cf-ff9c-476f-bf7d-100c1824b2b2", - "prevId": "45b67fb4-77ce-4aa2-b883-1971429c69f5", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0018_snapshot.json b/packages/console/core/migrations/meta/0018_snapshot.json deleted file mode 100644 index 3e3c64c73410..000000000000 --- a/packages/console/core/migrations/meta/0018_snapshot.json +++ /dev/null @@ -1,671 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "e9c91c2d-787d-4234-b98d-1620e4ce80e1", - "prevId": "100a21cf-ff9c-476f-bf7d-100c1824b2b2", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_joined": { - "name": "time_joined", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0019_snapshot.json b/packages/console/core/migrations/meta/0019_snapshot.json deleted file mode 100644 index 9a0d4d243968..000000000000 --- a/packages/console/core/migrations/meta/0019_snapshot.json +++ /dev/null @@ -1,671 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "a2bb7222-561c-45f0-8939-8ef9b8e57bb3", - "prevId": "e9c91c2d-787d-4234-b98d-1620e4ce80e1", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_joined": { - "name": "time_joined", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0020_snapshot.json b/packages/console/core/migrations/meta/0020_snapshot.json deleted file mode 100644 index 9defceb5a3ba..000000000000 --- a/packages/console/core/migrations/meta/0020_snapshot.json +++ /dev/null @@ -1,664 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "908437f9-54ed-4c83-b555-614926e326f8", - "prevId": "a2bb7222-561c-45f0-8939-8ef9b8e57bb3", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0021_snapshot.json b/packages/console/core/migrations/meta/0021_snapshot.json deleted file mode 100644 index 64d3e9d2493b..000000000000 --- a/packages/console/core/migrations/meta/0021_snapshot.json +++ /dev/null @@ -1,671 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "14616ba2-c21e-4787-a289-f2a3eb6de04f", - "prevId": "908437f9-54ed-4c83-b555-614926e326f8", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_email": { - "name": "old_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0022_snapshot.json b/packages/console/core/migrations/meta/0022_snapshot.json deleted file mode 100644 index 8a1c4e7d8e9d..000000000000 --- a/packages/console/core/migrations/meta/0022_snapshot.json +++ /dev/null @@ -1,690 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "2296e9e4-bee6-485b-a146-6666ac8dc0d0", - "prevId": "14616ba2-c21e-4787-a289-f2a3eb6de04f", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_account_id": { - "name": "old_account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_email": { - "name": "old_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0023_snapshot.json b/packages/console/core/migrations/meta/0023_snapshot.json deleted file mode 100644 index 4f6f66283afc..000000000000 --- a/packages/console/core/migrations/meta/0023_snapshot.json +++ /dev/null @@ -1,700 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "6857f409-1b5d-4752-9d65-a82ee70e6ad2", - "prevId": "2296e9e4-bee6-485b-a146-6666ac8dc0d0", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_account_id": { - "name": "old_account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "old_email": { - "name": "old_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0024_snapshot.json b/packages/console/core/migrations/meta/0024_snapshot.json deleted file mode 100644 index 1ef25970a333..000000000000 --- a/packages/console/core/migrations/meta/0024_snapshot.json +++ /dev/null @@ -1,686 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "6d546f3e-17b2-4195-bb10-7e6d91774bd7", - "prevId": "6857f409-1b5d-4752-9d65-a82ee70e6ad2", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0025_snapshot.json b/packages/console/core/migrations/meta/0025_snapshot.json deleted file mode 100644 index 6746a6e8c61f..000000000000 --- a/packages/console/core/migrations/meta/0025_snapshot.json +++ /dev/null @@ -1,693 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "ce444765-0606-4880-970a-2176bc2a78ac", - "prevId": "6d546f3e-17b2-4195-bb10-7e6d91774bd7", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - }, - "name": { - "name": "name", - "columns": ["workspace_id", "name"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0026_snapshot.json b/packages/console/core/migrations/meta/0026_snapshot.json deleted file mode 100644 index d3c7dc496f1c..000000000000 --- a/packages/console/core/migrations/meta/0026_snapshot.json +++ /dev/null @@ -1,688 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "9e1313c7-ca78-4d2c-b13b-625d9d6fcaa3", - "prevId": "ce444765-0606-4880-970a-2176bc2a78ac", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "actor": { - "name": "actor", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "old_name": { - "name": "old_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0027_snapshot.json b/packages/console/core/migrations/meta/0027_snapshot.json deleted file mode 100644 index 408766f71790..000000000000 --- a/packages/console/core/migrations/meta/0027_snapshot.json +++ /dev/null @@ -1,674 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "05e873f6-1556-4bcb-8e19-14971e37610a", - "prevId": "9e1313c7-ca78-4d2c-b13b-625d9d6fcaa3", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0028_snapshot.json b/packages/console/core/migrations/meta/0028_snapshot.json deleted file mode 100644 index 827cb53c5ecd..000000000000 --- a/packages/console/core/migrations/meta/0028_snapshot.json +++ /dev/null @@ -1,674 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "a331e38c-c2e3-406d-a1ff-b0af7229cd85", - "prevId": "05e873f6-1556-4bcb-8e19-14971e37610a", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0029_snapshot.json b/packages/console/core/migrations/meta/0029_snapshot.json deleted file mode 100644 index d235697cc2a0..000000000000 --- a/packages/console/core/migrations/meta/0029_snapshot.json +++ /dev/null @@ -1,695 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "33551b4c-fc2e-4753-8d9d-0971f333e65d", - "prevId": "a331e38c-c2e3-406d-a1ff-b0af7229cd85", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0030_snapshot.json b/packages/console/core/migrations/meta/0030_snapshot.json deleted file mode 100644 index 66978dfa5fc3..000000000000 --- a/packages/console/core/migrations/meta/0030_snapshot.json +++ /dev/null @@ -1,760 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "eae45fcf-dc0f-4756-bc5d-30791f2965a2", - "prevId": "33551b4c-fc2e-4753-8d9d-0971f333e65d", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0031_snapshot.json b/packages/console/core/migrations/meta/0031_snapshot.json deleted file mode 100644 index c47165925035..000000000000 --- a/packages/console/core/migrations/meta/0031_snapshot.json +++ /dev/null @@ -1,832 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "9dceb591-8e08-4991-a49c-1f1741ec1e57", - "prevId": "eae45fcf-dc0f-4756-bc5d-30791f2965a2", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0032_snapshot.json b/packages/console/core/migrations/meta/0032_snapshot.json deleted file mode 100644 index 51e84a1d3a4d..000000000000 --- a/packages/console/core/migrations/meta/0032_snapshot.json +++ /dev/null @@ -1,839 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "b2406421-f22d-4153-a2a4-6deafe70ee54", - "prevId": "9dceb591-8e08-4991-a49c-1f1741ec1e57", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0033_snapshot.json b/packages/console/core/migrations/meta/0033_snapshot.json deleted file mode 100644 index 76d4720e89bd..000000000000 --- a/packages/console/core/migrations/meta/0033_snapshot.json +++ /dev/null @@ -1,846 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "91ef8fda-ca96-4a3f-af29-dd6ae7136398", - "prevId": "b2406421-f22d-4153-a2a4-6deafe70ee54", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0034_snapshot.json b/packages/console/core/migrations/meta/0034_snapshot.json deleted file mode 100644 index e9c999be7146..000000000000 --- a/packages/console/core/migrations/meta/0034_snapshot.json +++ /dev/null @@ -1,913 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "34706440-26d7-43f5-9b39-815aa912e5ef", - "prevId": "91ef8fda-ca96-4a3f-af29-dd6ae7136398", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "email": { - "name": "email", - "columns": ["email"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0035_snapshot.json b/packages/console/core/migrations/meta/0035_snapshot.json deleted file mode 100644 index 815d120ea016..000000000000 --- a/packages/console/core/migrations/meta/0035_snapshot.json +++ /dev/null @@ -1,905 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "10169105-4545-4894-838b-004c0a42c584", - "prevId": "34706440-26d7-43f5-9b39-815aa912e5ef", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0036_snapshot.json b/packages/console/core/migrations/meta/0036_snapshot.json deleted file mode 100644 index 926b143ebe11..000000000000 --- a/packages/console/core/migrations/meta/0036_snapshot.json +++ /dev/null @@ -1,915 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "5470c8b4-296d-47bd-85a7-88cfd3b71434", - "prevId": "10169105-4545-4894-838b-004c0a42c584", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0037_snapshot.json b/packages/console/core/migrations/meta/0037_snapshot.json deleted file mode 100644 index 8a80ea522154..000000000000 --- a/packages/console/core/migrations/meta/0037_snapshot.json +++ /dev/null @@ -1,929 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "8b7fa839-a088-408e-84a4-1a07325c0290", - "prevId": "5470c8b4-296d-47bd-85a7-88cfd3b71434", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0038_snapshot.json b/packages/console/core/migrations/meta/0038_snapshot.json deleted file mode 100644 index b0a59c497815..000000000000 --- a/packages/console/core/migrations/meta/0038_snapshot.json +++ /dev/null @@ -1,981 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "9d5d9885-7ec5-45f6-ac53-45a8e25dede7", - "prevId": "8b7fa839-a088-408e-84a4-1a07325c0290", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0039_snapshot.json b/packages/console/core/migrations/meta/0039_snapshot.json deleted file mode 100644 index ba34f1ac490b..000000000000 --- a/packages/console/core/migrations/meta/0039_snapshot.json +++ /dev/null @@ -1,1053 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "49a1ac05-78ab-4aae-908e-d4aeeb8196fc", - "prevId": "9d5d9885-7ec5-45f6-ac53-45a8e25dede7", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0040_snapshot.json b/packages/console/core/migrations/meta/0040_snapshot.json deleted file mode 100644 index 77012fd0ff1e..000000000000 --- a/packages/console/core/migrations/meta/0040_snapshot.json +++ /dev/null @@ -1,1059 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "bf19cd74-71f9-4bdf-b50e-67c2436f3408", - "prevId": "49a1ac05-78ab-4aae-908e-d4aeeb8196fc", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0041_snapshot.json b/packages/console/core/migrations/meta/0041_snapshot.json deleted file mode 100644 index 583b55925b30..000000000000 --- a/packages/console/core/migrations/meta/0041_snapshot.json +++ /dev/null @@ -1,1095 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "9cf10c24-6029-4cb4-866e-ff9b501eaf7e", - "prevId": "bf19cd74-71f9-4bdf-b50e-67c2436f3408", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0042_snapshot.json b/packages/console/core/migrations/meta/0042_snapshot.json deleted file mode 100644 index e0f731e39756..000000000000 --- a/packages/console/core/migrations/meta/0042_snapshot.json +++ /dev/null @@ -1,1144 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "4775571c-ad9c-4104-a202-2374b1963cfe", - "prevId": "9cf10c24-6029-4cb4-866e-ff9b501eaf7e", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscribed": { - "name": "time_subscribed", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_recent_usage": { - "name": "sub_recent_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_monthly_usage": { - "name": "sub_monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_recent_usage_updated": { - "name": "sub_time_recent_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_monthly_usage_updated": { - "name": "sub_time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0043_snapshot.json b/packages/console/core/migrations/meta/0043_snapshot.json deleted file mode 100644 index ef9caa74e6b0..000000000000 --- a/packages/console/core/migrations/meta/0043_snapshot.json +++ /dev/null @@ -1,1147 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "3ff862f3-eeb6-4b10-8c78-254de3778ab3", - "prevId": "4775571c-ad9c-4104-a202-2374b1963cfe", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscribed": { - "name": "time_subscribed", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_interval_usage": { - "name": "sub_interval_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_monthly_usage": { - "name": "sub_monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_interval_usage_updated": { - "name": "sub_time_interval_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_monthly_usage_updated": { - "name": "sub_time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": { - "\"user\".\"sub_recent_usage\"": "\"user\".\"sub_interval_usage\"", - "\"user\".\"sub_time_recent_usage_updated\"": "\"user\".\"sub_time_interval_usage_updated\"" - } - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0044_snapshot.json b/packages/console/core/migrations/meta/0044_snapshot.json deleted file mode 100644 index cde7fabf228d..000000000000 --- a/packages/console/core/migrations/meta/0044_snapshot.json +++ /dev/null @@ -1,1146 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "70394850-2c28-4012-a3d5-69357e3348b6", - "prevId": "3ff862f3-eeb6-4b10-8c78-254de3778ab3", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscribed": { - "name": "time_subscribed", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_interval_usage": { - "name": "sub_interval_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_monthly_usage": { - "name": "sub_monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_interval_usage_updated": { - "name": "sub_time_interval_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_monthly_usage_updated": { - "name": "sub_time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": { - "\"usage\".\"data\"": "\"usage\".\"enrichment\"" - } - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0045_snapshot.json b/packages/console/core/migrations/meta/0045_snapshot.json deleted file mode 100644 index 6ab9760c6808..000000000000 --- a/packages/console/core/migrations/meta/0045_snapshot.json +++ /dev/null @@ -1,1149 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "27c1a3eb-b125-46d4-b436-abe5764fe4b7", - "prevId": "70394850-2c28-4012-a3d5-69357e3348b6", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscribed": { - "name": "time_subscribed", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_interval_usage": { - "name": "sub_interval_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_monthly_usage": { - "name": "sub_monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_interval_usage_updated": { - "name": "sub_time_interval_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_monthly_usage_updated": { - "name": "sub_time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0046_snapshot.json b/packages/console/core/migrations/meta/0046_snapshot.json deleted file mode 100644 index 46ff73e263a6..000000000000 --- a/packages/console/core/migrations/meta/0046_snapshot.json +++ /dev/null @@ -1,1236 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "f3725f6d-5f33-4497-b4ba-cf05c46fb873", - "prevId": "27c1a3eb-b125-46d4-b436-abe5764fe4b7", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscribed": { - "name": "time_subscribed", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_interval_usage": { - "name": "sub_interval_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_monthly_usage": { - "name": "sub_monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_interval_usage_updated": { - "name": "sub_time_interval_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sub_time_monthly_usage_updated": { - "name": "sub_time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0047_snapshot.json b/packages/console/core/migrations/meta/0047_snapshot.json deleted file mode 100644 index f8002bd8bb6a..000000000000 --- a/packages/console/core/migrations/meta/0047_snapshot.json +++ /dev/null @@ -1,1207 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "fec4cb15-6f13-465d-a902-b76b026872f4", - "prevId": "f3725f6d-5f33-4497-b4ba-cf05c46fb873", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "workspace_user_id": { - "name": "workspace_user_id", - "columns": ["workspace_id", "user_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0048_snapshot.json b/packages/console/core/migrations/meta/0048_snapshot.json deleted file mode 100644 index e0593749b38a..000000000000 --- a/packages/console/core/migrations/meta/0048_snapshot.json +++ /dev/null @@ -1,1207 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "bb90bb3e-fd08-439a-b92f-5f433807480e", - "prevId": "fec4cb15-6f13-465d-a902-b76b026872f4", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "workspace_user_id": { - "name": "workspace_user_id", - "columns": ["workspace_id", "user_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0049_snapshot.json b/packages/console/core/migrations/meta/0049_snapshot.json deleted file mode 100644 index 58679382e526..000000000000 --- a/packages/console/core/migrations/meta/0049_snapshot.json +++ /dev/null @@ -1,1214 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "2fd0308b-0653-437d-aea3-29428a4de9f1", - "prevId": "bb90bb3e-fd08-439a-b92f-5f433807480e", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_coupon_id": { - "name": "subscription_coupon_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "workspace_user_id": { - "name": "workspace_user_id", - "columns": ["workspace_id", "user_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0050_snapshot.json b/packages/console/core/migrations/meta/0050_snapshot.json deleted file mode 100644 index 75289bc262d7..000000000000 --- a/packages/console/core/migrations/meta/0050_snapshot.json +++ /dev/null @@ -1,1221 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "a0d18802-c390-47d4-98f1-d1f83869cf0c", - "prevId": "2fd0308b-0653-437d-aea3-29428a4de9f1", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_coupon_id": { - "name": "subscription_coupon_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "workspace_user_id": { - "name": "workspace_user_id", - "columns": ["workspace_id", "user_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0051_snapshot.json b/packages/console/core/migrations/meta/0051_snapshot.json deleted file mode 100644 index 0f9047916230..000000000000 --- a/packages/console/core/migrations/meta/0051_snapshot.json +++ /dev/null @@ -1,1228 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "14cbf4c8-55f1-4488-956f-56fb5ccb3a5a", - "prevId": "a0d18802-c390-47d4-98f1-d1f83869cf0c", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_coupon_id": { - "name": "subscription_coupon_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscription_booked": { - "name": "time_subscription_booked", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "workspace_user_id": { - "name": "workspace_user_id", - "columns": ["workspace_id", "user_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0052_snapshot.json b/packages/console/core/migrations/meta/0052_snapshot.json deleted file mode 100644 index 339e153eba82..000000000000 --- a/packages/console/core/migrations/meta/0052_snapshot.json +++ /dev/null @@ -1,1235 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "00774acd-a1e5-49c0-b296-cacc9506a566", - "prevId": "14cbf4c8-55f1-4488-956f-56fb5ccb3a5a", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_coupon_id": { - "name": "subscription_coupon_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_plan": { - "name": "subscription_plan", - "type": "enum('20','100','200')", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscription_booked": { - "name": "time_subscription_booked", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "workspace_user_id": { - "name": "workspace_user_id", - "columns": ["workspace_id", "user_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0053_snapshot.json b/packages/console/core/migrations/meta/0053_snapshot.json deleted file mode 100644 index 75a2cb7c9297..000000000000 --- a/packages/console/core/migrations/meta/0053_snapshot.json +++ /dev/null @@ -1,1242 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "32a0c40b-a269-4ad1-a5a0-52b1f18932aa", - "prevId": "00774acd-a1e5-49c0-b296-cacc9506a566", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription": { - "name": "subscription", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_coupon_id": { - "name": "subscription_coupon_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_plan": { - "name": "subscription_plan", - "type": "enum('20','100','200')", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscription_booked": { - "name": "time_subscription_booked", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "workspace_user_id": { - "name": "workspace_user_id", - "columns": ["workspace_id", "user_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0054_snapshot.json b/packages/console/core/migrations/meta/0054_snapshot.json deleted file mode 100644 index a1e3851d8575..000000000000 --- a/packages/console/core/migrations/meta/0054_snapshot.json +++ /dev/null @@ -1,1235 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "a0ade64b-b735-4a70-8d39-ebd84bc9e924", - "prevId": "32a0c40b-a269-4ad1-a5a0-52b1f18932aa", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription": { - "name": "subscription", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_plan": { - "name": "subscription_plan", - "type": "enum('20','100','200')", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscription_booked": { - "name": "time_subscription_booked", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "workspace_user_id": { - "name": "workspace_user_id", - "columns": ["workspace_id", "user_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/0055_snapshot.json b/packages/console/core/migrations/meta/0055_snapshot.json deleted file mode 100644 index 82293d86663f..000000000000 --- a/packages/console/core/migrations/meta/0055_snapshot.json +++ /dev/null @@ -1,1242 +0,0 @@ -{ - "version": "5", - "dialect": "mysql", - "id": "e630f63c-04a8-4b59-bf56-03efcdd1b011", - "prevId": "a0ade64b-b735-4a70-8d39-ebd84bc9e924", - "tables": { - "account": { - "name": "account", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "account_id_pk": { - "name": "account_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "auth": { - "name": "auth", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "enum('email','github','google')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subject": { - "name": "subject", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "provider": { - "name": "provider", - "columns": ["provider", "subject"], - "isUnique": true - }, - "account_id": { - "name": "account_id", - "columns": ["account_id"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "auth_id_pk": { - "name": "auth_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "benchmark": { - "name": "benchmark", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent": { - "name": "agent", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "time_created": { - "name": "time_created", - "columns": ["time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "benchmark_id_pk": { - "name": "benchmark_id_pk", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "billing": { - "name": "billing", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_id": { - "name": "payment_method_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_type": { - "name": "payment_method_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_method_last4": { - "name": "payment_method_last4", - "type": "varchar(4)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "balance": { - "name": "balance", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload": { - "name": "reload", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_trigger": { - "name": "reload_trigger", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_amount": { - "name": "reload_amount", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reload_error": { - "name": "reload_error", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_error": { - "name": "time_reload_error", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_reload_locked_till": { - "name": "time_reload_locked_till", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription": { - "name": "subscription", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_id": { - "name": "subscription_id", - "type": "varchar(28)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "subscription_plan": { - "name": "subscription_plan", - "type": "enum('20','100','200')", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscription_booked": { - "name": "time_subscription_booked", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_subscription_selected": { - "name": "time_subscription_selected", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_customer_id": { - "name": "global_customer_id", - "columns": ["customer_id"], - "isUnique": true - }, - "global_subscription_id": { - "name": "global_subscription_id", - "columns": ["subscription_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "billing_workspace_id_id_pk": { - "name": "billing_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "payment": { - "name": "payment", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "customer_id": { - "name": "customer_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "invoice_id": { - "name": "invoice_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payment_id": { - "name": "payment_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_refunded": { - "name": "time_refunded", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "payment_workspace_id_id_pk": { - "name": "payment_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "subscription": { - "name": "subscription", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "rolling_usage": { - "name": "rolling_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "fixed_usage": { - "name": "fixed_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_rolling_updated": { - "name": "time_rolling_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_fixed_updated": { - "name": "time_fixed_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "workspace_user_id": { - "name": "workspace_user_id", - "columns": ["workspace_id", "user_id"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "subscription_workspace_id_id_pk": { - "name": "subscription_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "usage": { - "name": "usage", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "input_tokens": { - "name": "input_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "output_tokens": { - "name": "output_tokens", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reasoning_tokens": { - "name": "reasoning_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_read_tokens": { - "name": "cache_read_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_5m_tokens": { - "name": "cache_write_5m_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cache_write_1h_tokens": { - "name": "cache_write_1h_tokens", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "bigint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key_id": { - "name": "key_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "enrichment": { - "name": "enrichment", - "type": "json", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "usage_time_created": { - "name": "usage_time_created", - "columns": ["workspace_id", "time_created"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "usage_workspace_id_id_pk": { - "name": "usage_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip_rate_limit": { - "name": "ip_rate_limit", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "interval": { - "name": "interval", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "count": { - "name": "count", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_rate_limit_ip_interval_pk": { - "name": "ip_rate_limit_ip_interval_pk", - "columns": ["ip", "interval"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "ip": { - "name": "ip", - "columns": { - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "usage": { - "name": "usage", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "ip_ip_pk": { - "name": "ip_ip_pk", - "columns": ["ip"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "key": { - "name": "key", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_used": { - "name": "time_used", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "global_key": { - "name": "global_key", - "columns": ["key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "key_workspace_id_id_pk": { - "name": "key_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "model": { - "name": "model", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "model_workspace_model": { - "name": "model_workspace_model", - "columns": ["workspace_id", "model"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "model_workspace_id_id_pk": { - "name": "model_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "provider": { - "name": "provider", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "credentials": { - "name": "credentials", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "workspace_provider": { - "name": "workspace_provider", - "columns": ["workspace_id", "provider"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "provider_workspace_id_id_pk": { - "name": "provider_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "workspace_id": { - "name": "workspace_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "account_id": { - "name": "account_id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_seen": { - "name": "time_seen", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "color": { - "name": "color", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "enum('admin','member')", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "monthly_limit": { - "name": "monthly_limit", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "monthly_usage": { - "name": "monthly_usage", - "type": "bigint", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "time_monthly_usage_updated": { - "name": "time_monthly_usage_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "user_account_id": { - "name": "user_account_id", - "columns": ["workspace_id", "account_id"], - "isUnique": true - }, - "user_email": { - "name": "user_email", - "columns": ["workspace_id", "email"], - "isUnique": true - }, - "global_account_id": { - "name": "global_account_id", - "columns": ["account_id"], - "isUnique": false - }, - "global_email": { - "name": "global_email", - "columns": ["email"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "user_workspace_id_id_pk": { - "name": "user_workspace_id_id_pk", - "columns": ["workspace_id", "id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "workspace": { - "name": "workspace", - "columns": { - "id": { - "name": "id", - "type": "varchar(30)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "time_created": { - "name": "time_created", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "time_updated": { - "name": "time_updated", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" - }, - "time_deleted": { - "name": "time_deleted", - "type": "timestamp(3)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "slug": { - "name": "slug", - "columns": ["slug"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "workspace_id": { - "name": "workspace_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/console/core/migrations/meta/_journal.json b/packages/console/core/migrations/meta/_journal.json deleted file mode 100644 index f807eab66878..000000000000 --- a/packages/console/core/migrations/meta/_journal.json +++ /dev/null @@ -1,398 +0,0 @@ -{ - "version": "7", - "dialect": "mysql", - "entries": [ - { - "idx": 0, - "version": "5", - "when": 1756796050935, - "tag": "0000_fluffy_raza", - "breakpoints": true - }, - { - "idx": 1, - "version": "5", - "when": 1756871639102, - "tag": "0001_serious_whistler", - "breakpoints": true - }, - { - "idx": 2, - "version": "5", - "when": 1757597611832, - "tag": "0002_violet_loners", - "breakpoints": true - }, - { - "idx": 3, - "version": "5", - "when": 1757600397194, - "tag": "0003_dusty_clint_barton", - "breakpoints": true - }, - { - "idx": 4, - "version": "5", - "when": 1757627357232, - "tag": "0004_first_mockingbird", - "breakpoints": true - }, - { - "idx": 5, - "version": "5", - "when": 1757632304856, - "tag": "0005_jazzy_skrulls", - "breakpoints": true - }, - { - "idx": 6, - "version": "5", - "when": 1757643108507, - "tag": "0006_parallel_gauntlet", - "breakpoints": true - }, - { - "idx": 7, - "version": "5", - "when": 1757693869142, - "tag": "0007_familiar_nightshade", - "breakpoints": true - }, - { - "idx": 8, - "version": "5", - "when": 1757885904718, - "tag": "0008_eminent_ultimatum", - "breakpoints": true - }, - { - "idx": 9, - "version": "5", - "when": 1757888582598, - "tag": "0009_redundant_piledriver", - "breakpoints": true - }, - { - "idx": 10, - "version": "5", - "when": 1757892305788, - "tag": "0010_needy_sue_storm", - "breakpoints": true - }, - { - "idx": 11, - "version": "5", - "when": 1757948881012, - "tag": "0011_freezing_phil_sheldon", - "breakpoints": true - }, - { - "idx": 12, - "version": "5", - "when": 1757956814524, - "tag": "0012_bright_photon", - "breakpoints": true - }, - { - "idx": 13, - "version": "5", - "when": 1757956978089, - "tag": "0013_absurd_hobgoblin", - "breakpoints": true - }, - { - "idx": 14, - "version": "5", - "when": 1758289919722, - "tag": "0014_demonic_princess_powerful", - "breakpoints": true - }, - { - "idx": 15, - "version": "5", - "when": 1758428484500, - "tag": "0015_cloudy_revanche", - "breakpoints": true - }, - { - "idx": 16, - "version": "5", - "when": 1758663086739, - "tag": "0016_cold_la_nuit", - "breakpoints": true - }, - { - "idx": 17, - "version": "5", - "when": 1758755183232, - "tag": "0017_woozy_thaddeus_ross", - "breakpoints": true - }, - { - "idx": 18, - "version": "5", - "when": 1759077265040, - "tag": "0018_nervous_iron_lad", - "breakpoints": true - }, - { - "idx": 19, - "version": "5", - "when": 1759103696975, - "tag": "0019_dazzling_cable", - "breakpoints": true - }, - { - "idx": 20, - "version": "5", - "when": 1759169697658, - "tag": "0020_supreme_jack_power", - "breakpoints": true - }, - { - "idx": 21, - "version": "5", - "when": 1759186023755, - "tag": "0021_flawless_clea", - "breakpoints": true - }, - { - "idx": 22, - "version": "5", - "when": 1759427432588, - "tag": "0022_nice_dreadnoughts", - "breakpoints": true - }, - { - "idx": 23, - "version": "5", - "when": 1759444220653, - "tag": "0023_optimal_paibok", - "breakpoints": true - }, - { - "idx": 24, - "version": "5", - "when": 1759522925614, - "tag": "0024_early_black_crow", - "breakpoints": true - }, - { - "idx": 25, - "version": "5", - "when": 1759525451885, - "tag": "0025_legal_joseph", - "breakpoints": true - }, - { - "idx": 26, - "version": "5", - "when": 1759546980316, - "tag": "0026_numerous_prodigy", - "breakpoints": true - }, - { - "idx": 27, - "version": "5", - "when": 1759553466608, - "tag": "0027_hot_wong", - "breakpoints": true - }, - { - "idx": 28, - "version": "5", - "when": 1759805025276, - "tag": "0028_careful_cerise", - "breakpoints": true - }, - { - "idx": 29, - "version": "5", - "when": 1759811835558, - "tag": "0029_panoramic_harrier", - "breakpoints": true - }, - { - "idx": 30, - "version": "5", - "when": 1759878278492, - "tag": "0030_ordinary_ultragirl", - "breakpoints": true - }, - { - "idx": 31, - "version": "5", - "when": 1759940238478, - "tag": "0031_outgoing_outlaw_kid", - "breakpoints": true - }, - { - "idx": 32, - "version": "5", - "when": 1759976329502, - "tag": "0032_white_doctor_doom", - "breakpoints": true - }, - { - "idx": 33, - "version": "5", - "when": 1760637384217, - "tag": "0033_cynical_jack_flag", - "breakpoints": true - }, - { - "idx": 34, - "version": "5", - "when": 1760651120251, - "tag": "0034_short_bulldozer", - "breakpoints": true - }, - { - "idx": 35, - "version": "5", - "when": 1760666253896, - "tag": "0035_narrow_blindfold", - "breakpoints": true - }, - { - "idx": 36, - "version": "5", - "when": 1760668952329, - "tag": "0036_slimy_energizer", - "breakpoints": true - }, - { - "idx": 37, - "version": "5", - "when": 1761928273807, - "tag": "0037_messy_jackal", - "breakpoints": true - }, - { - "idx": 38, - "version": "5", - "when": 1764110043942, - "tag": "0038_famous_magik", - "breakpoints": true - }, - { - "idx": 39, - "version": "5", - "when": 1766946179892, - "tag": "0039_striped_forge", - "breakpoints": true - }, - { - "idx": 40, - "version": "5", - "when": 1767584617316, - "tag": "0040_broken_gamora", - "breakpoints": true - }, - { - "idx": 41, - "version": "5", - "when": 1767732559197, - "tag": "0041_odd_misty_knight", - "breakpoints": true - }, - { - "idx": 42, - "version": "5", - "when": 1767744077346, - "tag": "0042_flat_nightmare", - "breakpoints": true - }, - { - "idx": 43, - "version": "5", - "when": 1767752636118, - "tag": "0043_lame_calypso", - "breakpoints": true - }, - { - "idx": 44, - "version": "5", - "when": 1767759322451, - "tag": "0044_tiny_captain_midlands", - "breakpoints": true - }, - { - "idx": 45, - "version": "5", - "when": 1767765497502, - "tag": "0045_cuddly_diamondback", - "breakpoints": true - }, - { - "idx": 46, - "version": "5", - "when": 1767912262458, - "tag": "0046_charming_black_bolt", - "breakpoints": true - }, - { - "idx": 47, - "version": "5", - "when": 1767916965243, - "tag": "0047_huge_omega_red", - "breakpoints": true - }, - { - "idx": 48, - "version": "5", - "when": 1767917785224, - "tag": "0048_mean_frank_castle", - "breakpoints": true - }, - { - "idx": 49, - "version": "5", - "when": 1767922954153, - "tag": "0049_noisy_domino", - "breakpoints": true - }, - { - "idx": 50, - "version": "5", - "when": 1767931290031, - "tag": "0050_bumpy_mephistopheles", - "breakpoints": true - }, - { - "idx": 51, - "version": "5", - "when": 1768341152722, - "tag": "0051_jazzy_green_goblin", - "breakpoints": true - }, - { - "idx": 52, - "version": "5", - "when": 1768343920467, - "tag": "0052_aromatic_agent_zero", - "breakpoints": true - }, - { - "idx": 53, - "version": "5", - "when": 1768599366758, - "tag": "0053_gigantic_hardball", - "breakpoints": true - }, - { - "idx": 54, - "version": "5", - "when": 1768603665356, - "tag": "0054_numerous_annihilus", - "breakpoints": true - }, - { - "idx": 55, - "version": "5", - "when": 1769108945841, - "tag": "0055_moaning_karnak", - "breakpoints": true - } - ] -} diff --git a/packages/console/core/package.json b/packages/console/core/package.json index a99f1ec32329..aac79d669009 100644 --- a/packages/console/core/package.json +++ b/packages/console/core/package.json @@ -37,6 +37,9 @@ "update-black": "script/update-black.ts", "promote-black-to-dev": "script/promote-black.ts dev", "promote-black-to-prod": "script/promote-black.ts production", + "update-lite": "script/update-lite.ts", + "promote-lite-to-dev": "script/promote-lite.ts dev", + "promote-lite-to-prod": "script/promote-lite.ts production", "typecheck": "tsgo --noEmit" }, "devDependencies": { diff --git a/packages/console/core/script/promote-lite.ts b/packages/console/core/script/promote-lite.ts new file mode 100755 index 000000000000..8fd58c8059be --- /dev/null +++ b/packages/console/core/script/promote-lite.ts @@ -0,0 +1,22 @@ +#!/usr/bin/env bun + +import { $ } from "bun" +import path from "path" +import { LiteData } from "../src/lite" + +const stage = process.argv[2] +if (!stage) throw new Error("Stage is required") + +const root = path.resolve(process.cwd(), "..", "..", "..") + +// read the secret +const ret = await $`bun sst secret list`.cwd(root).text() +const lines = ret.split("\n") +const value = lines.find((line) => line.startsWith("ZEN_LITE_LIMITS"))?.split("=")[1] +if (!value) throw new Error("ZEN_LITE_LIMITS not found") + +// validate value +LiteData.validate(JSON.parse(value)) + +// update the secret +await $`bun sst secret set ZEN_LITE_LIMITS ${value} --stage ${stage}` diff --git a/packages/console/core/script/update-lite.ts b/packages/console/core/script/update-lite.ts new file mode 100755 index 000000000000..2f3e66835725 --- /dev/null +++ b/packages/console/core/script/update-lite.ts @@ -0,0 +1,28 @@ +#!/usr/bin/env bun + +import { $ } from "bun" +import path from "path" +import os from "os" +import { LiteData } from "../src/lite" + +const root = path.resolve(process.cwd(), "..", "..", "..") +const secrets = await $`bun sst secret list`.cwd(root).text() + +// read value +const lines = secrets.split("\n") +const oldValue = lines.find((line) => line.startsWith("ZEN_LITE_LIMITS"))?.split("=")[1] ?? "{}" +if (!oldValue) throw new Error("ZEN_LITE_LIMITS not found") + +// store the prettified json to a temp file +const filename = `lite-${Date.now()}.json` +const tempFile = Bun.file(path.join(os.tmpdir(), filename)) +await tempFile.write(JSON.stringify(JSON.parse(oldValue), null, 2)) +console.log("tempFile", tempFile.name) + +// open temp file in vim and read the file on close +await $`vim ${tempFile.name}` +const newValue = JSON.stringify(JSON.parse(await tempFile.text())) +LiteData.validate(JSON.parse(newValue)) + +// update the secret +await $`bun sst secret set ZEN_LITE_LIMITS ${newValue}` diff --git a/packages/console/core/src/black.ts b/packages/console/core/src/black.ts index 5f8db62738db..b4cc27064630 100644 --- a/packages/console/core/src/black.ts +++ b/packages/console/core/src/black.ts @@ -1,8 +1,6 @@ import { z } from "zod" import { fn } from "./util/fn" import { Resource } from "@opencode-ai/console-resource" -import { centsToMicroCents } from "./util/price" -import { getWeekBounds } from "./util/date" import { SubscriptionPlan } from "./schema/billing.sql" export namespace BlackData { @@ -60,75 +58,3 @@ export namespace BlackData { }, ) } - -export namespace Black { - export const analyzeRollingUsage = fn( - z.object({ - plan: z.enum(SubscriptionPlan), - usage: z.number().int(), - timeUpdated: z.date(), - }), - ({ plan, usage, timeUpdated }) => { - const now = new Date() - const black = BlackData.getLimits({ plan }) - const rollingWindowMs = black.rollingWindow * 3600 * 1000 - const rollingLimitInMicroCents = centsToMicroCents(black.rollingLimit * 100) - const windowStart = new Date(now.getTime() - rollingWindowMs) - if (timeUpdated < windowStart) { - return { - status: "ok" as const, - resetInSec: black.rollingWindow * 3600, - usagePercent: 0, - } - } - - const windowEnd = new Date(timeUpdated.getTime() + rollingWindowMs) - if (usage < rollingLimitInMicroCents) { - return { - status: "ok" as const, - resetInSec: Math.ceil((windowEnd.getTime() - now.getTime()) / 1000), - usagePercent: Math.ceil(Math.min(100, (usage / rollingLimitInMicroCents) * 100)), - } - } - return { - status: "rate-limited" as const, - resetInSec: Math.ceil((windowEnd.getTime() - now.getTime()) / 1000), - usagePercent: 100, - } - }, - ) - - export const analyzeWeeklyUsage = fn( - z.object({ - plan: z.enum(SubscriptionPlan), - usage: z.number().int(), - timeUpdated: z.date(), - }), - ({ plan, usage, timeUpdated }) => { - const black = BlackData.getLimits({ plan }) - const now = new Date() - const week = getWeekBounds(now) - const fixedLimitInMicroCents = centsToMicroCents(black.fixedLimit * 100) - if (timeUpdated < week.start) { - return { - status: "ok" as const, - resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), - usagePercent: 0, - } - } - if (usage < fixedLimitInMicroCents) { - return { - status: "ok" as const, - resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), - usagePercent: Math.ceil(Math.min(100, (usage / fixedLimitInMicroCents) * 100)), - } - } - - return { - status: "rate-limited" as const, - resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), - usagePercent: 100, - } - }, - ) -} diff --git a/packages/console/core/src/lite.ts b/packages/console/core/src/lite.ts new file mode 100644 index 000000000000..d6679208d856 --- /dev/null +++ b/packages/console/core/src/lite.ts @@ -0,0 +1,28 @@ +import { z } from "zod" +import { fn } from "./util/fn" +import { Resource } from "@opencode-ai/console-resource" + +export namespace LiteData { + const Schema = z.object({ + fixedLimit: z.number().int(), + rollingLimit: z.number().int(), + rollingWindow: z.number().int(), + }) + + export const validate = fn(Schema, (input) => { + return input + }) + + export const getLimits = fn(z.void(), () => { + const json = JSON.parse(Resource.ZEN_LITE_LIMITS.value) + return Schema.parse(json) + }) + + export const planToPriceID = fn(z.void(), () => { + return Resource.ZEN_LITE_PRICE.price + }) + + export const priceIDToPlan = fn(z.void(), () => { + return "lite" + }) +} diff --git a/packages/console/core/src/schema/billing.sql.ts b/packages/console/core/src/schema/billing.sql.ts index ba8f89280682..6d96fc7eb897 100644 --- a/packages/console/core/src/schema/billing.sql.ts +++ b/packages/console/core/src/schema/billing.sql.ts @@ -67,7 +67,7 @@ export const PaymentTable = mysqlTable( timeRefunded: utc("time_refunded"), enrichment: json("enrichment").$type< | { - type: "subscription" + type: "subscription" | "lite" couponID?: string } | { @@ -93,8 +93,9 @@ export const UsageTable = mysqlTable( cacheWrite1hTokens: int("cache_write_1h_tokens"), cost: bigint("cost", { mode: "number" }).notNull(), keyID: ulid("key_id"), + sessionID: varchar("session_id", { length: 30 }), enrichment: json("enrichment").$type<{ - plan: "sub" + plan: "sub" | "byok" | "lite" }>(), }, (table) => [...workspaceIndexes(table), index("usage_time_created").on(table.workspaceID, table.timeCreated)], diff --git a/packages/console/core/src/subscription.ts b/packages/console/core/src/subscription.ts new file mode 100644 index 000000000000..ca3b17042242 --- /dev/null +++ b/packages/console/core/src/subscription.ts @@ -0,0 +1,75 @@ +import { z } from "zod" +import { fn } from "./util/fn" +import { centsToMicroCents } from "./util/price" +import { getWeekBounds } from "./util/date" + +export namespace Subscription { + export const analyzeRollingUsage = fn( + z.object({ + limit: z.number().int(), + window: z.number().int(), + usage: z.number().int(), + timeUpdated: z.date(), + }), + ({ limit, window, usage, timeUpdated }) => { + const now = new Date() + const rollingWindowMs = window * 3600 * 1000 + const rollingLimitInMicroCents = centsToMicroCents(limit * 100) + const windowStart = new Date(now.getTime() - rollingWindowMs) + if (timeUpdated < windowStart) { + return { + status: "ok" as const, + resetInSec: window * 3600, + usagePercent: 0, + } + } + + const windowEnd = new Date(timeUpdated.getTime() + rollingWindowMs) + if (usage < rollingLimitInMicroCents) { + return { + status: "ok" as const, + resetInSec: Math.ceil((windowEnd.getTime() - now.getTime()) / 1000), + usagePercent: Math.ceil(Math.min(100, (usage / rollingLimitInMicroCents) * 100)), + } + } + return { + status: "rate-limited" as const, + resetInSec: Math.ceil((windowEnd.getTime() - now.getTime()) / 1000), + usagePercent: 100, + } + }, + ) + + export const analyzeWeeklyUsage = fn( + z.object({ + limit: z.number().int(), + usage: z.number().int(), + timeUpdated: z.date(), + }), + ({ limit, usage, timeUpdated }) => { + const now = new Date() + const week = getWeekBounds(now) + const fixedLimitInMicroCents = centsToMicroCents(limit * 100) + if (timeUpdated < week.start) { + return { + status: "ok" as const, + resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), + usagePercent: 0, + } + } + if (usage < fixedLimitInMicroCents) { + return { + status: "ok" as const, + resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), + usagePercent: Math.ceil(Math.min(100, (usage / fixedLimitInMicroCents) * 100)), + } + } + + return { + status: "rate-limited" as const, + resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), + usagePercent: 100, + } + }, + ) +} diff --git a/packages/console/core/sst-env.d.ts b/packages/console/core/sst-env.d.ts index 73f83d16762e..edff904e0151 100644 --- a/packages/console/core/sst-env.d.ts +++ b/packages/console/core/sst-env.d.ts @@ -130,6 +130,15 @@ declare module "sst" { "product": string "type": "sst.sst.Linkable" } + "ZEN_LITE_LIMITS": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_LITE_PRICE": { + "price": string + "product": string + "type": "sst.sst.Linkable" + } "ZEN_MODELS1": { "type": "sst.sst.Secret" "value": string diff --git a/packages/console/function/sst-env.d.ts b/packages/console/function/sst-env.d.ts index 73f83d16762e..edff904e0151 100644 --- a/packages/console/function/sst-env.d.ts +++ b/packages/console/function/sst-env.d.ts @@ -130,6 +130,15 @@ declare module "sst" { "product": string "type": "sst.sst.Linkable" } + "ZEN_LITE_LIMITS": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_LITE_PRICE": { + "price": string + "product": string + "type": "sst.sst.Linkable" + } "ZEN_MODELS1": { "type": "sst.sst.Secret" "value": string diff --git a/packages/console/resource/sst-env.d.ts b/packages/console/resource/sst-env.d.ts index 73f83d16762e..edff904e0151 100644 --- a/packages/console/resource/sst-env.d.ts +++ b/packages/console/resource/sst-env.d.ts @@ -130,6 +130,15 @@ declare module "sst" { "product": string "type": "sst.sst.Linkable" } + "ZEN_LITE_LIMITS": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_LITE_PRICE": { + "price": string + "product": string + "type": "sst.sst.Linkable" + } "ZEN_MODELS1": { "type": "sst.sst.Secret" "value": string diff --git a/packages/enterprise/sst-env.d.ts b/packages/enterprise/sst-env.d.ts index 73f83d16762e..edff904e0151 100644 --- a/packages/enterprise/sst-env.d.ts +++ b/packages/enterprise/sst-env.d.ts @@ -130,6 +130,15 @@ declare module "sst" { "product": string "type": "sst.sst.Linkable" } + "ZEN_LITE_LIMITS": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_LITE_PRICE": { + "price": string + "product": string + "type": "sst.sst.Linkable" + } "ZEN_MODELS1": { "type": "sst.sst.Secret" "value": string diff --git a/packages/function/sst-env.d.ts b/packages/function/sst-env.d.ts index 73f83d16762e..edff904e0151 100644 --- a/packages/function/sst-env.d.ts +++ b/packages/function/sst-env.d.ts @@ -130,6 +130,15 @@ declare module "sst" { "product": string "type": "sst.sst.Linkable" } + "ZEN_LITE_LIMITS": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_LITE_PRICE": { + "price": string + "product": string + "type": "sst.sst.Linkable" + } "ZEN_MODELS1": { "type": "sst.sst.Secret" "value": string diff --git a/sst-env.d.ts b/sst-env.d.ts index 6b3ec54dee40..fb7a7dc42076 100644 --- a/sst-env.d.ts +++ b/sst-env.d.ts @@ -156,6 +156,15 @@ declare module "sst" { "product": string "type": "sst.sst.Linkable" } + "ZEN_LITE_LIMITS": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_LITE_PRICE": { + "price": string + "product": string + "type": "sst.sst.Linkable" + } "ZEN_MODELS1": { "type": "sst.sst.Secret" "value": string From 5596775c35fbf92b7e83729deed4ec8e286ab3ab Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 22 Feb 2026 18:48:49 -0500 Subject: [PATCH 13/95] zen: display session in usage --- packages/console/app/src/i18n/ar.ts | 1 + packages/console/app/src/i18n/br.ts | 1 + packages/console/app/src/i18n/da.ts | 1 + packages/console/app/src/i18n/de.ts | 1 + packages/console/app/src/i18n/en.ts | 1 + packages/console/app/src/i18n/es.ts | 1 + packages/console/app/src/i18n/fr.ts | 1 + packages/console/app/src/i18n/it.ts | 1 + packages/console/app/src/i18n/ja.ts | 1 + packages/console/app/src/i18n/ko.ts | 1 + packages/console/app/src/i18n/no.ts | 1 + packages/console/app/src/i18n/pl.ts | 1 + packages/console/app/src/i18n/ru.ts | 1 + packages/console/app/src/i18n/th.ts | 1 + packages/console/app/src/i18n/tr.ts | 1 + packages/console/app/src/i18n/zh.ts | 1 + packages/console/app/src/i18n/zht.ts | 1 + .../console/app/src/routes/workspace/[id]/usage-section.tsx | 2 ++ 18 files changed, 19 insertions(+) diff --git a/packages/console/app/src/i18n/ar.ts b/packages/console/app/src/i18n/ar.ts index bf22ec157fc8..105546f6370d 100644 --- a/packages/console/app/src/i18n/ar.ts +++ b/packages/console/app/src/i18n/ar.ts @@ -337,6 +337,7 @@ export const dict = { "workspace.usage.table.input": "الدخل", "workspace.usage.table.output": "الخرج", "workspace.usage.table.cost": "التكلفة", + "workspace.usage.table.session": "الجلسة", "workspace.usage.breakdown.input": "الدخل", "workspace.usage.breakdown.cacheRead": "قراءة الكاش", "workspace.usage.breakdown.cacheWrite": "كتابة الكاش", diff --git a/packages/console/app/src/i18n/br.ts b/packages/console/app/src/i18n/br.ts index 0f39484eff48..8f94a1f6b814 100644 --- a/packages/console/app/src/i18n/br.ts +++ b/packages/console/app/src/i18n/br.ts @@ -342,6 +342,7 @@ export const dict = { "workspace.usage.table.input": "Entrada", "workspace.usage.table.output": "Saída", "workspace.usage.table.cost": "Custo", + "workspace.usage.table.session": "Sessão", "workspace.usage.breakdown.input": "Entrada", "workspace.usage.breakdown.cacheRead": "Leitura de Cache", "workspace.usage.breakdown.cacheWrite": "Escrita em Cache", diff --git a/packages/console/app/src/i18n/da.ts b/packages/console/app/src/i18n/da.ts index 39f8cfb52522..cd887bf27b99 100644 --- a/packages/console/app/src/i18n/da.ts +++ b/packages/console/app/src/i18n/da.ts @@ -340,6 +340,7 @@ export const dict = { "workspace.usage.table.input": "Input", "workspace.usage.table.output": "Output", "workspace.usage.table.cost": "Omkostning", + "workspace.usage.table.session": "Session", "workspace.usage.breakdown.input": "Input", "workspace.usage.breakdown.cacheRead": "Cache læst", "workspace.usage.breakdown.cacheWrite": "Cache skriv", diff --git a/packages/console/app/src/i18n/de.ts b/packages/console/app/src/i18n/de.ts index 733f38ca5fc1..bd711cd023bc 100644 --- a/packages/console/app/src/i18n/de.ts +++ b/packages/console/app/src/i18n/de.ts @@ -342,6 +342,7 @@ export const dict = { "workspace.usage.table.input": "Input", "workspace.usage.table.output": "Output", "workspace.usage.table.cost": "Kosten", + "workspace.usage.table.session": "Sitzung", "workspace.usage.breakdown.input": "Input", "workspace.usage.breakdown.cacheRead": "Cache Read", "workspace.usage.breakdown.cacheWrite": "Cache Write", diff --git a/packages/console/app/src/i18n/en.ts b/packages/console/app/src/i18n/en.ts index 08c716aba3bd..55551de64552 100644 --- a/packages/console/app/src/i18n/en.ts +++ b/packages/console/app/src/i18n/en.ts @@ -334,6 +334,7 @@ export const dict = { "workspace.usage.table.input": "Input", "workspace.usage.table.output": "Output", "workspace.usage.table.cost": "Cost", + "workspace.usage.table.session": "Session", "workspace.usage.breakdown.input": "Input", "workspace.usage.breakdown.cacheRead": "Cache Read", "workspace.usage.breakdown.cacheWrite": "Cache Write", diff --git a/packages/console/app/src/i18n/es.ts b/packages/console/app/src/i18n/es.ts index 1a18a872ebf6..aafe8aa00c17 100644 --- a/packages/console/app/src/i18n/es.ts +++ b/packages/console/app/src/i18n/es.ts @@ -343,6 +343,7 @@ export const dict = { "workspace.usage.table.input": "Entrada", "workspace.usage.table.output": "Salida", "workspace.usage.table.cost": "Costo", + "workspace.usage.table.session": "Sesión", "workspace.usage.breakdown.input": "Entrada", "workspace.usage.breakdown.cacheRead": "Lectura de Caché", "workspace.usage.breakdown.cacheWrite": "Escritura de Caché", diff --git a/packages/console/app/src/i18n/fr.ts b/packages/console/app/src/i18n/fr.ts index 8974927a9677..a915fde3b293 100644 --- a/packages/console/app/src/i18n/fr.ts +++ b/packages/console/app/src/i18n/fr.ts @@ -348,6 +348,7 @@ export const dict = { "workspace.usage.table.input": "Entrée", "workspace.usage.table.output": "Sortie", "workspace.usage.table.cost": "Coût", + "workspace.usage.table.session": "Session", "workspace.usage.breakdown.input": "Entrée", "workspace.usage.breakdown.cacheRead": "Lecture cache", "workspace.usage.breakdown.cacheWrite": "Écriture cache", diff --git a/packages/console/app/src/i18n/it.ts b/packages/console/app/src/i18n/it.ts index ce464f0009a4..4ffc728c861c 100644 --- a/packages/console/app/src/i18n/it.ts +++ b/packages/console/app/src/i18n/it.ts @@ -342,6 +342,7 @@ export const dict = { "workspace.usage.table.input": "Input", "workspace.usage.table.output": "Output", "workspace.usage.table.cost": "Costo", + "workspace.usage.table.session": "Sessione", "workspace.usage.breakdown.input": "Input", "workspace.usage.breakdown.cacheRead": "Lettura Cache", "workspace.usage.breakdown.cacheWrite": "Scrittura Cache", diff --git a/packages/console/app/src/i18n/ja.ts b/packages/console/app/src/i18n/ja.ts index 4dea6ccf4fe9..8ecc5d58b7f8 100644 --- a/packages/console/app/src/i18n/ja.ts +++ b/packages/console/app/src/i18n/ja.ts @@ -339,6 +339,7 @@ export const dict = { "workspace.usage.table.input": "入力", "workspace.usage.table.output": "出力", "workspace.usage.table.cost": "コスト", + "workspace.usage.table.session": "セッション", "workspace.usage.breakdown.input": "入力", "workspace.usage.breakdown.cacheRead": "キャッシュ読み取り", "workspace.usage.breakdown.cacheWrite": "キャッシュ書き込み", diff --git a/packages/console/app/src/i18n/ko.ts b/packages/console/app/src/i18n/ko.ts index 984dbbe67b03..9692ef47a30c 100644 --- a/packages/console/app/src/i18n/ko.ts +++ b/packages/console/app/src/i18n/ko.ts @@ -336,6 +336,7 @@ export const dict = { "workspace.usage.table.input": "입력", "workspace.usage.table.output": "출력", "workspace.usage.table.cost": "비용", + "workspace.usage.table.session": "세션", "workspace.usage.breakdown.input": "입력", "workspace.usage.breakdown.cacheRead": "캐시 읽기", "workspace.usage.breakdown.cacheWrite": "캐시 쓰기", diff --git a/packages/console/app/src/i18n/no.ts b/packages/console/app/src/i18n/no.ts index 1f9b1b2464f8..c1729b83c0ae 100644 --- a/packages/console/app/src/i18n/no.ts +++ b/packages/console/app/src/i18n/no.ts @@ -340,6 +340,7 @@ export const dict = { "workspace.usage.table.input": "Input", "workspace.usage.table.output": "Output", "workspace.usage.table.cost": "Kostnad", + "workspace.usage.table.session": "Økt", "workspace.usage.breakdown.input": "Input", "workspace.usage.breakdown.cacheRead": "Cache Lest", "workspace.usage.breakdown.cacheWrite": "Cache Skrevet", diff --git a/packages/console/app/src/i18n/pl.ts b/packages/console/app/src/i18n/pl.ts index f35300710cf5..0bcc7e735dae 100644 --- a/packages/console/app/src/i18n/pl.ts +++ b/packages/console/app/src/i18n/pl.ts @@ -341,6 +341,7 @@ export const dict = { "workspace.usage.table.input": "Wejście", "workspace.usage.table.output": "Wyjście", "workspace.usage.table.cost": "Koszt", + "workspace.usage.table.session": "Sesja", "workspace.usage.breakdown.input": "Wejście", "workspace.usage.breakdown.cacheRead": "Odczyt Cache", "workspace.usage.breakdown.cacheWrite": "Zapis Cache", diff --git a/packages/console/app/src/i18n/ru.ts b/packages/console/app/src/i18n/ru.ts index 27a30cc815e3..489125a58334 100644 --- a/packages/console/app/src/i18n/ru.ts +++ b/packages/console/app/src/i18n/ru.ts @@ -346,6 +346,7 @@ export const dict = { "workspace.usage.table.input": "Вход", "workspace.usage.table.output": "Выход", "workspace.usage.table.cost": "Стоимость", + "workspace.usage.table.session": "Сессия", "workspace.usage.breakdown.input": "Вход", "workspace.usage.breakdown.cacheRead": "Чтение кэша", "workspace.usage.breakdown.cacheWrite": "Запись кэша", diff --git a/packages/console/app/src/i18n/th.ts b/packages/console/app/src/i18n/th.ts index d94be479c9f5..cbd534c96f97 100644 --- a/packages/console/app/src/i18n/th.ts +++ b/packages/console/app/src/i18n/th.ts @@ -339,6 +339,7 @@ export const dict = { "workspace.usage.table.input": "Input", "workspace.usage.table.output": "Output", "workspace.usage.table.cost": "ค่าใช้จ่าย", + "workspace.usage.table.session": "เซสชัน", "workspace.usage.breakdown.input": "Input", "workspace.usage.breakdown.cacheRead": "Cache Read", "workspace.usage.breakdown.cacheWrite": "Cache Write", diff --git a/packages/console/app/src/i18n/tr.ts b/packages/console/app/src/i18n/tr.ts index e2f747704e7f..4a333ccda8ac 100644 --- a/packages/console/app/src/i18n/tr.ts +++ b/packages/console/app/src/i18n/tr.ts @@ -342,6 +342,7 @@ export const dict = { "workspace.usage.table.input": "Giriş", "workspace.usage.table.output": "Çıkış", "workspace.usage.table.cost": "Maliyet", + "workspace.usage.table.session": "Oturum", "workspace.usage.breakdown.input": "Giriş", "workspace.usage.breakdown.cacheRead": "Önbellek Okuması", "workspace.usage.breakdown.cacheWrite": "Önbellek Yazma", diff --git a/packages/console/app/src/i18n/zh.ts b/packages/console/app/src/i18n/zh.ts index c31b9ea66100..4628b9977331 100644 --- a/packages/console/app/src/i18n/zh.ts +++ b/packages/console/app/src/i18n/zh.ts @@ -327,6 +327,7 @@ export const dict = { "workspace.usage.table.input": "输入", "workspace.usage.table.output": "输出", "workspace.usage.table.cost": "成本", + "workspace.usage.table.session": "会话", "workspace.usage.breakdown.input": "输入", "workspace.usage.breakdown.cacheRead": "缓存读取", "workspace.usage.breakdown.cacheWrite": "缓存写入", diff --git a/packages/console/app/src/i18n/zht.ts b/packages/console/app/src/i18n/zht.ts index c7b411ca5b55..b7edf1b79269 100644 --- a/packages/console/app/src/i18n/zht.ts +++ b/packages/console/app/src/i18n/zht.ts @@ -327,6 +327,7 @@ export const dict = { "workspace.usage.table.input": "輸入", "workspace.usage.table.output": "輸出", "workspace.usage.table.cost": "成本", + "workspace.usage.table.session": "會話", "workspace.usage.breakdown.input": "輸入", "workspace.usage.breakdown.cacheRead": "快取讀取", "workspace.usage.breakdown.cacheWrite": "快取寫入", diff --git a/packages/console/app/src/routes/workspace/[id]/usage-section.tsx b/packages/console/app/src/routes/workspace/[id]/usage-section.tsx index 079a27c3ca79..7b030f4afb87 100644 --- a/packages/console/app/src/routes/workspace/[id]/usage-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/usage-section.tsx @@ -94,6 +94,7 @@ export function UsageSection() { {i18n.t("workspace.usage.table.input")} {i18n.t("workspace.usage.table.output")} {i18n.t("workspace.usage.table.cost")} + {i18n.t("workspace.usage.table.session")} @@ -183,6 +184,7 @@ export function UsageSection() { })} + {usage.sessionID?.slice(-8) ?? "-"} ) }} From a5a70fa05bd62060f433cf26e0885a19b0e1a72e Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 22 Feb 2026 22:20:00 -0500 Subject: [PATCH 14/95] wip: zen lite --- .../src/routes/workspace/[id]/billing/black-section.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx index c7ca496e6e43..5326306e288f 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx @@ -5,7 +5,8 @@ import { Billing } from "@opencode-ai/console-core/billing.js" import { Database, eq, and, isNull, sql } from "@opencode-ai/console-core/drizzle/index.js" import { BillingTable, SubscriptionTable } from "@opencode-ai/console-core/schema/billing.sql.js" import { Actor } from "@opencode-ai/console-core/actor.js" -import { Subscription } from "@opencode-ai/console-core/black.js" +import { Subscription } from "@opencode-ai/console-core/subscription.js" +import { BlackData } from "@opencode-ai/console-core/black.js" import { withActor } from "~/context/auth.withActor" import { queryBillingInfo } from "../../common" import styles from "./black-section.module.css" @@ -31,17 +32,19 @@ const querySubscription = query(async (workspaceID: string) => { .then((r) => r[0]), ) if (!row?.subscription) return null + const blackData = BlackData.getLimits({ plan: row.subscription.plan }) return { plan: row.subscription.plan, useBalance: row.subscription.useBalance ?? false, rollingUsage: Subscription.analyzeRollingUsage({ - plan: row.subscription.plan, + limit: blackData.rollingLimit, + window: blackData.rollingWindow, usage: row.rollingUsage ?? 0, timeUpdated: row.timeRollingUpdated ?? new Date(), }), weeklyUsage: Subscription.analyzeWeeklyUsage({ - plan: row.subscription.plan, + limit: blackData.fixedLimit, usage: row.fixedUsage ?? 0, timeUpdated: row.timeFixedUpdated ?? new Date(), }), From d3ecc5a0d911051d0131b3293dccabd3c2de6e66 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Mon, 23 Feb 2026 03:21:03 +0000 Subject: [PATCH 15/95] chore: generate --- .../20250902065410_fluffy_raza/snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../20250923213126_cold_la_nuit/snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../20251003210411_legal_joseph/snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../20251004045106_hot_wong/snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 35 +++------ .../snapshot.json | 40 +++-------- .../snapshot.json | 45 +++--------- .../snapshot.json | 45 +++--------- .../snapshot.json | 45 +++--------- .../snapshot.json | 45 +++--------- .../snapshot.json | 45 +++--------- .../snapshot.json | 53 ++++---------- .../20251031163113_messy_jackal/snapshot.json | 53 ++++---------- .../20251125223403_famous_magik/snapshot.json | 57 ++++----------- .../snapshot.json | 61 ++++------------ .../snapshot.json | 61 ++++------------ .../snapshot.json | 66 ++++------------- .../snapshot.json | 66 ++++------------- .../20260107022356_lame_calypso/snapshot.json | 66 ++++------------- .../snapshot.json | 66 ++++------------- .../snapshot.json | 66 ++++------------- .../snapshot.json | 71 +++++-------------- .../snapshot.json | 71 +++++-------------- .../snapshot.json | 71 +++++-------------- .../20260109014234_noisy_domino/snapshot.json | 71 +++++-------------- .../snapshot.json | 71 +++++-------------- .../snapshot.json | 71 +++++-------------- .../snapshot.json | 71 +++++-------------- .../snapshot.json | 71 +++++-------------- .../snapshot.json | 71 +++++-------------- .../snapshot.json | 71 +++++-------------- .../20260222233442_clever_toxin/snapshot.json | 71 +++++-------------- 57 files changed, 615 insertions(+), 2096 deletions(-) diff --git a/packages/console/core/migrations/20250902065410_fluffy_raza/snapshot.json b/packages/console/core/migrations/20250902065410_fluffy_raza/snapshot.json index d4f6ec58c3fd..6b26128c6658 100644 --- a/packages/console/core/migrations/20250902065410_fluffy_raza/snapshot.json +++ b/packages/console/core/migrations/20250902065410_fluffy_raza/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "aee779c5-db1d-4655-95ec-6451c18455be", - "prevIds": [ - "00000000-0000-0000-0000-000000000000" - ], + "prevIds": ["00000000-0000-0000-0000-000000000000"], "dialect": "mysql", "ddl": [ { @@ -877,28 +875,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -920,10 +909,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -949,10 +935,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -974,13 +957,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250903035359_serious_whistler/snapshot.json b/packages/console/core/migrations/20250903035359_serious_whistler/snapshot.json index 821fb38968a2..8e0af76b5bf8 100644 --- a/packages/console/core/migrations/20250903035359_serious_whistler/snapshot.json +++ b/packages/console/core/migrations/20250903035359_serious_whistler/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "79b7ee25-1c1c-41ff-9bbf-754af257102b", - "prevIds": [ - "aee779c5-db1d-4655-95ec-6451c18455be" - ], + "prevIds": ["aee779c5-db1d-4655-95ec-6451c18455be"], "dialect": "mysql", "ddl": [ { @@ -877,28 +875,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -920,10 +909,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -949,10 +935,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -974,13 +957,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250911133331_violet_loners/snapshot.json b/packages/console/core/migrations/20250911133331_violet_loners/snapshot.json index e7b65dfb4c65..27f5a5dbbdc0 100644 --- a/packages/console/core/migrations/20250911133331_violet_loners/snapshot.json +++ b/packages/console/core/migrations/20250911133331_violet_loners/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "9f51ef52-31ac-4ace-8b6d-39b35efe9c81", - "prevIds": [ - "79b7ee25-1c1c-41ff-9bbf-754af257102b" - ], + "prevIds": ["79b7ee25-1c1c-41ff-9bbf-754af257102b"], "dialect": "mysql", "ddl": [ { @@ -891,28 +889,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -934,10 +923,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -963,10 +949,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -988,13 +971,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250911141957_dusty_clint_barton/snapshot.json b/packages/console/core/migrations/20250911141957_dusty_clint_barton/snapshot.json index fc7e5be452c9..da412fed41a9 100644 --- a/packages/console/core/migrations/20250911141957_dusty_clint_barton/snapshot.json +++ b/packages/console/core/migrations/20250911141957_dusty_clint_barton/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "26cebd59-f553-441c-a2b2-2f9578a0ad2b", - "prevIds": [ - "9f51ef52-31ac-4ace-8b6d-39b35efe9c81" - ], + "prevIds": ["9f51ef52-31ac-4ace-8b6d-39b35efe9c81"], "dialect": "mysql", "ddl": [ { @@ -891,28 +889,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -954,10 +943,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -983,10 +969,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1008,13 +991,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250911214917_first_mockingbird/snapshot.json b/packages/console/core/migrations/20250911214917_first_mockingbird/snapshot.json index dd17e1580dd9..e0c84bb2d3e7 100644 --- a/packages/console/core/migrations/20250911214917_first_mockingbird/snapshot.json +++ b/packages/console/core/migrations/20250911214917_first_mockingbird/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "06dc6226-bfbb-4ccc-b4bc-f26070c3bed5", - "prevIds": [ - "26cebd59-f553-441c-a2b2-2f9578a0ad2b" - ], + "prevIds": ["26cebd59-f553-441c-a2b2-2f9578a0ad2b"], "dialect": "mysql", "ddl": [ { @@ -905,28 +903,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -968,10 +957,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -997,10 +983,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1022,13 +1005,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250911231144_jazzy_skrulls/snapshot.json b/packages/console/core/migrations/20250911231144_jazzy_skrulls/snapshot.json index 7b5153446b36..57ef218deba6 100644 --- a/packages/console/core/migrations/20250911231144_jazzy_skrulls/snapshot.json +++ b/packages/console/core/migrations/20250911231144_jazzy_skrulls/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "d13af80e-3c70-4866-8f14-48e7ff6ff0ff", - "prevIds": [ - "06dc6226-bfbb-4ccc-b4bc-f26070c3bed5" - ], + "prevIds": ["06dc6226-bfbb-4ccc-b4bc-f26070c3bed5"], "dialect": "mysql", "ddl": [ { @@ -905,28 +903,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -968,10 +957,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -997,10 +983,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1022,13 +1005,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250912021148_parallel_gauntlet/snapshot.json b/packages/console/core/migrations/20250912021148_parallel_gauntlet/snapshot.json index e92cc105d4d0..75472504c3a8 100644 --- a/packages/console/core/migrations/20250912021148_parallel_gauntlet/snapshot.json +++ b/packages/console/core/migrations/20250912021148_parallel_gauntlet/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "b0ad4b11-b607-46c7-8e2d-3b9823cdc5f7", - "prevIds": [ - "d13af80e-3c70-4866-8f14-48e7ff6ff0ff" - ], + "prevIds": ["d13af80e-3c70-4866-8f14-48e7ff6ff0ff"], "dialect": "mysql", "ddl": [ { @@ -933,28 +931,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -996,10 +985,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1025,10 +1011,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1050,13 +1033,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250912161749_familiar_nightshade/snapshot.json b/packages/console/core/migrations/20250912161749_familiar_nightshade/snapshot.json index 36b4dee021f4..5aa25052ab6a 100644 --- a/packages/console/core/migrations/20250912161749_familiar_nightshade/snapshot.json +++ b/packages/console/core/migrations/20250912161749_familiar_nightshade/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "91067cc9-d492-47b3-932a-42dcc0920b3c", - "prevIds": [ - "b0ad4b11-b607-46c7-8e2d-3b9823cdc5f7" - ], + "prevIds": ["b0ad4b11-b607-46c7-8e2d-3b9823cdc5f7"], "dialect": "mysql", "ddl": [ { @@ -919,28 +917,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -982,10 +971,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1011,10 +997,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1036,13 +1019,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250914213824_eminent_ultimatum/snapshot.json b/packages/console/core/migrations/20250914213824_eminent_ultimatum/snapshot.json index 87a0cb8b93d7..f7606b786291 100644 --- a/packages/console/core/migrations/20250914213824_eminent_ultimatum/snapshot.json +++ b/packages/console/core/migrations/20250914213824_eminent_ultimatum/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "3e080fc0-9efd-411f-b764-ed3aa4abcee5", - "prevIds": [ - "91067cc9-d492-47b3-932a-42dcc0920b3c" - ], + "prevIds": ["91067cc9-d492-47b3-932a-42dcc0920b3c"], "dialect": "mysql", "ddl": [ { @@ -933,28 +931,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -996,10 +985,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1025,10 +1011,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1050,13 +1033,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250914222302_redundant_piledriver/snapshot.json b/packages/console/core/migrations/20250914222302_redundant_piledriver/snapshot.json index 54f9249761d5..9f4163f61c39 100644 --- a/packages/console/core/migrations/20250914222302_redundant_piledriver/snapshot.json +++ b/packages/console/core/migrations/20250914222302_redundant_piledriver/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "b0019e1e-d365-4f67-be3d-a2e69bdddc04", - "prevIds": [ - "3e080fc0-9efd-411f-b764-ed3aa4abcee5" - ], + "prevIds": ["3e080fc0-9efd-411f-b764-ed3aa4abcee5"], "dialect": "mysql", "ddl": [ { @@ -947,28 +945,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1010,10 +999,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1039,10 +1025,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1064,13 +1047,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250914232505_needy_sue_storm/snapshot.json b/packages/console/core/migrations/20250914232505_needy_sue_storm/snapshot.json index 827303f84375..835c27e5974f 100644 --- a/packages/console/core/migrations/20250914232505_needy_sue_storm/snapshot.json +++ b/packages/console/core/migrations/20250914232505_needy_sue_storm/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "1f08bd5a-436d-4905-a585-87b156847402", - "prevIds": [ - "b0019e1e-d365-4f67-be3d-a2e69bdddc04" - ], + "prevIds": ["b0019e1e-d365-4f67-be3d-a2e69bdddc04"], "dialect": "mysql", "ddl": [ { @@ -963,28 +961,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1026,10 +1015,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1055,10 +1041,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1080,13 +1063,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250915150801_freezing_phil_sheldon/snapshot.json b/packages/console/core/migrations/20250915150801_freezing_phil_sheldon/snapshot.json index d0afdbd108a3..e2f48178a845 100644 --- a/packages/console/core/migrations/20250915150801_freezing_phil_sheldon/snapshot.json +++ b/packages/console/core/migrations/20250915150801_freezing_phil_sheldon/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "cd9c94c4-9167-4346-b716-1bd0cff10ffc", - "prevIds": [ - "1f08bd5a-436d-4905-a585-87b156847402" - ], + "prevIds": ["1f08bd5a-436d-4905-a585-87b156847402"], "dialect": "mysql", "ddl": [ { @@ -977,28 +975,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1040,10 +1029,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1069,10 +1055,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1094,13 +1077,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250915172014_bright_photon/snapshot.json b/packages/console/core/migrations/20250915172014_bright_photon/snapshot.json index 5afc7dfefba9..eae20d54c0f5 100644 --- a/packages/console/core/migrations/20250915172014_bright_photon/snapshot.json +++ b/packages/console/core/migrations/20250915172014_bright_photon/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "ba801b30-747a-433e-ab43-b407c961a24c", - "prevIds": [ - "cd9c94c4-9167-4346-b716-1bd0cff10ffc" - ], + "prevIds": ["cd9c94c4-9167-4346-b716-1bd0cff10ffc"], "dialect": "mysql", "ddl": [ { @@ -1019,28 +1017,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1082,10 +1071,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1111,10 +1097,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1136,13 +1119,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250915172258_absurd_hobgoblin/snapshot.json b/packages/console/core/migrations/20250915172258_absurd_hobgoblin/snapshot.json index ca4351d30f91..6c0a9b3836ea 100644 --- a/packages/console/core/migrations/20250915172258_absurd_hobgoblin/snapshot.json +++ b/packages/console/core/migrations/20250915172258_absurd_hobgoblin/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "28336c91-553c-4d1d-9875-1ee761e47582", - "prevIds": [ - "ba801b30-747a-433e-ab43-b407c961a24c" - ], + "prevIds": ["ba801b30-747a-433e-ab43-b407c961a24c"], "dialect": "mysql", "ddl": [ { @@ -1019,28 +1017,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1082,10 +1071,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1111,10 +1097,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1136,13 +1119,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250919135159_demonic_princess_powerful/snapshot.json b/packages/console/core/migrations/20250919135159_demonic_princess_powerful/snapshot.json index b20d43e8d771..c94526e91ab3 100644 --- a/packages/console/core/migrations/20250919135159_demonic_princess_powerful/snapshot.json +++ b/packages/console/core/migrations/20250919135159_demonic_princess_powerful/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "12189a4e-5083-4b17-b8e3-8279c9a3e61a", - "prevIds": [ - "28336c91-553c-4d1d-9875-1ee761e47582" - ], + "prevIds": ["28336c91-553c-4d1d-9875-1ee761e47582"], "dialect": "mysql", "ddl": [ { @@ -1033,28 +1031,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1096,10 +1085,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1125,10 +1111,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1150,13 +1133,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250921042124_cloudy_revanche/snapshot.json b/packages/console/core/migrations/20250921042124_cloudy_revanche/snapshot.json index a6d2e451e9de..9de034489b9c 100644 --- a/packages/console/core/migrations/20250921042124_cloudy_revanche/snapshot.json +++ b/packages/console/core/migrations/20250921042124_cloudy_revanche/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "7f3989cb-3e8b-430e-a0f5-f87051d1d824", - "prevIds": [ - "12189a4e-5083-4b17-b8e3-8279c9a3e61a" - ], + "prevIds": ["12189a4e-5083-4b17-b8e3-8279c9a3e61a"], "dialect": "mysql", "ddl": [ { @@ -1019,28 +1017,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1082,10 +1071,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1111,10 +1097,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1136,13 +1119,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250923213126_cold_la_nuit/snapshot.json b/packages/console/core/migrations/20250923213126_cold_la_nuit/snapshot.json index 12bfe5d6e77f..8f513193ed67 100644 --- a/packages/console/core/migrations/20250923213126_cold_la_nuit/snapshot.json +++ b/packages/console/core/migrations/20250923213126_cold_la_nuit/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "45b67fb4-77ce-4aa2-b883-1971429c69f5", - "prevIds": [ - "7f3989cb-3e8b-430e-a0f5-f87051d1d824" - ], + "prevIds": ["7f3989cb-3e8b-430e-a0f5-f87051d1d824"], "dialect": "mysql", "ddl": [ { @@ -1033,28 +1031,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1096,10 +1085,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1125,10 +1111,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1150,13 +1133,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/snapshot.json b/packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/snapshot.json index d6e1020b5119..4a6758c6be80 100644 --- a/packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/snapshot.json +++ b/packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "100a21cf-ff9c-476f-bf7d-100c1824b2b2", - "prevIds": [ - "45b67fb4-77ce-4aa2-b883-1971429c69f5" - ], + "prevIds": ["45b67fb4-77ce-4aa2-b883-1971429c69f5"], "dialect": "mysql", "ddl": [ { @@ -1047,28 +1045,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1110,10 +1099,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1139,10 +1125,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1164,13 +1147,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250928163425_nervous_iron_lad/snapshot.json b/packages/console/core/migrations/20250928163425_nervous_iron_lad/snapshot.json index 873927d5c2c2..a23bd3c8ef14 100644 --- a/packages/console/core/migrations/20250928163425_nervous_iron_lad/snapshot.json +++ b/packages/console/core/migrations/20250928163425_nervous_iron_lad/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "e9c91c2d-787d-4234-b98d-1620e4ce80e1", - "prevIds": [ - "100a21cf-ff9c-476f-bf7d-100c1824b2b2" - ], + "prevIds": ["100a21cf-ff9c-476f-bf7d-100c1824b2b2"], "dialect": "mysql", "ddl": [ { @@ -1075,28 +1073,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1138,10 +1127,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1167,10 +1153,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1192,13 +1175,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250928235456_dazzling_cable/snapshot.json b/packages/console/core/migrations/20250928235456_dazzling_cable/snapshot.json index 406b4039d04a..4f52f4b0b5f7 100644 --- a/packages/console/core/migrations/20250928235456_dazzling_cable/snapshot.json +++ b/packages/console/core/migrations/20250928235456_dazzling_cable/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "a2bb7222-561c-45f0-8939-8ef9b8e57bb3", - "prevIds": [ - "e9c91c2d-787d-4234-b98d-1620e4ce80e1" - ], + "prevIds": ["e9c91c2d-787d-4234-b98d-1620e4ce80e1"], "dialect": "mysql", "ddl": [ { @@ -1075,28 +1073,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1138,10 +1127,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1167,10 +1153,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1192,13 +1175,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250929181457_supreme_jack_power/snapshot.json b/packages/console/core/migrations/20250929181457_supreme_jack_power/snapshot.json index fadd88005d9b..6808c0fd5be1 100644 --- a/packages/console/core/migrations/20250929181457_supreme_jack_power/snapshot.json +++ b/packages/console/core/migrations/20250929181457_supreme_jack_power/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "908437f9-54ed-4c83-b555-614926e326f8", - "prevIds": [ - "a2bb7222-561c-45f0-8939-8ef9b8e57bb3" - ], + "prevIds": ["a2bb7222-561c-45f0-8939-8ef9b8e57bb3"], "dialect": "mysql", "ddl": [ { @@ -1061,28 +1059,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1124,10 +1113,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1153,10 +1139,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1178,13 +1161,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20250929224703_flawless_clea/snapshot.json b/packages/console/core/migrations/20250929224703_flawless_clea/snapshot.json index 486ae035a6f2..5c2ab1a4b15f 100644 --- a/packages/console/core/migrations/20250929224703_flawless_clea/snapshot.json +++ b/packages/console/core/migrations/20250929224703_flawless_clea/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "14616ba2-c21e-4787-a289-f2a3eb6de04f", - "prevIds": [ - "908437f9-54ed-4c83-b555-614926e326f8" - ], + "prevIds": ["908437f9-54ed-4c83-b555-614926e326f8"], "dialect": "mysql", "ddl": [ { @@ -1075,28 +1073,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1138,10 +1127,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1167,10 +1153,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1192,13 +1175,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251002175032_nice_dreadnoughts/snapshot.json b/packages/console/core/migrations/20251002175032_nice_dreadnoughts/snapshot.json index 3c1dc1276029..12dd96929f17 100644 --- a/packages/console/core/migrations/20251002175032_nice_dreadnoughts/snapshot.json +++ b/packages/console/core/migrations/20251002175032_nice_dreadnoughts/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "2296e9e4-bee6-485b-a146-6666ac8dc0d0", - "prevIds": [ - "14616ba2-c21e-4787-a289-f2a3eb6de04f" - ], + "prevIds": ["14616ba2-c21e-4787-a289-f2a3eb6de04f"], "dialect": "mysql", "ddl": [ { @@ -1103,28 +1101,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1166,10 +1155,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1215,10 +1201,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1240,13 +1223,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251002223020_optimal_paibok/snapshot.json b/packages/console/core/migrations/20251002223020_optimal_paibok/snapshot.json index b2e699608399..21f2b0ed2c77 100644 --- a/packages/console/core/migrations/20251002223020_optimal_paibok/snapshot.json +++ b/packages/console/core/migrations/20251002223020_optimal_paibok/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "6857f409-1b5d-4752-9d65-a82ee70e6ad2", - "prevIds": [ - "2296e9e4-bee6-485b-a146-6666ac8dc0d0" - ], + "prevIds": ["2296e9e4-bee6-485b-a146-6666ac8dc0d0"], "dialect": "mysql", "ddl": [ { @@ -1103,28 +1101,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1166,10 +1155,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1247,10 +1233,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1272,13 +1255,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251003202205_early_black_crow/snapshot.json b/packages/console/core/migrations/20251003202205_early_black_crow/snapshot.json index fbbcbe9d7ae3..638be654c635 100644 --- a/packages/console/core/migrations/20251003202205_early_black_crow/snapshot.json +++ b/packages/console/core/migrations/20251003202205_early_black_crow/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "6d546f3e-17b2-4195-bb10-7e6d91774bd7", - "prevIds": [ - "6857f409-1b5d-4752-9d65-a82ee70e6ad2" - ], + "prevIds": ["6857f409-1b5d-4752-9d65-a82ee70e6ad2"], "dialect": "mysql", "ddl": [ { @@ -1075,28 +1073,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1138,10 +1127,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1219,10 +1205,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1244,13 +1227,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251003210411_legal_joseph/snapshot.json b/packages/console/core/migrations/20251003210411_legal_joseph/snapshot.json index 01b6820aadb2..63663564462a 100644 --- a/packages/console/core/migrations/20251003210411_legal_joseph/snapshot.json +++ b/packages/console/core/migrations/20251003210411_legal_joseph/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "ce444765-0606-4880-970a-2176bc2a78ac", - "prevIds": [ - "6d546f3e-17b2-4195-bb10-7e6d91774bd7" - ], + "prevIds": ["6d546f3e-17b2-4195-bb10-7e6d91774bd7"], "dialect": "mysql", "ddl": [ { @@ -1089,28 +1087,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1152,10 +1141,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1233,10 +1219,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1258,13 +1241,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251004030300_numerous_prodigy/snapshot.json b/packages/console/core/migrations/20251004030300_numerous_prodigy/snapshot.json index aea58e55dfb8..1588e6b8e3ce 100644 --- a/packages/console/core/migrations/20251004030300_numerous_prodigy/snapshot.json +++ b/packages/console/core/migrations/20251004030300_numerous_prodigy/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "9e1313c7-ca78-4d2c-b13b-625d9d6fcaa3", - "prevIds": [ - "ce444765-0606-4880-970a-2176bc2a78ac" - ], + "prevIds": ["ce444765-0606-4880-970a-2176bc2a78ac"], "dialect": "mysql", "ddl": [ { @@ -1089,28 +1087,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1132,10 +1121,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1213,10 +1199,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1238,13 +1221,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251004045106_hot_wong/snapshot.json b/packages/console/core/migrations/20251004045106_hot_wong/snapshot.json index 59a7a37f279f..15467efc3877 100644 --- a/packages/console/core/migrations/20251004045106_hot_wong/snapshot.json +++ b/packages/console/core/migrations/20251004045106_hot_wong/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "05e873f6-1556-4bcb-8e19-14971e37610a", - "prevIds": [ - "9e1313c7-ca78-4d2c-b13b-625d9d6fcaa3" - ], + "prevIds": ["9e1313c7-ca78-4d2c-b13b-625d9d6fcaa3"], "dialect": "mysql", "ddl": [ { @@ -1061,28 +1059,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1104,10 +1093,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1185,10 +1171,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1210,13 +1193,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251007024345_careful_cerise/snapshot.json b/packages/console/core/migrations/20251007024345_careful_cerise/snapshot.json index 73b658c7822f..7dd21cfe1472 100644 --- a/packages/console/core/migrations/20251007024345_careful_cerise/snapshot.json +++ b/packages/console/core/migrations/20251007024345_careful_cerise/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "a331e38c-c2e3-406d-a1ff-b0af7229cd85", - "prevIds": [ - "05e873f6-1556-4bcb-8e19-14971e37610a" - ], + "prevIds": ["05e873f6-1556-4bcb-8e19-14971e37610a"], "dialect": "mysql", "ddl": [ { @@ -1061,28 +1059,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1104,10 +1093,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1185,10 +1171,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1210,13 +1193,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251007043715_panoramic_harrier/snapshot.json b/packages/console/core/migrations/20251007043715_panoramic_harrier/snapshot.json index 7e1e74e11c9c..610ce9011410 100644 --- a/packages/console/core/migrations/20251007043715_panoramic_harrier/snapshot.json +++ b/packages/console/core/migrations/20251007043715_panoramic_harrier/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "33551b4c-fc2e-4753-8d9d-0971f333e65d", - "prevIds": [ - "a331e38c-c2e3-406d-a1ff-b0af7229cd85" - ], + "prevIds": ["a331e38c-c2e3-406d-a1ff-b0af7229cd85"], "dialect": "mysql", "ddl": [ { @@ -1103,28 +1101,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1146,10 +1135,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1227,10 +1213,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1252,13 +1235,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251007230438_ordinary_ultragirl/snapshot.json b/packages/console/core/migrations/20251007230438_ordinary_ultragirl/snapshot.json index 92731b1b0687..77205c73d273 100644 --- a/packages/console/core/migrations/20251007230438_ordinary_ultragirl/snapshot.json +++ b/packages/console/core/migrations/20251007230438_ordinary_ultragirl/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "eae45fcf-dc0f-4756-bc5d-30791f2965a2", - "prevIds": [ - "33551b4c-fc2e-4753-8d9d-0971f333e65d" - ], + "prevIds": ["33551b4c-fc2e-4753-8d9d-0971f333e65d"], "dialect": "mysql", "ddl": [ { @@ -1191,28 +1189,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1234,10 +1223,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1263,10 +1249,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1344,10 +1327,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1369,13 +1349,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/snapshot.json b/packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/snapshot.json index ac9833abd4d8..d91bd7d1aa31 100644 --- a/packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/snapshot.json +++ b/packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "9dceb591-8e08-4991-a49c-1f1741ec1e57", - "prevIds": [ - "eae45fcf-dc0f-4756-bc5d-30791f2965a2" - ], + "prevIds": ["eae45fcf-dc0f-4756-bc5d-30791f2965a2"], "dialect": "mysql", "ddl": [ { @@ -1293,28 +1291,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1336,10 +1325,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1365,10 +1351,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1394,10 +1377,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1475,10 +1455,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1500,13 +1477,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251009021849_white_doctor_doom/snapshot.json b/packages/console/core/migrations/20251009021849_white_doctor_doom/snapshot.json index b0720848cdd2..6fe9fd5dc005 100644 --- a/packages/console/core/migrations/20251009021849_white_doctor_doom/snapshot.json +++ b/packages/console/core/migrations/20251009021849_white_doctor_doom/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "b2406421-f22d-4153-a2a4-6deafe70ee54", - "prevIds": [ - "9dceb591-8e08-4991-a49c-1f1741ec1e57" - ], + "prevIds": ["9dceb591-8e08-4991-a49c-1f1741ec1e57"], "dialect": "mysql", "ddl": [ { @@ -1307,28 +1305,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1350,10 +1339,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1379,10 +1365,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1408,10 +1391,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1489,10 +1469,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1514,13 +1491,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251016175624_cynical_jack_flag/snapshot.json b/packages/console/core/migrations/20251016175624_cynical_jack_flag/snapshot.json index 7d621f1a0302..3ea26248b34b 100644 --- a/packages/console/core/migrations/20251016175624_cynical_jack_flag/snapshot.json +++ b/packages/console/core/migrations/20251016175624_cynical_jack_flag/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "91ef8fda-ca96-4a3f-af29-dd6ae7136398", - "prevIds": [ - "b2406421-f22d-4153-a2a4-6deafe70ee54" - ], + "prevIds": ["b2406421-f22d-4153-a2a4-6deafe70ee54"], "dialect": "mysql", "ddl": [ { @@ -1321,28 +1319,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1364,10 +1353,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1393,10 +1379,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1422,10 +1405,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1503,10 +1483,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1528,13 +1505,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251016214520_short_bulldozer/snapshot.json b/packages/console/core/migrations/20251016214520_short_bulldozer/snapshot.json index 6eac1361cfa2..c22274da057a 100644 --- a/packages/console/core/migrations/20251016214520_short_bulldozer/snapshot.json +++ b/packages/console/core/migrations/20251016214520_short_bulldozer/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "34706440-26d7-43f5-9b39-815aa912e5ef", - "prevIds": [ - "91ef8fda-ca96-4a3f-af29-dd6ae7136398" - ], + "prevIds": ["91ef8fda-ca96-4a3f-af29-dd6ae7136398"], "dialect": "mysql", "ddl": [ { @@ -1443,28 +1441,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1486,10 +1475,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1515,10 +1501,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1544,10 +1527,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1625,10 +1605,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1650,13 +1627,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251017015733_narrow_blindfold/snapshot.json b/packages/console/core/migrations/20251017015733_narrow_blindfold/snapshot.json index dd5b4b6a6e33..026613145292 100644 --- a/packages/console/core/migrations/20251017015733_narrow_blindfold/snapshot.json +++ b/packages/console/core/migrations/20251017015733_narrow_blindfold/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "10169105-4545-4894-838b-004c0a42c584", - "prevIds": [ - "34706440-26d7-43f5-9b39-815aa912e5ef" - ], + "prevIds": ["34706440-26d7-43f5-9b39-815aa912e5ef"], "dialect": "mysql", "ddl": [ { @@ -1429,28 +1427,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1472,10 +1461,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1501,10 +1487,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1530,10 +1513,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1611,10 +1591,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1636,13 +1613,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251017024232_slimy_energizer/snapshot.json b/packages/console/core/migrations/20251017024232_slimy_energizer/snapshot.json index 67299bfdc449..106aa33c6dc4 100644 --- a/packages/console/core/migrations/20251017024232_slimy_energizer/snapshot.json +++ b/packages/console/core/migrations/20251017024232_slimy_energizer/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "5470c8b4-296d-47bd-85a7-88cfd3b71434", - "prevIds": [ - "10169105-4545-4894-838b-004c0a42c584" - ], + "prevIds": ["10169105-4545-4894-838b-004c0a42c584"], "dialect": "mysql", "ddl": [ { @@ -1377,9 +1375,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1421,9 +1417,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1445,28 +1439,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1488,10 +1473,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1517,10 +1499,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1546,10 +1525,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1627,10 +1603,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1652,13 +1625,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251031163113_messy_jackal/snapshot.json b/packages/console/core/migrations/20251031163113_messy_jackal/snapshot.json index 91f2c72ebf95..27f03383a643 100644 --- a/packages/console/core/migrations/20251031163113_messy_jackal/snapshot.json +++ b/packages/console/core/migrations/20251031163113_messy_jackal/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "8b7fa839-a088-408e-84a4-1a07325c0290", - "prevIds": [ - "5470c8b4-296d-47bd-85a7-88cfd3b71434" - ], + "prevIds": ["5470c8b4-296d-47bd-85a7-88cfd3b71434"], "dialect": "mysql", "ddl": [ { @@ -1405,9 +1403,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1449,9 +1445,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1473,28 +1467,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" @@ -1516,10 +1501,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1545,10 +1527,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1574,10 +1553,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1655,10 +1631,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1680,13 +1653,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251125223403_famous_magik/snapshot.json b/packages/console/core/migrations/20251125223403_famous_magik/snapshot.json index 0849dcd51f09..5250b414615a 100644 --- a/packages/console/core/migrations/20251125223403_famous_magik/snapshot.json +++ b/packages/console/core/migrations/20251125223403_famous_magik/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "9d5d9885-7ec5-45f6-ac53-45a8e25dede7", - "prevIds": [ - "8b7fa839-a088-408e-84a4-1a07325c0290" - ], + "prevIds": ["8b7fa839-a088-408e-84a4-1a07325c0290"], "dialect": "mysql", "ddl": [ { @@ -1479,9 +1477,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1523,9 +1519,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1547,36 +1541,25 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -1598,10 +1581,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1627,10 +1607,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1656,10 +1633,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1737,10 +1711,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1762,13 +1733,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20251228182259_striped_forge/snapshot.json b/packages/console/core/migrations/20251228182259_striped_forge/snapshot.json index 164db88a264f..0a540a4b9f8d 100644 --- a/packages/console/core/migrations/20251228182259_striped_forge/snapshot.json +++ b/packages/console/core/migrations/20251228182259_striped_forge/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "49a1ac05-78ab-4aae-908e-d4aeeb8196fc", - "prevIds": [ - "9d5d9885-7ec5-45f6-ac53-45a8e25dede7" - ], + "prevIds": ["9d5d9885-7ec5-45f6-ac53-45a8e25dede7"], "dialect": "mysql", "ddl": [ { @@ -1581,9 +1579,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1625,9 +1621,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1649,9 +1643,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1673,36 +1665,25 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -1724,10 +1705,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1753,10 +1731,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1782,10 +1757,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1863,10 +1835,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1888,13 +1857,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260105034337_broken_gamora/snapshot.json b/packages/console/core/migrations/20260105034337_broken_gamora/snapshot.json index 10d01ff1ed0d..04e088505bfa 100644 --- a/packages/console/core/migrations/20260105034337_broken_gamora/snapshot.json +++ b/packages/console/core/migrations/20260105034337_broken_gamora/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "bf19cd74-71f9-4bdf-b50e-67c2436f3408", - "prevIds": [ - "49a1ac05-78ab-4aae-908e-d4aeeb8196fc" - ], + "prevIds": ["49a1ac05-78ab-4aae-908e-d4aeeb8196fc"], "dialect": "mysql", "ddl": [ { @@ -1581,9 +1579,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1625,9 +1621,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1649,9 +1643,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1673,19 +1665,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1711,18 +1697,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -1744,10 +1725,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1773,10 +1751,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1802,10 +1777,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1883,10 +1855,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1908,13 +1877,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260106204919_odd_misty_knight/snapshot.json b/packages/console/core/migrations/20260106204919_odd_misty_knight/snapshot.json index 8c1da22a293a..17a9730364b3 100644 --- a/packages/console/core/migrations/20260106204919_odd_misty_knight/snapshot.json +++ b/packages/console/core/migrations/20260106204919_odd_misty_knight/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "9cf10c24-6029-4cb4-866e-ff9b501eaf7e", - "prevIds": [ - "bf19cd74-71f9-4bdf-b50e-67c2436f3408" - ], + "prevIds": ["bf19cd74-71f9-4bdf-b50e-67c2436f3408"], "dialect": "mysql", "ddl": [ { @@ -1627,9 +1625,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1671,9 +1667,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1695,9 +1689,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1719,19 +1711,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1757,27 +1743,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -1799,10 +1777,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1828,10 +1803,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1857,10 +1829,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -1938,10 +1907,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -1963,13 +1929,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260107000117_flat_nightmare/snapshot.json b/packages/console/core/migrations/20260107000117_flat_nightmare/snapshot.json index c526ce8fa1e8..179c712ba738 100644 --- a/packages/console/core/migrations/20260107000117_flat_nightmare/snapshot.json +++ b/packages/console/core/migrations/20260107000117_flat_nightmare/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "4775571c-ad9c-4104-a202-2374b1963cfe", - "prevIds": [ - "9cf10c24-6029-4cb4-866e-ff9b501eaf7e" - ], + "prevIds": ["9cf10c24-6029-4cb4-866e-ff9b501eaf7e"], "dialect": "mysql", "ddl": [ { @@ -1725,9 +1723,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1769,9 +1765,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1793,9 +1787,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1817,19 +1809,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1855,27 +1841,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -1897,10 +1875,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1926,10 +1901,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1955,10 +1927,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2036,10 +2005,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2061,13 +2027,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260107022356_lame_calypso/snapshot.json b/packages/console/core/migrations/20260107022356_lame_calypso/snapshot.json index c4a8d7409701..27b00b6e009b 100644 --- a/packages/console/core/migrations/20260107022356_lame_calypso/snapshot.json +++ b/packages/console/core/migrations/20260107022356_lame_calypso/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "3ff862f3-eeb6-4b10-8c78-254de3778ab3", - "prevIds": [ - "4775571c-ad9c-4104-a202-2374b1963cfe" - ], + "prevIds": ["4775571c-ad9c-4104-a202-2374b1963cfe"], "dialect": "mysql", "ddl": [ { @@ -1725,9 +1723,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1769,9 +1765,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1793,9 +1787,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1817,19 +1809,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1855,27 +1841,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -1897,10 +1875,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1926,10 +1901,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1955,10 +1927,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2036,10 +2005,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2061,13 +2027,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260107041522_tiny_captain_midlands/snapshot.json b/packages/console/core/migrations/20260107041522_tiny_captain_midlands/snapshot.json index faca26e79fba..088f95612d0f 100644 --- a/packages/console/core/migrations/20260107041522_tiny_captain_midlands/snapshot.json +++ b/packages/console/core/migrations/20260107041522_tiny_captain_midlands/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "70394850-2c28-4012-a3d5-69357e3348b6", - "prevIds": [ - "3ff862f3-eeb6-4b10-8c78-254de3778ab3" - ], + "prevIds": ["3ff862f3-eeb6-4b10-8c78-254de3778ab3"], "dialect": "mysql", "ddl": [ { @@ -1725,9 +1723,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1769,9 +1765,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1793,9 +1787,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1817,19 +1809,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1855,27 +1841,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -1897,10 +1875,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1926,10 +1901,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1955,10 +1927,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2036,10 +2005,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2061,13 +2027,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260107055817_cuddly_diamondback/snapshot.json b/packages/console/core/migrations/20260107055817_cuddly_diamondback/snapshot.json index 8b3abeea5ebe..03fe57605ab4 100644 --- a/packages/console/core/migrations/20260107055817_cuddly_diamondback/snapshot.json +++ b/packages/console/core/migrations/20260107055817_cuddly_diamondback/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "27c1a3eb-b125-46d4-b436-abe5764fe4b7", - "prevIds": [ - "70394850-2c28-4012-a3d5-69357e3348b6" - ], + "prevIds": ["70394850-2c28-4012-a3d5-69357e3348b6"], "dialect": "mysql", "ddl": [ { @@ -1725,9 +1723,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1769,9 +1765,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1793,9 +1787,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1833,19 +1825,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1871,27 +1857,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -1913,10 +1891,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -1942,10 +1917,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -1971,10 +1943,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2052,10 +2021,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2077,13 +2043,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260108224422_charming_black_bolt/snapshot.json b/packages/console/core/migrations/20260108224422_charming_black_bolt/snapshot.json index 83252a23b29e..90142e70edbc 100644 --- a/packages/console/core/migrations/20260108224422_charming_black_bolt/snapshot.json +++ b/packages/console/core/migrations/20260108224422_charming_black_bolt/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "f3725f6d-5f33-4497-b4ba-cf05c46fb873", - "prevIds": [ - "27c1a3eb-b125-46d4-b436-abe5764fe4b7" - ], + "prevIds": ["27c1a3eb-b125-46d4-b436-abe5764fe4b7"], "dialect": "mysql", "ddl": [ { @@ -1869,9 +1867,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1913,9 +1909,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1937,9 +1931,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1977,28 +1969,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -2024,27 +2007,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2066,10 +2041,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2095,10 +2067,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2124,10 +2093,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2205,10 +2171,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2230,13 +2193,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260109000245_huge_omega_red/snapshot.json b/packages/console/core/migrations/20260109000245_huge_omega_red/snapshot.json index 3e1837735daf..dad3cdbfa632 100644 --- a/packages/console/core/migrations/20260109000245_huge_omega_red/snapshot.json +++ b/packages/console/core/migrations/20260109000245_huge_omega_red/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "fec4cb15-6f13-465d-a902-b76b026872f4", - "prevIds": [ - "f3725f6d-5f33-4497-b4ba-cf05c46fb873" - ], + "prevIds": ["f3725f6d-5f33-4497-b4ba-cf05c46fb873"], "dialect": "mysql", "ddl": [ { @@ -1799,9 +1797,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1843,9 +1839,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1867,9 +1861,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1907,19 +1899,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1945,10 +1931,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -1974,27 +1957,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2016,10 +1991,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2045,10 +2017,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2074,10 +2043,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2155,10 +2121,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2180,13 +2143,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260109001625_mean_frank_castle/snapshot.json b/packages/console/core/migrations/20260109001625_mean_frank_castle/snapshot.json index a54719559f75..9a43cd2bdf60 100644 --- a/packages/console/core/migrations/20260109001625_mean_frank_castle/snapshot.json +++ b/packages/console/core/migrations/20260109001625_mean_frank_castle/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "bb90bb3e-fd08-439a-b92f-5f433807480e", - "prevIds": [ - "fec4cb15-6f13-465d-a902-b76b026872f4" - ], + "prevIds": ["fec4cb15-6f13-465d-a902-b76b026872f4"], "dialect": "mysql", "ddl": [ { @@ -1799,9 +1797,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1843,9 +1839,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1867,9 +1861,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1907,19 +1899,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1945,10 +1931,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -1974,27 +1957,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2016,10 +1991,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2045,10 +2017,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2074,10 +2043,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2155,10 +2121,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2180,13 +2143,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260109014234_noisy_domino/snapshot.json b/packages/console/core/migrations/20260109014234_noisy_domino/snapshot.json index 2d71c85e8e0a..0e6084f51e9f 100644 --- a/packages/console/core/migrations/20260109014234_noisy_domino/snapshot.json +++ b/packages/console/core/migrations/20260109014234_noisy_domino/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "2fd0308b-0653-437d-aea3-29428a4de9f1", - "prevIds": [ - "bb90bb3e-fd08-439a-b92f-5f433807480e" - ], + "prevIds": ["bb90bb3e-fd08-439a-b92f-5f433807480e"], "dialect": "mysql", "ddl": [ { @@ -1813,9 +1811,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1857,9 +1853,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1881,9 +1875,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1921,19 +1913,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1959,10 +1945,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -1988,27 +1971,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2030,10 +2005,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2059,10 +2031,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2088,10 +2057,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2169,10 +2135,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2194,13 +2157,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260109040130_bumpy_mephistopheles/snapshot.json b/packages/console/core/migrations/20260109040130_bumpy_mephistopheles/snapshot.json index 225f9ad227d8..ebff34d85d8d 100644 --- a/packages/console/core/migrations/20260109040130_bumpy_mephistopheles/snapshot.json +++ b/packages/console/core/migrations/20260109040130_bumpy_mephistopheles/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "a0d18802-c390-47d4-98f1-d1f83869cf0c", - "prevIds": [ - "2fd0308b-0653-437d-aea3-29428a4de9f1" - ], + "prevIds": ["2fd0308b-0653-437d-aea3-29428a4de9f1"], "dialect": "mysql", "ddl": [ { @@ -1827,9 +1825,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1871,9 +1867,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1895,9 +1889,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1935,19 +1927,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1973,10 +1959,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -2002,27 +1985,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2044,10 +2019,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2073,10 +2045,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2102,10 +2071,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2183,10 +2149,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2208,13 +2171,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260113215232_jazzy_green_goblin/snapshot.json b/packages/console/core/migrations/20260113215232_jazzy_green_goblin/snapshot.json index aad041fbdb72..f03e37f2f5fc 100644 --- a/packages/console/core/migrations/20260113215232_jazzy_green_goblin/snapshot.json +++ b/packages/console/core/migrations/20260113215232_jazzy_green_goblin/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "14cbf4c8-55f1-4488-956f-56fb5ccb3a5a", - "prevIds": [ - "a0d18802-c390-47d4-98f1-d1f83869cf0c" - ], + "prevIds": ["a0d18802-c390-47d4-98f1-d1f83869cf0c"], "dialect": "mysql", "ddl": [ { @@ -1841,9 +1839,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1885,9 +1881,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1909,9 +1903,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1949,19 +1941,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -1987,10 +1973,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -2016,27 +1999,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2058,10 +2033,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2087,10 +2059,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2116,10 +2085,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2197,10 +2163,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2222,13 +2185,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260113223840_aromatic_agent_zero/snapshot.json b/packages/console/core/migrations/20260113223840_aromatic_agent_zero/snapshot.json index 71933a92d692..000b6f55620c 100644 --- a/packages/console/core/migrations/20260113223840_aromatic_agent_zero/snapshot.json +++ b/packages/console/core/migrations/20260113223840_aromatic_agent_zero/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "00774acd-a1e5-49c0-b296-cacc9506a566", - "prevIds": [ - "14cbf4c8-55f1-4488-956f-56fb5ccb3a5a" - ], + "prevIds": ["14cbf4c8-55f1-4488-956f-56fb5ccb3a5a"], "dialect": "mysql", "ddl": [ { @@ -1855,9 +1853,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1899,9 +1895,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1923,9 +1917,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1963,19 +1955,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -2001,10 +1987,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -2030,27 +2013,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2072,10 +2047,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2101,10 +2073,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2130,10 +2099,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2211,10 +2177,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2236,13 +2199,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260116213606_gigantic_hardball/snapshot.json b/packages/console/core/migrations/20260116213606_gigantic_hardball/snapshot.json index f610aae1d707..d62a4ca5820c 100644 --- a/packages/console/core/migrations/20260116213606_gigantic_hardball/snapshot.json +++ b/packages/console/core/migrations/20260116213606_gigantic_hardball/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "32a0c40b-a269-4ad1-a5a0-52b1f18932aa", - "prevIds": [ - "00774acd-a1e5-49c0-b296-cacc9506a566" - ], + "prevIds": ["00774acd-a1e5-49c0-b296-cacc9506a566"], "dialect": "mysql", "ddl": [ { @@ -1869,9 +1867,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1913,9 +1909,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1937,9 +1931,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1977,19 +1969,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -2015,10 +2001,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -2044,27 +2027,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2086,10 +2061,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2115,10 +2087,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2144,10 +2113,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2225,10 +2191,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2250,13 +2213,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260116224745_numerous_annihilus/snapshot.json b/packages/console/core/migrations/20260116224745_numerous_annihilus/snapshot.json index 13a662d82802..85f6c848a9bb 100644 --- a/packages/console/core/migrations/20260116224745_numerous_annihilus/snapshot.json +++ b/packages/console/core/migrations/20260116224745_numerous_annihilus/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "a0ade64b-b735-4a70-8d39-ebd84bc9e924", - "prevIds": [ - "32a0c40b-a269-4ad1-a5a0-52b1f18932aa" - ], + "prevIds": ["32a0c40b-a269-4ad1-a5a0-52b1f18932aa"], "dialect": "mysql", "ddl": [ { @@ -1855,9 +1853,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1899,9 +1895,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1923,9 +1917,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1963,19 +1955,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -2001,10 +1987,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -2030,27 +2013,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2072,10 +2047,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2101,10 +2073,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2130,10 +2099,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2211,10 +2177,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2236,13 +2199,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260122190905_moaning_karnak/snapshot.json b/packages/console/core/migrations/20260122190905_moaning_karnak/snapshot.json index 6435eb2d38ae..cb606b01ae14 100644 --- a/packages/console/core/migrations/20260122190905_moaning_karnak/snapshot.json +++ b/packages/console/core/migrations/20260122190905_moaning_karnak/snapshot.json @@ -1,9 +1,7 @@ { "version": "6", "id": "e630f63c-04a8-4b59-bf56-03efcdd1b011", - "prevIds": [ - "a0ade64b-b735-4a70-8d39-ebd84bc9e924" - ], + "prevIds": ["a0ade64b-b735-4a70-8d39-ebd84bc9e924"], "dialect": "mysql", "ddl": [ { @@ -1869,9 +1867,7 @@ "entityType": "columns" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" @@ -1913,9 +1909,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" @@ -1937,9 +1931,7 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" @@ -1977,19 +1969,13 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" @@ -2015,10 +2001,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" @@ -2044,27 +2027,19 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" @@ -2086,10 +2061,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" @@ -2115,10 +2087,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" @@ -2144,10 +2113,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" @@ -2225,10 +2191,7 @@ "entityType": "indexes" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" @@ -2250,13 +2213,11 @@ "entityType": "indexes" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" } ], "renames": [] -} \ No newline at end of file +} diff --git a/packages/console/core/migrations/20260222233442_clever_toxin/snapshot.json b/packages/console/core/migrations/20260222233442_clever_toxin/snapshot.json index a9d26f2dab4b..a91dacd60e6a 100644 --- a/packages/console/core/migrations/20260222233442_clever_toxin/snapshot.json +++ b/packages/console/core/migrations/20260222233442_clever_toxin/snapshot.json @@ -2,9 +2,7 @@ "version": "6", "dialect": "mysql", "id": "4bf45b3f-3edd-4db7-94d5-097aa55ca5f7", - "prevIds": [ - "e630f63c-04a8-4b59-bf56-03efcdd1b011" - ], + "prevIds": ["e630f63c-04a8-4b59-bf56-03efcdd1b011"], "ddl": [ { "name": "account", @@ -1883,122 +1881,85 @@ "table": "workspace" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" @@ -2273,4 +2234,4 @@ } ], "renames": [] -} \ No newline at end of file +} From 9f4fc5b72aaa0a4cd44f8ef9c399e801f3015692 Mon Sep 17 00:00:00 2001 From: adamelmore <2363879+adamdottv@users.noreply.github.com> Date: Sun, 22 Feb 2026 21:27:25 -0600 Subject: [PATCH 16/95] Revert "fix(app): terminal issues" This reverts commit e70d2b27de3aaed5a19b9ca2c6749ed7fce3ef93. --- packages/opencode/src/pty/index.ts | 9 ++-- packages/opencode/src/server/routes/pty.ts | 2 +- .../test/pty/pty-output-isolation.test.ts | 48 ------------------- 3 files changed, 5 insertions(+), 54 deletions(-) diff --git a/packages/opencode/src/pty/index.ts b/packages/opencode/src/pty/index.ts index fdb46c817c9d..33083485b5f6 100644 --- a/packages/opencode/src/pty/index.ts +++ b/packages/opencode/src/pty/index.ts @@ -39,9 +39,8 @@ export namespace Pty { return next } - const token = (ws: unknown) => { - if (!ws || typeof ws !== "object") return ws - const data = (ws as { data?: unknown }).data + const token = (ws: Socket) => { + const data = ws.data if (data === undefined) return if (data === null) return if (typeof data !== "object") return data @@ -318,7 +317,7 @@ export namespace Pty { } } - export function connect(id: string, ws: Socket, cursor?: number, identity?: unknown) { + export function connect(id: string, ws: Socket, cursor?: number) { const session = state().get(id) if (!session) { ws.close() @@ -338,7 +337,7 @@ export namespace Pty { } owners.set(ws, id) - session.subscribers.set(ws, { id: socketId, token: token(identity ?? ws) }) + session.subscribers.set(ws, { id: socketId, token: token(ws) }) const cleanup = () => { session.subscribers.delete(ws) diff --git a/packages/opencode/src/server/routes/pty.ts b/packages/opencode/src/server/routes/pty.ts index 640cfa33361f..368c9612bf42 100644 --- a/packages/opencode/src/server/routes/pty.ts +++ b/packages/opencode/src/server/routes/pty.ts @@ -182,7 +182,7 @@ export const PtyRoutes = lazy(() => ws.close() return } - handler = Pty.connect(id, socket, cursor, ws) + handler = Pty.connect(id, socket, cursor) }, onMessage(event) { if (typeof event.data !== "string") return diff --git a/packages/opencode/test/pty/pty-output-isolation.test.ts b/packages/opencode/test/pty/pty-output-isolation.test.ts index 2c9cc5d92660..07e86ea97b67 100644 --- a/packages/opencode/test/pty/pty-output-isolation.test.ts +++ b/packages/opencode/test/pty/pty-output-isolation.test.ts @@ -98,54 +98,6 @@ describe("pty", () => { }) }) - test("does not leak when identity token is only on websocket wrapper", async () => { - await using dir = await tmpdir({ git: true }) - - await Instance.provide({ - directory: dir.path, - fn: async () => { - const a = await Pty.create({ command: "cat", title: "a" }) - try { - const outA: string[] = [] - const outB: string[] = [] - const text = (data: string | Uint8Array | ArrayBuffer) => { - if (typeof data === "string") return data - if (data instanceof ArrayBuffer) return Buffer.from(new Uint8Array(data)).toString("utf8") - return Buffer.from(data).toString("utf8") - } - - const raw: Parameters[1] = { - readyState: 1, - send: (data) => { - outA.push(text(data)) - }, - close: () => { - // no-op - }, - } - - const wrap = { data: { events: { connection: "a" } } } - - Pty.connect(a.id, raw, undefined, wrap) - outA.length = 0 - - // Simulate Bun reusing the raw socket object before the next onOpen, - // while the connection token only exists on the wrapper socket. - raw.send = (data) => { - outB.push(text(data)) - } - - Pty.write(a.id, "AAA\n") - await Bun.sleep(100) - - expect(outB.join("")).not.toContain("AAA") - } finally { - await Pty.remove(a.id) - } - }, - }) - }) - test("does not leak output when socket data mutates in-place", async () => { await using dir = await tmpdir({ git: true }) From 8e96447960637c2371fb94ca7ce7b456048a0de6 Mon Sep 17 00:00:00 2001 From: Shawn <118158941+kevinWangSheng@users.noreply.github.com> Date: Mon, 23 Feb 2026 00:11:33 -0800 Subject: [PATCH 17/95] fix(app): correct inverted chevron direction in todo list (#14628) Co-authored-by: shenghui kevin Co-authored-by: Claude Opus 4.6 --- packages/app/src/pages/session/composer/session-todo-dock.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/pages/session/composer/session-todo-dock.tsx b/packages/app/src/pages/session/composer/session-todo-dock.tsx index ca7a5abd155d..27998276023f 100644 --- a/packages/app/src/pages/session/composer/session-todo-dock.tsx +++ b/packages/app/src/pages/session/composer/session-todo-dock.tsx @@ -87,7 +87,7 @@ export function SessionTodoDock(props: { todos: Todo[]; title: string; collapseL icon="chevron-down" size="normal" variant="ghost" - classList={{ "rotate-180": !store.collapsed }} + classList={{ "rotate-180": store.collapsed }} onMouseDown={(event) => { event.preventDefault() event.stopPropagation() From 3b5b21a91e2a8f084ee8ed85aca81246880a9384 Mon Sep 17 00:00:00 2001 From: adamelmore <2363879+adamdottv@users.noreply.github.com> Date: Mon, 23 Feb 2026 08:23:46 -0600 Subject: [PATCH 18/95] fix(app): duplicate markdown --- packages/ui/src/components/markdown.tsx | 44 ++++++++++++++++++++----- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/packages/ui/src/components/markdown.tsx b/packages/ui/src/components/markdown.tsx index be43eca81ad8..a5f440f8195f 100644 --- a/packages/ui/src/components/markdown.tsx +++ b/packages/ui/src/components/markdown.tsx @@ -115,7 +115,22 @@ function setupCodeCopy(root: HTMLDivElement, labels: CopyLabels) { const parent = block.parentElement if (!parent) return const wrapped = parent.getAttribute("data-component") === "markdown-code" - if (wrapped) return + if (wrapped) { + const buttons = Array.from(parent.querySelectorAll('[data-slot="markdown-copy-button"]')).filter( + (el): el is HTMLButtonElement => el instanceof HTMLButtonElement, + ) + + if (buttons.length === 0) { + parent.appendChild(createCopyButton(labels)) + return + } + + for (const button of buttons.slice(1)) { + button.remove() + } + + return + } const wrapper = document.createElement("div") wrapper.setAttribute("data-component", "markdown-code") parent.replaceChild(wrapper, block) @@ -192,6 +207,20 @@ function setupCodeCopy(root: HTMLDivElement, labels: CopyLabels) { } } +function wrapCodeBlocks(root: HTMLDivElement) { + const blocks = Array.from(root.querySelectorAll("pre")) + for (const block of blocks) { + const parent = block.parentElement + if (!parent) continue + const wrapped = parent.getAttribute("data-component") === "markdown-code" + if (wrapped) continue + const wrapper = document.createElement("div") + wrapper.setAttribute("data-component", "markdown-code") + parent.replaceChild(wrapper, block) + wrapper.appendChild(block) + } +} + function touch(key: string, value: Entry) { cache.delete(key) cache.set(key, value) @@ -255,12 +284,16 @@ export function Markdown( const temp = document.createElement("div") temp.innerHTML = content + wrapCodeBlocks(temp) morphdom(container, temp, { childrenOnly: true, onBeforeElUpdated: (fromEl, toEl) => { if (fromEl.isEqualNode(toEl)) return false - if (fromEl.getAttribute("data-component") === "markdown-code") { + + const fromWrapped = fromEl.getAttribute("data-component") === "markdown-code" + const toWrapped = toEl.getAttribute("data-component") === "markdown-code" + if (fromWrapped && toWrapped) { const fromPre = fromEl.querySelector("pre") const toPre = toEl.querySelector("pre") if (fromPre && toPre && !fromPre.isEqualNode(toPre)) { @@ -270,13 +303,6 @@ export function Markdown( } return true }, - onBeforeNodeDiscarded: (node) => { - if (node instanceof Element) { - if (node.getAttribute("data-slot") === "markdown-copy-button") return false - if (node.getAttribute("data-component") === "markdown-code") return false - } - return true - }, }) if (copySetupTimer) clearTimeout(copySetupTimer) From 8f2d8dd47a45a4b3972ac8badc09cc280f84b838 Mon Sep 17 00:00:00 2001 From: adamelmore <2363879+adamdottv@users.noreply.github.com> Date: Mon, 23 Feb 2026 09:54:26 -0600 Subject: [PATCH 19/95] fix(app): duplicate markdown --- packages/ui/src/components/markdown.tsx | 148 +++++++++++------------- 1 file changed, 65 insertions(+), 83 deletions(-) diff --git a/packages/ui/src/components/markdown.tsx b/packages/ui/src/components/markdown.tsx index a5f440f8195f..bb41c74efbd0 100644 --- a/packages/ui/src/components/markdown.tsx +++ b/packages/ui/src/components/markdown.tsx @@ -103,68 +103,76 @@ function setCopyState(button: HTMLButtonElement, labels: CopyLabels, copied: boo button.setAttribute("data-tooltip", labels.copy) } -function setupCodeCopy(root: HTMLDivElement, labels: CopyLabels) { - const timeouts = new Map>() - - const updateLabel = (button: HTMLButtonElement) => { - const copied = button.getAttribute("data-copied") === "true" - setCopyState(button, labels, copied) - } - - const ensureWrapper = (block: HTMLPreElement) => { - const parent = block.parentElement - if (!parent) return - const wrapped = parent.getAttribute("data-component") === "markdown-code" - if (wrapped) { - const buttons = Array.from(parent.querySelectorAll('[data-slot="markdown-copy-button"]')).filter( - (el): el is HTMLButtonElement => el instanceof HTMLButtonElement, - ) - - if (buttons.length === 0) { - parent.appendChild(createCopyButton(labels)) - return - } - - for (const button of buttons.slice(1)) { - button.remove() - } - - return - } +function ensureCodeWrapper(block: HTMLPreElement, labels: CopyLabels) { + const parent = block.parentElement + if (!parent) return + const wrapped = parent.getAttribute("data-component") === "markdown-code" + if (!wrapped) { const wrapper = document.createElement("div") wrapper.setAttribute("data-component", "markdown-code") parent.replaceChild(wrapper, block) wrapper.appendChild(block) wrapper.appendChild(createCopyButton(labels)) + return } - const markCodeLinks = () => { - const codeNodes = Array.from(root.querySelectorAll(":not(pre) > code")) - for (const code of codeNodes) { - const href = codeUrl(code.textContent ?? "") - const parentLink = - code.parentElement instanceof HTMLAnchorElement && code.parentElement.classList.contains("external-link") - ? code.parentElement - : null - - if (!href) { - if (parentLink) parentLink.replaceWith(code) - continue - } + const buttons = Array.from(parent.querySelectorAll('[data-slot="markdown-copy-button"]')).filter( + (el): el is HTMLButtonElement => el instanceof HTMLButtonElement, + ) - if (parentLink) { - parentLink.href = href - continue - } + if (buttons.length === 0) { + parent.appendChild(createCopyButton(labels)) + return + } + + for (const button of buttons.slice(1)) { + button.remove() + } +} + +function markCodeLinks(root: HTMLDivElement) { + const codeNodes = Array.from(root.querySelectorAll(":not(pre) > code")) + for (const code of codeNodes) { + const href = codeUrl(code.textContent ?? "") + const parentLink = + code.parentElement instanceof HTMLAnchorElement && code.parentElement.classList.contains("external-link") + ? code.parentElement + : null + + if (!href) { + if (parentLink) parentLink.replaceWith(code) + continue + } - const link = document.createElement("a") - link.href = href - link.className = "external-link" - link.target = "_blank" - link.rel = "noopener noreferrer" - code.parentNode?.replaceChild(link, code) - link.appendChild(code) + if (parentLink) { + parentLink.href = href + continue } + + const link = document.createElement("a") + link.href = href + link.className = "external-link" + link.target = "_blank" + link.rel = "noopener noreferrer" + code.parentNode?.replaceChild(link, code) + link.appendChild(code) + } +} + +function decorate(root: HTMLDivElement, labels: CopyLabels) { + const blocks = Array.from(root.querySelectorAll("pre")) + for (const block of blocks) { + ensureCodeWrapper(block, labels) + } + markCodeLinks(root) +} + +function setupCodeCopy(root: HTMLDivElement, labels: CopyLabels) { + const timeouts = new Map>() + + const updateLabel = (button: HTMLButtonElement) => { + const copied = button.getAttribute("data-copied") === "true" + setCopyState(button, labels, copied) } const handleClick = async (event: MouseEvent) => { @@ -186,11 +194,7 @@ function setupCodeCopy(root: HTMLDivElement, labels: CopyLabels) { timeouts.set(button, timeout) } - const blocks = Array.from(root.querySelectorAll("pre")) - for (const block of blocks) { - ensureWrapper(block) - } - markCodeLinks() + decorate(root, labels) const buttons = Array.from(root.querySelectorAll('[data-slot="markdown-copy-button"]')) for (const button of buttons) { @@ -207,20 +211,6 @@ function setupCodeCopy(root: HTMLDivElement, labels: CopyLabels) { } } -function wrapCodeBlocks(root: HTMLDivElement) { - const blocks = Array.from(root.querySelectorAll("pre")) - for (const block of blocks) { - const parent = block.parentElement - if (!parent) continue - const wrapped = parent.getAttribute("data-component") === "markdown-code" - if (wrapped) continue - const wrapper = document.createElement("div") - wrapper.setAttribute("data-component", "markdown-code") - parent.replaceChild(wrapper, block) - wrapper.appendChild(block) - } -} - function touch(key: string, value: Entry) { cache.delete(key) cache.set(key, value) @@ -284,23 +274,15 @@ export function Markdown( const temp = document.createElement("div") temp.innerHTML = content - wrapCodeBlocks(temp) + decorate(temp, { + copy: i18n.t("ui.message.copy"), + copied: i18n.t("ui.message.copied"), + }) morphdom(container, temp, { childrenOnly: true, onBeforeElUpdated: (fromEl, toEl) => { if (fromEl.isEqualNode(toEl)) return false - - const fromWrapped = fromEl.getAttribute("data-component") === "markdown-code" - const toWrapped = toEl.getAttribute("data-component") === "markdown-code" - if (fromWrapped && toWrapped) { - const fromPre = fromEl.querySelector("pre") - const toPre = toEl.querySelector("pre") - if (fromPre && toPre && !fromPre.isEqualNode(toPre)) { - morphdom(fromPre, toPre) - } - return false - } return true }, }) From 24c63914bf9ff46c3869f35e3cef026aa9f33b61 Mon Sep 17 00:00:00 2001 From: Ryan Vogel Date: Mon, 23 Feb 2026 16:51:29 -0500 Subject: [PATCH 20/95] fix: update workflows for better automation (#14809) --- .github/workflows/compliance-close.yml | 9 +++++++++ .github/workflows/pr-standards.yml | 12 ++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compliance-close.yml b/.github/workflows/compliance-close.yml index 5b424d0adfa7..c3bcf9f686f4 100644 --- a/.github/workflows/compliance-close.yml +++ b/.github/workflows/compliance-close.yml @@ -65,6 +65,15 @@ jobs: body: closeMessage, }); + try { + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: item.number, + name: 'needs:compliance', + }); + } catch (e) {} + if (isPR) { await github.rest.pulls.update({ owner: context.repo.owner, diff --git a/.github/workflows/pr-standards.yml b/.github/workflows/pr-standards.yml index 27581d06b768..1edbd5d061dc 100644 --- a/.github/workflows/pr-standards.yml +++ b/.github/workflows/pr-standards.yml @@ -108,11 +108,11 @@ jobs: await removeLabel('needs:title'); - // Step 2: Check for linked issue (skip for docs/refactor PRs) - const skipIssueCheck = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title); + // Step 2: Check for linked issue (skip for docs/refactor/feat PRs) + const skipIssueCheck = /^(docs|refactor|feat)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title); if (skipIssueCheck) { await removeLabel('needs:issue'); - console.log('Skipping issue check for docs/refactor PR'); + console.log('Skipping issue check for docs/refactor/feat PR'); return; } const query = ` @@ -189,7 +189,7 @@ jobs: const body = pr.body || ''; const title = pr.title; - const isDocsOrRefactor = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title); + const isDocsRefactorOrFeat = /^(docs|refactor|feat)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title); const issues = []; @@ -225,8 +225,8 @@ jobs: } } - // Check: issue reference (skip for docs/refactor) - if (!isDocsOrRefactor && hasIssueSection) { + // Check: issue reference (skip for docs/refactor/feat) + if (!isDocsRefactorOrFeat && hasIssueSection) { const issueMatch = body.match(/### Issue for this PR\s*\n([\s\S]*?)(?=###|$)/); const issueContent = issueMatch ? issueMatch[1].trim() : ''; const hasIssueRef = /(closes|fixes|resolves)\s+#\d+/i.test(issueContent) || /#\d+/.test(issueContent); From ad5f0816a33d323f2a7e6a6228136fa6a6c4b056 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:13:31 +1000 Subject: [PATCH 21/95] fix(cicd): flakey typecheck (#14828) --- turbo.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index f06ddb0e8b76..ba3d01d3603b 100644 --- a/turbo.json +++ b/turbo.json @@ -3,7 +3,9 @@ "globalEnv": ["CI", "OPENCODE_DISABLE_SHARE"], "globalPassThroughEnv": ["CI", "OPENCODE_DISABLE_SHARE"], "tasks": { - "typecheck": {}, + "typecheck": { + "dependsOn": ["^build"] + }, "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] From 34495a70d5069355bbad95c95625818afa677eb1 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:15:25 +1000 Subject: [PATCH 22/95] fix(win32): scripts/turbo commands would not run (#14829) --- packages/plugin/script/publish.ts | 3 ++- packages/sdk/js/package.json | 2 +- packages/sdk/js/script/build.ts | 3 ++- packages/sdk/js/script/publish.ts | 3 ++- script/publish.ts | 5 +++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/plugin/script/publish.ts b/packages/plugin/script/publish.ts index 647b56e5e2dd..d2fe49f23ce3 100755 --- a/packages/plugin/script/publish.ts +++ b/packages/plugin/script/publish.ts @@ -1,8 +1,9 @@ #!/usr/bin/env bun import { Script } from "@opencode-ai/script" import { $ } from "bun" +import { fileURLToPath } from "url" -const dir = new URL("..", import.meta.url).pathname +const dir = fileURLToPath(new URL("..", import.meta.url)) process.chdir(dir) await $`bun tsc` diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json index 4fe0794d0cea..bd3627e35b4c 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -6,7 +6,7 @@ "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit", - "build": "./script/build.ts" + "build": "bun ./script/build.ts" }, "exports": { ".": "./src/index.ts", diff --git a/packages/sdk/js/script/build.ts b/packages/sdk/js/script/build.ts index 7568c54b0f2a..268233a012e9 100755 --- a/packages/sdk/js/script/build.ts +++ b/packages/sdk/js/script/build.ts @@ -1,6 +1,7 @@ #!/usr/bin/env bun +import { fileURLToPath } from "url" -const dir = new URL("..", import.meta.url).pathname +const dir = fileURLToPath(new URL("..", import.meta.url)) process.chdir(dir) import { $ } from "bun" diff --git a/packages/sdk/js/script/publish.ts b/packages/sdk/js/script/publish.ts index c21f06230d18..ea5c5d634b2b 100755 --- a/packages/sdk/js/script/publish.ts +++ b/packages/sdk/js/script/publish.ts @@ -2,8 +2,9 @@ import { Script } from "@opencode-ai/script" import { $ } from "bun" +import { fileURLToPath } from "url" -const dir = new URL("..", import.meta.url).pathname +const dir = fileURLToPath(new URL("..", import.meta.url)) process.chdir(dir) const pkg = (await import("../package.json").then((m) => m.default)) as { diff --git a/script/publish.ts b/script/publish.ts index 8aa921daa834..b7ed5c8221ca 100755 --- a/script/publish.ts +++ b/script/publish.ts @@ -2,6 +2,7 @@ import { $ } from "bun" import { Script } from "@opencode-ai/script" +import { fileURLToPath } from "url" const highlightsTemplate = ` statement-breakpoint +ALTER TABLE `billing` ADD `lite_subscription_id` varchar(28);--> statement-breakpoint +ALTER TABLE `billing` ADD `lite` json; \ No newline at end of file diff --git a/packages/console/core/migrations/20260224043338_nifty_starjammers/snapshot.json b/packages/console/core/migrations/20260224043338_nifty_starjammers/snapshot.json new file mode 100644 index 000000000000..703ee233f30b --- /dev/null +++ b/packages/console/core/migrations/20260224043338_nifty_starjammers/snapshot.json @@ -0,0 +1,2505 @@ +{ + "version": "6", + "dialect": "mysql", + "id": "5e506dec-61e7-4726-81d1-afa4ffbc61ed", + "prevIds": [ + "4bf45b3f-3edd-4db7-94d5-097aa55ca5f7" + ], + "ddl": [ + { + "name": "account", + "entityType": "tables" + }, + { + "name": "auth", + "entityType": "tables" + }, + { + "name": "benchmark", + "entityType": "tables" + }, + { + "name": "billing", + "entityType": "tables" + }, + { + "name": "lite", + "entityType": "tables" + }, + { + "name": "payment", + "entityType": "tables" + }, + { + "name": "subscription", + "entityType": "tables" + }, + { + "name": "usage", + "entityType": "tables" + }, + { + "name": "ip_rate_limit", + "entityType": "tables" + }, + { + "name": "ip", + "entityType": "tables" + }, + { + "name": "key", + "entityType": "tables" + }, + { + "name": "model", + "entityType": "tables" + }, + { + "name": "provider", + "entityType": "tables" + }, + { + "name": "user", + "entityType": "tables" + }, + { + "name": "workspace", + "entityType": "tables" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "account" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "account" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "account" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "account" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "auth" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "auth" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "auth" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "auth" + }, + { + "type": "enum('email','github','google')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "entityType": "columns", + "table": "auth" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subject", + "entityType": "columns", + "table": "auth" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "entityType": "columns", + "table": "auth" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "agent", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "mediumtext", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "result", + "entityType": "columns", + "table": "benchmark" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(32)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_type", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(4)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_method_last4", + "entityType": "columns", + "table": "billing" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "balance", + "entityType": "columns", + "table": "billing" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "entityType": "columns", + "table": "billing" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "entityType": "columns", + "table": "billing" + }, + { + "type": "boolean", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload", + "entityType": "columns", + "table": "billing" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_trigger", + "entityType": "columns", + "table": "billing" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_amount", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reload_error", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_error", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_reload_locked_till", + "entityType": "columns", + "table": "billing" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "enum('20','100','200')", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "subscription_plan", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_booked", + "entityType": "columns", + "table": "billing" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_subscription_selected", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(28)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "lite_subscription_id", + "entityType": "columns", + "table": "billing" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "lite", + "entityType": "columns", + "table": "billing" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "lite" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "lite" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "lite" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "entityType": "columns", + "table": "lite" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "weekly_usage", + "entityType": "columns", + "table": "lite" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_weekly_updated", + "entityType": "columns", + "table": "lite" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_updated", + "entityType": "columns", + "table": "lite" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "customer_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "invoice_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "payment_id", + "entityType": "columns", + "table": "payment" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "amount", + "entityType": "columns", + "table": "payment" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_refunded", + "entityType": "columns", + "table": "payment" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "entityType": "columns", + "table": "payment" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "rolling_usage", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "fixed_usage", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_rolling_updated", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_fixed_updated", + "entityType": "columns", + "table": "subscription" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "usage" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "usage" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "input_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "output_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "reasoning_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_read_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_5m_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cache_write_1h_tokens", + "entityType": "columns", + "table": "usage" + }, + { + "type": "bigint", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "cost", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key_id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "session_id", + "entityType": "columns", + "table": "usage" + }, + { + "type": "json", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "enrichment", + "entityType": "columns", + "table": "usage" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "entityType": "columns", + "table": "ip_rate_limit" + }, + { + "type": "varchar(10)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "interval", + "entityType": "columns", + "table": "ip_rate_limit" + }, + { + "type": "int", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "count", + "entityType": "columns", + "table": "ip_rate_limit" + }, + { + "type": "varchar(45)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "ip", + "entityType": "columns", + "table": "ip" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "ip" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "ip" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "ip" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "usage", + "entityType": "columns", + "table": "ip" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "key", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "key" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_used", + "entityType": "columns", + "table": "key" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "model" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "model" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "model" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "model" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "model" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "model", + "entityType": "columns", + "table": "model" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "provider" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "provider" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "provider" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "provider" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "provider" + }, + { + "type": "varchar(64)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "provider", + "entityType": "columns", + "table": "provider" + }, + { + "type": "text", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "credentials", + "entityType": "columns", + "table": "provider" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "workspace_id", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(30)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "account_id", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "email", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_seen", + "entityType": "columns", + "table": "user" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "color", + "entityType": "columns", + "table": "user" + }, + { + "type": "enum('admin','member')", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "role", + "entityType": "columns", + "table": "user" + }, + { + "type": "int", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_limit", + "entityType": "columns", + "table": "user" + }, + { + "type": "bigint", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "monthly_usage", + "entityType": "columns", + "table": "user" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_monthly_usage_updated", + "entityType": "columns", + "table": "user" + }, + { + "type": "varchar(30)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "varchar(255)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "slug", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "varchar(255)", + "notNull": true, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(now())", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_created", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "timestamp(3)", + "notNull": true, + "autoIncrement": false, + "default": "(CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3))", + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_updated", + "entityType": "columns", + "table": "workspace" + }, + { + "type": "timestamp(3)", + "notNull": false, + "autoIncrement": false, + "default": null, + "onUpdateNow": false, + "onUpdateNowFsp": null, + "charSet": null, + "collation": null, + "generated": null, + "name": "time_deleted", + "entityType": "columns", + "table": "workspace" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "account", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "auth", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "benchmark", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "billing", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "lite", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "payment", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "subscription", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "usage", + "entityType": "pks" + }, + { + "columns": [ + "ip", + "interval" + ], + "name": "PRIMARY", + "table": "ip_rate_limit", + "entityType": "pks" + }, + { + "columns": [ + "ip" + ], + "name": "PRIMARY", + "table": "ip", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "key", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "model", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "provider", + "entityType": "pks" + }, + { + "columns": [ + "workspace_id", + "id" + ], + "name": "PRIMARY", + "table": "user", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "name": "PRIMARY", + "table": "workspace", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "provider", + "isExpression": false + }, + { + "value": "subject", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "provider", + "entityType": "indexes", + "table": "auth" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "account_id", + "entityType": "indexes", + "table": "auth" + }, + { + "columns": [ + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "time_created", + "entityType": "indexes", + "table": "benchmark" + }, + { + "columns": [ + { + "value": "customer_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_customer_id", + "entityType": "indexes", + "table": "billing" + }, + { + "columns": [ + { + "value": "subscription_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_subscription_id", + "entityType": "indexes", + "table": "billing" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "entityType": "indexes", + "table": "lite" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_user_id", + "entityType": "indexes", + "table": "subscription" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "time_created", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "usage_time_created", + "entityType": "indexes", + "table": "usage" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_key", + "entityType": "indexes", + "table": "key" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "model", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "model_workspace_model", + "entityType": "indexes", + "table": "model" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "provider", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "workspace_provider", + "entityType": "indexes", + "table": "provider" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_account_id", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "workspace_id", + "isExpression": false + }, + { + "value": "email", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "user_email", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "account_id", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_account_id", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "email", + "isExpression": false + } + ], + "isUnique": false, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "global_email", + "entityType": "indexes", + "table": "user" + }, + { + "columns": [ + { + "value": "slug", + "isExpression": false + } + ], + "isUnique": true, + "using": null, + "algorithm": null, + "lock": null, + "nameExplicit": true, + "name": "slug", + "entityType": "indexes", + "table": "workspace" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/packages/console/core/script/black-select-workspaces.ts b/packages/console/core/script/black-select-workspaces.ts index f22478e1b3d9..63bfab887503 100644 --- a/packages/console/core/script/black-select-workspaces.ts +++ b/packages/console/core/script/black-select-workspaces.ts @@ -1,10 +1,10 @@ import { Database, eq, and, sql, inArray, isNull, count } from "../src/drizzle/index.js" -import { BillingTable, SubscriptionPlan } from "../src/schema/billing.sql.js" +import { BillingTable, BlackPlans } from "../src/schema/billing.sql.js" import { UserTable } from "../src/schema/user.sql.js" import { AuthTable } from "../src/schema/auth.sql.js" -const plan = process.argv[2] as (typeof SubscriptionPlan)[number] -if (!SubscriptionPlan.includes(plan)) { +const plan = process.argv[2] as (typeof BlackPlans)[number] +if (!BlackPlans.includes(plan)) { console.error("Usage: bun foo.ts ") process.exit(1) } diff --git a/packages/console/core/script/lookup-user.ts b/packages/console/core/script/lookup-user.ts index 6367fd89a4ae..0dfda24116d0 100644 --- a/packages/console/core/script/lookup-user.ts +++ b/packages/console/core/script/lookup-user.ts @@ -1,13 +1,7 @@ import { Database, and, eq, sql } from "../src/drizzle/index.js" import { AuthTable } from "../src/schema/auth.sql.js" import { UserTable } from "../src/schema/user.sql.js" -import { - BillingTable, - PaymentTable, - SubscriptionTable, - SubscriptionPlan, - UsageTable, -} from "../src/schema/billing.sql.js" +import { BillingTable, PaymentTable, SubscriptionTable, BlackPlans, UsageTable } from "../src/schema/billing.sql.js" import { WorkspaceTable } from "../src/schema/workspace.sql.js" import { BlackData } from "../src/black.js" import { centsToMicroCents } from "../src/util/price.js" @@ -235,7 +229,7 @@ function formatRetryTime(seconds: number) { function getSubscriptionStatus(row: { subscription: { - plan: (typeof SubscriptionPlan)[number] + plan: (typeof BlackPlans)[number] } | null timeSubscriptionCreated: Date | null fixedUsage: number | null diff --git a/packages/console/core/src/billing.ts b/packages/console/core/src/billing.ts index 2c1cdb0687bb..fcf238a35385 100644 --- a/packages/console/core/src/billing.ts +++ b/packages/console/core/src/billing.ts @@ -1,6 +1,6 @@ import { Stripe } from "stripe" import { Database, eq, sql } from "./drizzle" -import { BillingTable, PaymentTable, SubscriptionTable, UsageTable } from "./schema/billing.sql" +import { BillingTable, LiteTable, PaymentTable, SubscriptionTable, UsageTable } from "./schema/billing.sql" import { Actor } from "./actor" import { fn } from "./util/fn" import { z } from "zod" @@ -9,6 +9,7 @@ import { Identifier } from "./identifier" import { centsToMicroCents } from "./util/price" import { User } from "./user" import { BlackData } from "./black" +import { LiteData } from "./lite" export namespace Billing { export const ITEM_CREDIT_NAME = "opencode credits" @@ -233,6 +234,56 @@ export namespace Billing { }, ) + export const generateLiteCheckoutUrl = fn( + z.object({ + successUrl: z.string(), + cancelUrl: z.string(), + }), + async (input) => { + const user = Actor.assert("user") + const { successUrl, cancelUrl } = input + + const email = await User.getAuthEmail(user.properties.userID) + const billing = await Billing.get() + + if (billing.subscriptionID) throw new Error("Already subscribed to Black") + if (billing.liteSubscriptionID) throw new Error("Already subscribed to Lite") + + const session = await Billing.stripe().checkout.sessions.create({ + mode: "subscription", + billing_address_collection: "required", + line_items: [{ price: LiteData.priceID(), quantity: 1 }], + ...(billing.customerID + ? { + customer: billing.customerID, + customer_update: { + name: "auto", + address: "auto", + }, + } + : { + customer_email: email!, + }), + currency: "usd", + payment_method_types: ["card"], + tax_id_collection: { + enabled: true, + }, + success_url: successUrl, + cancel_url: cancelUrl, + subscription_data: { + metadata: { + workspaceID: Actor.workspace(), + userID: user.properties.userID, + type: "lite", + }, + }, + }) + + return session.url + }, + ) + export const generateSessionUrl = fn( z.object({ returnUrl: z.string(), @@ -271,7 +322,7 @@ export namespace Billing { }, ) - export const subscribe = fn( + export const subscribeBlack = fn( z.object({ seats: z.number(), coupon: z.string().optional(), @@ -336,7 +387,7 @@ export namespace Billing { }, ) - export const unsubscribe = fn( + export const unsubscribeBlack = fn( z.object({ subscriptionID: z.string(), }), @@ -360,4 +411,29 @@ export namespace Billing { }) }, ) + + export const unsubscribeLite = fn( + z.object({ + subscriptionID: z.string(), + }), + async ({ subscriptionID }) => { + const workspaceID = await Database.use((tx) => + tx + .select({ workspaceID: BillingTable.workspaceID }) + .from(BillingTable) + .where(eq(BillingTable.liteSubscriptionID, subscriptionID)) + .then((rows) => rows[0]?.workspaceID), + ) + if (!workspaceID) throw new Error("Workspace ID not found for subscription") + + await Database.transaction(async (tx) => { + await tx + .update(BillingTable) + .set({ liteSubscriptionID: null, lite: null }) + .where(eq(BillingTable.workspaceID, workspaceID)) + + await tx.delete(LiteTable).where(eq(LiteTable.workspaceID, workspaceID)) + }) + }, + ) } diff --git a/packages/console/core/src/black.ts b/packages/console/core/src/black.ts index b4cc27064630..a18c5258d04a 100644 --- a/packages/console/core/src/black.ts +++ b/packages/console/core/src/black.ts @@ -1,7 +1,7 @@ import { z } from "zod" import { fn } from "./util/fn" import { Resource } from "@opencode-ai/console-resource" -import { SubscriptionPlan } from "./schema/billing.sql" +import { BlackPlans } from "./schema/billing.sql" export namespace BlackData { const Schema = z.object({ @@ -28,7 +28,7 @@ export namespace BlackData { export const getLimits = fn( z.object({ - plan: z.enum(SubscriptionPlan), + plan: z.enum(BlackPlans), }), ({ plan }) => { const json = JSON.parse(Resource.ZEN_BLACK_LIMITS.value) @@ -36,9 +36,11 @@ export namespace BlackData { }, ) + export const productID = fn(z.void(), () => Resource.ZEN_BLACK_PRICE.product) + export const planToPriceID = fn( z.object({ - plan: z.enum(SubscriptionPlan), + plan: z.enum(BlackPlans), }), ({ plan }) => { if (plan === "200") return Resource.ZEN_BLACK_PRICE.plan200 diff --git a/packages/console/core/src/identifier.ts b/packages/console/core/src/identifier.ts index b10bf32f6f1f..8aa324ba07f9 100644 --- a/packages/console/core/src/identifier.ts +++ b/packages/console/core/src/identifier.ts @@ -8,6 +8,7 @@ export namespace Identifier { benchmark: "ben", billing: "bil", key: "key", + lite: "lit", model: "mod", payment: "pay", provider: "prv", diff --git a/packages/console/core/src/lite.ts b/packages/console/core/src/lite.ts index d6679208d856..49d23e59ec09 100644 --- a/packages/console/core/src/lite.ts +++ b/packages/console/core/src/lite.ts @@ -4,9 +4,10 @@ import { Resource } from "@opencode-ai/console-resource" export namespace LiteData { const Schema = z.object({ - fixedLimit: z.number().int(), rollingLimit: z.number().int(), rollingWindow: z.number().int(), + weeklyLimit: z.number().int(), + monthlyLimit: z.number().int(), }) export const validate = fn(Schema, (input) => { @@ -18,11 +19,7 @@ export namespace LiteData { return Schema.parse(json) }) - export const planToPriceID = fn(z.void(), () => { - return Resource.ZEN_LITE_PRICE.price - }) - - export const priceIDToPlan = fn(z.void(), () => { - return "lite" - }) + export const productID = fn(z.void(), () => Resource.ZEN_LITE_PRICE.product) + export const priceID = fn(z.void(), () => Resource.ZEN_LITE_PRICE.price) + export const planName = fn(z.void(), () => "lite") } diff --git a/packages/console/core/src/schema/billing.sql.ts b/packages/console/core/src/schema/billing.sql.ts index 6d96fc7eb897..a5c70c211544 100644 --- a/packages/console/core/src/schema/billing.sql.ts +++ b/packages/console/core/src/schema/billing.sql.ts @@ -2,7 +2,7 @@ import { bigint, boolean, index, int, json, mysqlEnum, mysqlTable, uniqueIndex, import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types" import { workspaceIndexes } from "./workspace.sql" -export const SubscriptionPlan = ["20", "100", "200"] as const +export const BlackPlans = ["20", "100", "200"] as const export const BillingTable = mysqlTable( "billing", { @@ -25,14 +25,18 @@ export const BillingTable = mysqlTable( subscription: json("subscription").$type<{ status: "subscribed" seats: number - plan: "20" | "100" | "200" + plan: (typeof BlackPlans)[number] useBalance?: boolean coupon?: string }>(), subscriptionID: varchar("subscription_id", { length: 28 }), - subscriptionPlan: mysqlEnum("subscription_plan", SubscriptionPlan), + subscriptionPlan: mysqlEnum("subscription_plan", BlackPlans), timeSubscriptionBooked: utc("time_subscription_booked"), timeSubscriptionSelected: utc("time_subscription_selected"), + liteSubscriptionID: varchar("lite_subscription_id", { length: 28 }), + lite: json("lite").$type<{ + useBalance?: boolean + }>(), }, (table) => [ ...workspaceIndexes(table), @@ -55,6 +59,22 @@ export const SubscriptionTable = mysqlTable( (table) => [...workspaceIndexes(table), uniqueIndex("workspace_user_id").on(table.workspaceID, table.userID)], ) +export const LiteTable = mysqlTable( + "lite", + { + ...workspaceColumns, + ...timestamps, + userID: ulid("user_id").notNull(), + rollingUsage: bigint("rolling_usage", { mode: "number" }), + weeklyUsage: bigint("weekly_usage", { mode: "number" }), + monthlyUsage: bigint("monthly_usage", { mode: "number" }), + timeRollingUpdated: utc("time_rolling_updated"), + timeWeeklyUpdated: utc("time_weekly_updated"), + timeMonthlyUpdated: utc("time_monthly_updated"), + }, + (table) => [...workspaceIndexes(table), uniqueIndex("workspace_user_id").on(table.workspaceID, table.userID)], +) + export const PaymentTable = mysqlTable( "payment", { diff --git a/packages/console/core/src/subscription.ts b/packages/console/core/src/subscription.ts index ca3b17042242..879f940e0ebc 100644 --- a/packages/console/core/src/subscription.ts +++ b/packages/console/core/src/subscription.ts @@ -1,7 +1,7 @@ import { z } from "zod" import { fn } from "./util/fn" import { centsToMicroCents } from "./util/price" -import { getWeekBounds } from "./util/date" +import { getWeekBounds, getMonthlyBounds } from "./util/date" export namespace Subscription { export const analyzeRollingUsage = fn( @@ -29,7 +29,7 @@ export namespace Subscription { return { status: "ok" as const, resetInSec: Math.ceil((windowEnd.getTime() - now.getTime()) / 1000), - usagePercent: Math.ceil(Math.min(100, (usage / rollingLimitInMicroCents) * 100)), + usagePercent: Math.floor(Math.min(100, (usage / rollingLimitInMicroCents) * 100)), } } return { @@ -61,7 +61,7 @@ export namespace Subscription { return { status: "ok" as const, resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), - usagePercent: Math.ceil(Math.min(100, (usage / fixedLimitInMicroCents) * 100)), + usagePercent: Math.floor(Math.min(100, (usage / fixedLimitInMicroCents) * 100)), } } @@ -72,4 +72,38 @@ export namespace Subscription { } }, ) + + export const analyzeMonthlyUsage = fn( + z.object({ + limit: z.number().int(), + usage: z.number().int(), + timeUpdated: z.date(), + timeSubscribed: z.date(), + }), + ({ limit, usage, timeUpdated, timeSubscribed }) => { + const now = new Date() + const month = getMonthlyBounds(now, timeSubscribed) + const fixedLimitInMicroCents = centsToMicroCents(limit * 100) + if (timeUpdated < month.start) { + return { + status: "ok" as const, + resetInSec: Math.ceil((month.end.getTime() - now.getTime()) / 1000), + usagePercent: 0, + } + } + if (usage < fixedLimitInMicroCents) { + return { + status: "ok" as const, + resetInSec: Math.ceil((month.end.getTime() - now.getTime()) / 1000), + usagePercent: Math.floor(Math.min(100, (usage / fixedLimitInMicroCents) * 100)), + } + } + + return { + status: "rate-limited" as const, + resetInSec: Math.ceil((month.end.getTime() - now.getTime()) / 1000), + usagePercent: 100, + } + }, + ) } diff --git a/packages/console/core/src/util/date.test.ts b/packages/console/core/src/util/date.test.ts deleted file mode 100644 index 074df8a2fad5..000000000000 --- a/packages/console/core/src/util/date.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { describe, expect, test } from "bun:test" -import { getWeekBounds } from "./date" - -describe("util.date.getWeekBounds", () => { - test("returns a Monday-based week for Sunday dates", () => { - const date = new Date("2026-01-18T12:00:00Z") - const bounds = getWeekBounds(date) - - expect(bounds.start.toISOString()).toBe("2026-01-12T00:00:00.000Z") - expect(bounds.end.toISOString()).toBe("2026-01-19T00:00:00.000Z") - }) - - test("returns a seven day window", () => { - const date = new Date("2026-01-14T12:00:00Z") - const bounds = getWeekBounds(date) - - const span = bounds.end.getTime() - bounds.start.getTime() - expect(span).toBe(7 * 24 * 60 * 60 * 1000) - }) -}) diff --git a/packages/console/core/src/util/date.ts b/packages/console/core/src/util/date.ts index 9c1ab12d2c95..dea9c390e06a 100644 --- a/packages/console/core/src/util/date.ts +++ b/packages/console/core/src/util/date.ts @@ -7,3 +7,32 @@ export function getWeekBounds(date: Date) { end.setUTCDate(start.getUTCDate() + 7) return { start, end } } + +export function getMonthlyBounds(now: Date, subscribed: Date) { + const day = subscribed.getUTCDate() + const hh = subscribed.getUTCHours() + const mm = subscribed.getUTCMinutes() + const ss = subscribed.getUTCSeconds() + const ms = subscribed.getUTCMilliseconds() + + function anchor(year: number, month: number) { + const max = new Date(Date.UTC(year, month + 1, 0)).getUTCDate() + return new Date(Date.UTC(year, month, Math.min(day, max), hh, mm, ss, ms)) + } + + function shift(year: number, month: number, delta: number) { + const total = year * 12 + month + delta + return [Math.floor(total / 12), ((total % 12) + 12) % 12] as const + } + + let y = now.getUTCFullYear() + let m = now.getUTCMonth() + let start = anchor(y, m) + if (start > now) { + ;[y, m] = shift(y, m, -1) + start = anchor(y, m) + } + const [ny, nm] = shift(y, m, 1) + const end = anchor(ny, nm) + return { start, end } +} diff --git a/packages/console/core/test/date.test.ts b/packages/console/core/test/date.test.ts new file mode 100644 index 000000000000..e5a0a90e551b --- /dev/null +++ b/packages/console/core/test/date.test.ts @@ -0,0 +1,76 @@ +import { describe, expect, test } from "bun:test" +import { getWeekBounds, getMonthlyBounds } from "../src/util/date" + +describe("util.date.getWeekBounds", () => { + test("returns a Monday-based week for Sunday dates", () => { + const date = new Date("2026-01-18T12:00:00Z") + const bounds = getWeekBounds(date) + + expect(bounds.start.toISOString()).toBe("2026-01-12T00:00:00.000Z") + expect(bounds.end.toISOString()).toBe("2026-01-19T00:00:00.000Z") + }) + + test("returns a seven day window", () => { + const date = new Date("2026-01-14T12:00:00Z") + const bounds = getWeekBounds(date) + + const span = bounds.end.getTime() - bounds.start.getTime() + expect(span).toBe(7 * 24 * 60 * 60 * 1000) + }) +}) + +describe("util.date.getMonthlyBounds", () => { + test("resets on subscription day mid-month", () => { + const now = new Date("2026-03-20T10:00:00Z") + const subscribed = new Date("2026-01-15T08:00:00Z") + const bounds = getMonthlyBounds(now, subscribed) + + expect(bounds.start.toISOString()).toBe("2026-03-15T08:00:00.000Z") + expect(bounds.end.toISOString()).toBe("2026-04-15T08:00:00.000Z") + }) + + test("before subscription day in current month uses previous month anchor", () => { + const now = new Date("2026-03-10T10:00:00Z") + const subscribed = new Date("2026-01-15T08:00:00Z") + const bounds = getMonthlyBounds(now, subscribed) + + expect(bounds.start.toISOString()).toBe("2026-02-15T08:00:00.000Z") + expect(bounds.end.toISOString()).toBe("2026-03-15T08:00:00.000Z") + }) + + test("clamps day for short months", () => { + const now = new Date("2026-03-01T10:00:00Z") + const subscribed = new Date("2026-01-31T12:00:00Z") + const bounds = getMonthlyBounds(now, subscribed) + + expect(bounds.start.toISOString()).toBe("2026-02-28T12:00:00.000Z") + expect(bounds.end.toISOString()).toBe("2026-03-31T12:00:00.000Z") + }) + + test("handles subscription on the 1st", () => { + const now = new Date("2026-04-15T00:00:00Z") + const subscribed = new Date("2026-01-01T00:00:00Z") + const bounds = getMonthlyBounds(now, subscribed) + + expect(bounds.start.toISOString()).toBe("2026-04-01T00:00:00.000Z") + expect(bounds.end.toISOString()).toBe("2026-05-01T00:00:00.000Z") + }) + + test("exactly on the reset boundary uses current period", () => { + const now = new Date("2026-03-15T08:00:00Z") + const subscribed = new Date("2026-01-15T08:00:00Z") + const bounds = getMonthlyBounds(now, subscribed) + + expect(bounds.start.toISOString()).toBe("2026-03-15T08:00:00.000Z") + expect(bounds.end.toISOString()).toBe("2026-04-15T08:00:00.000Z") + }) + + test("february to march with day 30 subscription", () => { + const now = new Date("2026-02-15T06:00:00Z") + const subscribed = new Date("2025-12-30T06:00:00Z") + const bounds = getMonthlyBounds(now, subscribed) + + expect(bounds.start.toISOString()).toBe("2026-01-30T06:00:00.000Z") + expect(bounds.end.toISOString()).toBe("2026-02-28T06:00:00.000Z") + }) +}) diff --git a/packages/console/core/test/subscription.test.ts b/packages/console/core/test/subscription.test.ts new file mode 100644 index 000000000000..57e63f94c41b --- /dev/null +++ b/packages/console/core/test/subscription.test.ts @@ -0,0 +1,106 @@ +import { describe, expect, test, setSystemTime, afterEach } from "bun:test" +import { Subscription } from "../src/subscription" +import { centsToMicroCents } from "../src/util/price" + +afterEach(() => { + setSystemTime() +}) + +describe("Subscription.analyzeMonthlyUsage", () => { + const subscribed = new Date("2026-01-15T08:00:00Z") + + test("returns ok with 0% when usage was last updated before current period", () => { + setSystemTime(new Date("2026-03-20T10:00:00Z")) + const result = Subscription.analyzeMonthlyUsage({ + limit: 10, + usage: centsToMicroCents(500), + timeUpdated: new Date("2026-02-10T00:00:00Z"), + timeSubscribed: subscribed, + }) + + expect(result.status).toBe("ok") + expect(result.usagePercent).toBe(0) + // reset should be seconds until 2026-04-15T08:00:00Z + const expected = Math.ceil( + (new Date("2026-04-15T08:00:00Z").getTime() - new Date("2026-03-20T10:00:00Z").getTime()) / 1000, + ) + expect(result.resetInSec).toBe(expected) + }) + + test("returns ok with usage percent when under limit", () => { + setSystemTime(new Date("2026-03-20T10:00:00Z")) + const limit = 10 // $10 + const half = centsToMicroCents(10 * 100) / 2 + const result = Subscription.analyzeMonthlyUsage({ + limit, + usage: half, + timeUpdated: new Date("2026-03-18T00:00:00Z"), + timeSubscribed: subscribed, + }) + + expect(result.status).toBe("ok") + expect(result.usagePercent).toBe(50) + }) + + test("returns rate-limited when at or over limit", () => { + setSystemTime(new Date("2026-03-20T10:00:00Z")) + const limit = 10 + const result = Subscription.analyzeMonthlyUsage({ + limit, + usage: centsToMicroCents(limit * 100), + timeUpdated: new Date("2026-03-18T00:00:00Z"), + timeSubscribed: subscribed, + }) + + expect(result.status).toBe("rate-limited") + expect(result.usagePercent).toBe(100) + }) + + test("resets usage when crossing monthly boundary", () => { + // subscribed on 15th, now is April 16th — period is Apr 15 to May 15 + // timeUpdated is March 20 (previous period) + setSystemTime(new Date("2026-04-16T10:00:00Z")) + const result = Subscription.analyzeMonthlyUsage({ + limit: 10, + usage: centsToMicroCents(10 * 100), + timeUpdated: new Date("2026-03-20T00:00:00Z"), + timeSubscribed: subscribed, + }) + + expect(result.status).toBe("ok") + expect(result.usagePercent).toBe(0) + }) + + test("caps usage percent at 100", () => { + setSystemTime(new Date("2026-03-20T10:00:00Z")) + const limit = 10 + const result = Subscription.analyzeMonthlyUsage({ + limit, + usage: centsToMicroCents(limit * 100) - 1, + timeUpdated: new Date("2026-03-18T00:00:00Z"), + timeSubscribed: subscribed, + }) + + expect(result.status).toBe("ok") + expect(result.usagePercent).toBeLessThanOrEqual(100) + }) + + test("handles subscription day 31 in short month", () => { + const sub31 = new Date("2026-01-31T12:00:00Z") + // now is March 1 — period should be Feb 28 to Mar 31 + setSystemTime(new Date("2026-03-01T10:00:00Z")) + const result = Subscription.analyzeMonthlyUsage({ + limit: 10, + usage: 0, + timeUpdated: new Date("2026-03-01T09:00:00Z"), + timeSubscribed: sub31, + }) + + expect(result.status).toBe("ok") + expect(result.usagePercent).toBe(0) + const expected = Math.ceil( + (new Date("2026-03-31T12:00:00Z").getTime() - new Date("2026-03-01T10:00:00Z").getTime()) / 1000, + ) + expect(result.resetInSec).toBe(expected) + }) +}) From 744059a00f06ab20369cf4ce71072b41302e2f35 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Tue, 24 Feb 2026 09:47:20 +0000 Subject: [PATCH 31/95] chore: generate --- .../snapshot.json | 76 +++++-------------- 1 file changed, 17 insertions(+), 59 deletions(-) diff --git a/packages/console/core/migrations/20260224043338_nifty_starjammers/snapshot.json b/packages/console/core/migrations/20260224043338_nifty_starjammers/snapshot.json index 703ee233f30b..bc20ee2b964f 100644 --- a/packages/console/core/migrations/20260224043338_nifty_starjammers/snapshot.json +++ b/packages/console/core/migrations/20260224043338_nifty_starjammers/snapshot.json @@ -2,9 +2,7 @@ "version": "6", "dialect": "mysql", "id": "5e506dec-61e7-4726-81d1-afa4ffbc61ed", - "prevIds": [ - "4bf45b3f-3edd-4db7-94d5-097aa55ca5f7" - ], + "prevIds": ["4bf45b3f-3edd-4db7-94d5-097aa55ca5f7"], "ddl": [ { "name": "account", @@ -2083,131 +2081,91 @@ "table": "workspace" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "account", "entityType": "pks" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "auth", "entityType": "pks" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "benchmark", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "billing", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "lite", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "payment", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "subscription", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "usage", "entityType": "pks" }, { - "columns": [ - "ip", - "interval" - ], + "columns": ["ip", "interval"], "name": "PRIMARY", "table": "ip_rate_limit", "entityType": "pks" }, { - "columns": [ - "ip" - ], + "columns": ["ip"], "name": "PRIMARY", "table": "ip", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "key", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "model", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "provider", "entityType": "pks" }, { - "columns": [ - "workspace_id", - "id" - ], + "columns": ["workspace_id", "id"], "name": "PRIMARY", "table": "user", "entityType": "pks" }, { - "columns": [ - "id" - ], + "columns": ["id"], "name": "PRIMARY", "table": "workspace", "entityType": "pks" @@ -2502,4 +2460,4 @@ } ], "renames": [] -} \ No newline at end of file +} From a592bd968454f0b8c55733f7a8df85e38a293de5 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 19:56:41 +1000 Subject: [PATCH 32/95] fix: update createOpenReviewFile test to match new call order (#14881) --- packages/app/src/pages/session/helpers.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/pages/session/helpers.test.ts b/packages/app/src/pages/session/helpers.test.ts index 7d357e6572c5..aaa5b932fe96 100644 --- a/packages/app/src/pages/session/helpers.test.ts +++ b/packages/app/src/pages/session/helpers.test.ts @@ -16,7 +16,7 @@ describe("createOpenReviewFile", () => { openReviewFile("src/a.ts") - expect(calls).toEqual(["show", "tab:src/a.ts", "open:file://src/a.ts", "load:src/a.ts"]) + expect(calls).toEqual(["show", "load:src/a.ts", "tab:src/a.ts", "open:file://src/a.ts"]) }) }) From de796d9a00544001fe196d9a3068ea241165293a Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 20:07:56 +1000 Subject: [PATCH 33/95] fix(test): use path.join for cross-platform glob test assertions (#14837) --- packages/opencode/test/util/glob.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/opencode/test/util/glob.test.ts b/packages/opencode/test/util/glob.test.ts index ae1bcdcf82e0..e58d92c85c64 100644 --- a/packages/opencode/test/util/glob.test.ts +++ b/packages/opencode/test/util/glob.test.ts @@ -63,7 +63,7 @@ describe("Glob", () => { const results = await Glob.scan("**/*.txt", { cwd: tmp.path }) - expect(results).toEqual(["nested/deep.txt"]) + expect(results).toEqual([path.join("nested", "deep.txt")]) }) test("returns empty array for no matches", async () => { @@ -82,7 +82,7 @@ describe("Glob", () => { const results = await Glob.scan("**/*.txt", { cwd: tmp.path }) - expect(results).toEqual(["realdir/file.txt"]) + expect(results).toEqual([path.join("realdir", "file.txt")]) }) test("follows symlinks when symlink option is true", async () => { @@ -93,7 +93,7 @@ describe("Glob", () => { const results = await Glob.scan("**/*.txt", { cwd: tmp.path, symlink: true }) - expect(results.sort()).toEqual(["linkdir/file.txt", "realdir/file.txt"]) + expect(results.sort()).toEqual([path.join("linkdir", "file.txt"), path.join("realdir", "file.txt")]) }) test("includes dotfiles when dot option is true", async () => { From 3201a7d34b03210f108e6caf49f20260d531a1a6 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 20:25:15 +1000 Subject: [PATCH 34/95] fix(win32): add bun prefix to console app build scripts (#14884) --- packages/console/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console/app/package.json b/packages/console/app/package.json index 904aeadd8e06..395feeb4af5c 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -7,7 +7,7 @@ "typecheck": "tsgo --noEmit", "dev": "vite dev --host 0.0.0.0", "dev:remote": "VITE_AUTH_URL=https://auth.dev.opencode.ai VITE_STRIPE_PUBLISHABLE_KEY=pk_test_51RtuLNE7fOCwHSD4mewwzFejyytjdGoSDK7CAvhbffwaZnPbNb2rwJICw6LTOXCmWO320fSNXvb5NzI08RZVkAxd00syfqrW7t bun sst shell --stage=dev bun dev", - "build": "./script/generate-sitemap.ts && vite build && ../../opencode/script/schema.ts ./.output/public/config.json", + "build": "bun ./script/generate-sitemap.ts && vite build && bun ../../opencode/script/schema.ts ./.output/public/config.json", "start": "vite start" }, "dependencies": { From 659068942eda0e48f8453d96b03724cfb1f9698d Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 20:33:22 +1000 Subject: [PATCH 35/95] fix(win32): handle CRLF line endings in markdown frontmatter parsing (#14886) --- packages/opencode/src/config/markdown.ts | 2 +- packages/opencode/test/config/markdown.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/config/markdown.ts b/packages/opencode/src/config/markdown.ts index 5b4ccf047710..3c9709b5b3bf 100644 --- a/packages/opencode/src/config/markdown.ts +++ b/packages/opencode/src/config/markdown.ts @@ -22,7 +22,7 @@ export namespace ConfigMarkdown { if (!match) return content const frontmatter = match[1] - const lines = frontmatter.split("\n") + const lines = frontmatter.split(/\r?\n/) const result: string[] = [] for (const line of lines) { diff --git a/packages/opencode/test/config/markdown.test.ts b/packages/opencode/test/config/markdown.test.ts index c6133317e2c0..865af2107738 100644 --- a/packages/opencode/test/config/markdown.test.ts +++ b/packages/opencode/test/config/markdown.test.ts @@ -197,7 +197,7 @@ describe("ConfigMarkdown: frontmatter parsing w/ Markdown header", async () => { test("should parse and match", () => { expect(result).toBeDefined() expect(result.data).toEqual({}) - expect(result.content.trim()).toBe(`# Response Formatting Requirements + expect(result.content.trim().replace(/\r\n/g, "\n")).toBe(`# Response Formatting Requirements Always structure your responses using clear markdown formatting: From 13cabae29f7ed2bd658037c0c676f7807d63d8b3 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 21:14:16 +1000 Subject: [PATCH 36/95] fix(win32): add git flags for snapshot operations and fix tests for cross-platform (#14890) --- packages/opencode/src/snapshot/index.ts | 33 ++++--- packages/opencode/test/preload.ts | 2 +- .../opencode/test/snapshot/snapshot.test.ts | 86 ++++++++++--------- 3 files changed, 67 insertions(+), 54 deletions(-) diff --git a/packages/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.ts index 833999e7615e..cf254b4cef74 100644 --- a/packages/opencode/src/snapshot/index.ts +++ b/packages/opencode/src/snapshot/index.ts @@ -64,6 +64,9 @@ export namespace Snapshot { .nothrow() // Configure git to not convert line endings on Windows await $`git --git-dir ${git} config core.autocrlf false`.quiet().nothrow() + await $`git --git-dir ${git} config core.longpaths true`.quiet().nothrow() + await $`git --git-dir ${git} config core.symlinks true`.quiet().nothrow() + await $`git --git-dir ${git} config core.fsmonitor false`.quiet().nothrow() log.info("initialized") } await add(git) @@ -86,7 +89,7 @@ export namespace Snapshot { const git = gitdir() await add(git) const result = - await $`git -c core.autocrlf=false -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff --name-only ${hash} -- .` + await $`git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff --name-only ${hash} -- .` .quiet() .cwd(Instance.directory) .nothrow() @@ -113,7 +116,7 @@ export namespace Snapshot { log.info("restore", { commit: snapshot }) const git = gitdir() const result = - await $`git --git-dir ${git} --work-tree ${Instance.worktree} read-tree ${snapshot} && git --git-dir ${git} --work-tree ${Instance.worktree} checkout-index -a -f` + await $`git -c core.longpaths=true -c core.symlinks=true --git-dir ${git} --work-tree ${Instance.worktree} read-tree ${snapshot} && git -c core.longpaths=true -c core.symlinks=true --git-dir ${git} --work-tree ${Instance.worktree} checkout-index -a -f` .quiet() .cwd(Instance.worktree) .nothrow() @@ -135,14 +138,15 @@ export namespace Snapshot { for (const file of item.files) { if (files.has(file)) continue log.info("reverting", { file, hash: item.hash }) - const result = await $`git --git-dir ${git} --work-tree ${Instance.worktree} checkout ${item.hash} -- ${file}` - .quiet() - .cwd(Instance.worktree) - .nothrow() + const result = + await $`git -c core.longpaths=true -c core.symlinks=true --git-dir ${git} --work-tree ${Instance.worktree} checkout ${item.hash} -- ${file}` + .quiet() + .cwd(Instance.worktree) + .nothrow() if (result.exitCode !== 0) { const relativePath = path.relative(Instance.worktree, file) const checkTree = - await $`git --git-dir ${git} --work-tree ${Instance.worktree} ls-tree ${item.hash} -- ${relativePath}` + await $`git -c core.longpaths=true -c core.symlinks=true --git-dir ${git} --work-tree ${Instance.worktree} ls-tree ${item.hash} -- ${relativePath}` .quiet() .cwd(Instance.worktree) .nothrow() @@ -164,7 +168,7 @@ export namespace Snapshot { const git = gitdir() await add(git) const result = - await $`git -c core.autocrlf=false -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff ${hash} -- .` + await $`git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff ${hash} -- .` .quiet() .cwd(Instance.worktree) .nothrow() @@ -201,7 +205,7 @@ export namespace Snapshot { const status = new Map() const statuses = - await $`git -c core.autocrlf=false -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff --name-status --no-renames ${from} ${to} -- .` + await $`git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff --name-status --no-renames ${from} ${to} -- .` .quiet() .cwd(Instance.directory) .nothrow() @@ -215,7 +219,7 @@ export namespace Snapshot { status.set(file, kind) } - for await (const line of $`git -c core.autocrlf=false -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff --no-renames --numstat ${from} ${to} -- .` + for await (const line of $`git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true -c core.quotepath=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff --no-renames --numstat ${from} ${to} -- .` .quiet() .cwd(Instance.directory) .nothrow() @@ -225,13 +229,13 @@ export namespace Snapshot { const isBinaryFile = additions === "-" && deletions === "-" const before = isBinaryFile ? "" - : await $`git -c core.autocrlf=false --git-dir ${git} --work-tree ${Instance.worktree} show ${from}:${file}` + : await $`git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true --git-dir ${git} --work-tree ${Instance.worktree} show ${from}:${file}` .quiet() .nothrow() .text() const after = isBinaryFile ? "" - : await $`git -c core.autocrlf=false --git-dir ${git} --work-tree ${Instance.worktree} show ${to}:${file}` + : await $`git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true --git-dir ${git} --work-tree ${Instance.worktree} show ${to}:${file}` .quiet() .nothrow() .text() @@ -256,7 +260,10 @@ export namespace Snapshot { async function add(git: string) { await syncExclude(git) - await $`git --git-dir ${git} --work-tree ${Instance.worktree} add .`.quiet().cwd(Instance.directory).nothrow() + await $`git -c core.autocrlf=false -c core.longpaths=true -c core.symlinks=true --git-dir ${git} --work-tree ${Instance.worktree} add .` + .quiet() + .cwd(Instance.directory) + .nothrow() } async function syncExclude(git: string) { diff --git a/packages/opencode/test/preload.ts b/packages/opencode/test/preload.ts index dee7045707ea..a6d96cf17bd8 100644 --- a/packages/opencode/test/preload.ts +++ b/packages/opencode/test/preload.ts @@ -10,7 +10,7 @@ import { afterAll } from "bun:test" const dir = path.join(os.tmpdir(), "opencode-test-data-" + process.pid) await fs.mkdir(dir, { recursive: true }) afterAll(() => { - fsSync.rmSync(dir, { recursive: true, force: true }) + fsSync.rmSync(dir, { recursive: true, force: true, maxRetries: 3, retryDelay: 500 }) }) process.env["XDG_DATA_HOME"] = path.join(dir, "share") diff --git a/packages/opencode/test/snapshot/snapshot.test.ts b/packages/opencode/test/snapshot/snapshot.test.ts index 9a0622c4a5a1..79b1a83cd3a1 100644 --- a/packages/opencode/test/snapshot/snapshot.test.ts +++ b/packages/opencode/test/snapshot/snapshot.test.ts @@ -1,11 +1,17 @@ import { test, expect } from "bun:test" import { $ } from "bun" import fs from "fs/promises" +import path from "path" import { Snapshot } from "../../src/snapshot" import { Instance } from "../../src/project/instance" import { Filesystem } from "../../src/util/filesystem" import { tmpdir } from "../fixture/fixture" +// Git always outputs /-separated paths internally. Snapshot.patch() joins them +// with path.join (which produces \ on Windows) then normalizes back to /. +// This helper does the same for expected values so assertions match cross-platform. +const fwd = (...parts: string[]) => path.join(...parts).replaceAll("\\", "/") + async function bootstrap() { return tmpdir({ git: true, @@ -35,7 +41,7 @@ test("tracks deleted files correctly", async () => { await $`rm ${tmp.path}/a.txt`.quiet() - expect((await Snapshot.patch(before!)).files).toContain(`${tmp.path}/a.txt`) + expect((await Snapshot.patch(before!)).files).toContain(fwd(tmp.path, "a.txt")) }, }) }) @@ -143,7 +149,7 @@ test("binary file handling", async () => { await Filesystem.write(`${tmp.path}/image.png`, new Uint8Array([0x89, 0x50, 0x4e, 0x47])) const patch = await Snapshot.patch(before!) - expect(patch.files).toContain(`${tmp.path}/image.png`) + expect(patch.files).toContain(fwd(tmp.path, "image.png")) await Snapshot.revert([patch]) expect( @@ -164,9 +170,9 @@ test("symlink handling", async () => { const before = await Snapshot.track() expect(before).toBeTruthy() - await $`ln -s ${tmp.path}/a.txt ${tmp.path}/link.txt`.quiet() + await fs.symlink(`${tmp.path}/a.txt`, `${tmp.path}/link.txt`, "file") - expect((await Snapshot.patch(before!)).files).toContain(`${tmp.path}/link.txt`) + expect((await Snapshot.patch(before!)).files).toContain(fwd(tmp.path, "link.txt")) }, }) }) @@ -181,7 +187,7 @@ test("large file handling", async () => { await Filesystem.write(`${tmp.path}/large.txt`, "x".repeat(1024 * 1024)) - expect((await Snapshot.patch(before!)).files).toContain(`${tmp.path}/large.txt`) + expect((await Snapshot.patch(before!)).files).toContain(fwd(tmp.path, "large.txt")) }, }) }) @@ -222,9 +228,9 @@ test("special characters in filenames", async () => { await Filesystem.write(`${tmp.path}/file_with_underscores.txt`, "UNDERSCORES") const files = (await Snapshot.patch(before!)).files - expect(files).toContain(`${tmp.path}/file with spaces.txt`) - expect(files).toContain(`${tmp.path}/file-with-dashes.txt`) - expect(files).toContain(`${tmp.path}/file_with_underscores.txt`) + expect(files).toContain(fwd(tmp.path, "file with spaces.txt")) + expect(files).toContain(fwd(tmp.path, "file-with-dashes.txt")) + expect(files).toContain(fwd(tmp.path, "file_with_underscores.txt")) }, }) }) @@ -293,10 +299,10 @@ test("unicode filenames", async () => { expect(before).toBeTruthy() const unicodeFiles = [ - { path: `${tmp.path}/文件.txt`, content: "chinese content" }, - { path: `${tmp.path}/🚀rocket.txt`, content: "emoji content" }, - { path: `${tmp.path}/café.txt`, content: "accented content" }, - { path: `${tmp.path}/файл.txt`, content: "cyrillic content" }, + { path: fwd(tmp.path, "文件.txt"), content: "chinese content" }, + { path: fwd(tmp.path, "🚀rocket.txt"), content: "emoji content" }, + { path: fwd(tmp.path, "café.txt"), content: "accented content" }, + { path: fwd(tmp.path, "файл.txt"), content: "cyrillic content" }, ] for (const file of unicodeFiles) { @@ -329,8 +335,8 @@ test.skip("unicode filenames modification and restore", async () => { await Instance.provide({ directory: tmp.path, fn: async () => { - const chineseFile = `${tmp.path}/文件.txt` - const cyrillicFile = `${tmp.path}/файл.txt` + const chineseFile = fwd(tmp.path, "文件.txt") + const cyrillicFile = fwd(tmp.path, "файл.txt") await Filesystem.write(chineseFile, "original chinese") await Filesystem.write(cyrillicFile, "original cyrillic") @@ -362,7 +368,7 @@ test("unicode filenames in subdirectories", async () => { expect(before).toBeTruthy() await $`mkdir -p "${tmp.path}/目录/подкаталог"`.quiet() - const deepFile = `${tmp.path}/目录/подкаталог/文件.txt` + const deepFile = fwd(tmp.path, "目录", "подкаталог", "文件.txt") await Filesystem.write(deepFile, "deep unicode content") const patch = await Snapshot.patch(before!) @@ -388,7 +394,7 @@ test("very long filenames", async () => { expect(before).toBeTruthy() const longName = "a".repeat(200) + ".txt" - const longFile = `${tmp.path}/${longName}` + const longFile = fwd(tmp.path, longName) await Filesystem.write(longFile, "long filename content") @@ -419,9 +425,9 @@ test("hidden files", async () => { await Filesystem.write(`${tmp.path}/.config`, "config content") const patch = await Snapshot.patch(before!) - expect(patch.files).toContain(`${tmp.path}/.hidden`) - expect(patch.files).toContain(`${tmp.path}/.gitignore`) - expect(patch.files).toContain(`${tmp.path}/.config`) + expect(patch.files).toContain(fwd(tmp.path, ".hidden")) + expect(patch.files).toContain(fwd(tmp.path, ".gitignore")) + expect(patch.files).toContain(fwd(tmp.path, ".config")) }, }) }) @@ -436,12 +442,12 @@ test("nested symlinks", async () => { await $`mkdir -p ${tmp.path}/sub/dir`.quiet() await Filesystem.write(`${tmp.path}/sub/dir/target.txt`, "target content") - await $`ln -s ${tmp.path}/sub/dir/target.txt ${tmp.path}/sub/dir/link.txt`.quiet() - await $`ln -s ${tmp.path}/sub ${tmp.path}/sub-link`.quiet() + await fs.symlink(`${tmp.path}/sub/dir/target.txt`, `${tmp.path}/sub/dir/link.txt`, "file") + await fs.symlink(`${tmp.path}/sub`, `${tmp.path}/sub-link`, "dir") const patch = await Snapshot.patch(before!) - expect(patch.files).toContain(`${tmp.path}/sub/dir/link.txt`) - expect(patch.files).toContain(`${tmp.path}/sub-link`) + expect(patch.files).toContain(fwd(tmp.path, "sub", "dir", "link.txt")) + expect(patch.files).toContain(fwd(tmp.path, "sub-link")) }, }) }) @@ -476,7 +482,7 @@ test("circular symlinks", async () => { expect(before).toBeTruthy() // Create circular symlink - await $`ln -s ${tmp.path}/circular ${tmp.path}/circular`.quiet().nothrow() + await fs.symlink(`${tmp.path}/circular`, `${tmp.path}/circular`, "dir").catch(() => {}) const patch = await Snapshot.patch(before!) expect(patch.files.length).toBeGreaterThanOrEqual(0) // Should not crash @@ -499,11 +505,11 @@ test("gitignore changes", async () => { const patch = await Snapshot.patch(before!) // Should track gitignore itself - expect(patch.files).toContain(`${tmp.path}/.gitignore`) + expect(patch.files).toContain(fwd(tmp.path, ".gitignore")) // Should track normal files - expect(patch.files).toContain(`${tmp.path}/normal.txt`) + expect(patch.files).toContain(fwd(tmp.path, "normal.txt")) // Should not track ignored files (git won't see them) - expect(patch.files).not.toContain(`${tmp.path}/test.ignored`) + expect(patch.files).not.toContain(fwd(tmp.path, "test.ignored")) }, }) }) @@ -523,8 +529,8 @@ test("git info exclude changes", async () => { await Bun.write(`${tmp.path}/normal.txt`, "normal content") const patch = await Snapshot.patch(before!) - expect(patch.files).toContain(`${tmp.path}/normal.txt`) - expect(patch.files).not.toContain(`${tmp.path}/ignored.txt`) + expect(patch.files).toContain(fwd(tmp.path, "normal.txt")) + expect(patch.files).not.toContain(fwd(tmp.path, "ignored.txt")) const after = await Snapshot.track() const diffs = await Snapshot.diffFull(before!, after!) @@ -559,9 +565,9 @@ test("git info exclude keeps global excludes", async () => { await Bun.write(`${tmp.path}/normal.txt`, "normal content") const patch = await Snapshot.patch(before!) - expect(patch.files).toContain(`${tmp.path}/normal.txt`) - expect(patch.files).not.toContain(`${tmp.path}/global.tmp`) - expect(patch.files).not.toContain(`${tmp.path}/info.tmp`) + expect(patch.files).toContain(fwd(tmp.path, "normal.txt")) + expect(patch.files).not.toContain(fwd(tmp.path, "global.tmp")) + expect(patch.files).not.toContain(fwd(tmp.path, "info.tmp")) } finally { if (prev) process.env.GIT_CONFIG_GLOBAL = prev else delete process.env.GIT_CONFIG_GLOBAL @@ -610,7 +616,7 @@ test("snapshot state isolation between projects", async () => { const before1 = await Snapshot.track() await Filesystem.write(`${tmp1.path}/project1.txt`, "project1 content") const patch1 = await Snapshot.patch(before1!) - expect(patch1.files).toContain(`${tmp1.path}/project1.txt`) + expect(patch1.files).toContain(fwd(tmp1.path, "project1.txt")) }, }) @@ -620,10 +626,10 @@ test("snapshot state isolation between projects", async () => { const before2 = await Snapshot.track() await Filesystem.write(`${tmp2.path}/project2.txt`, "project2 content") const patch2 = await Snapshot.patch(before2!) - expect(patch2.files).toContain(`${tmp2.path}/project2.txt`) + expect(patch2.files).toContain(fwd(tmp2.path, "project2.txt")) // Ensure project1 files don't appear in project2 - expect(patch2.files).not.toContain(`${tmp1?.path}/project1.txt`) + expect(patch2.files).not.toContain(fwd(tmp1?.path ?? "", "project1.txt")) }, }) }) @@ -647,7 +653,7 @@ test("patch detects changes in secondary worktree", async () => { const before = await Snapshot.track() expect(before).toBeTruthy() - const worktreeFile = `${worktreePath}/worktree.txt` + const worktreeFile = fwd(worktreePath, "worktree.txt") await Filesystem.write(worktreeFile, "worktree content") const patch = await Snapshot.patch(before!) @@ -681,7 +687,7 @@ test("revert only removes files in invoking worktree", async () => { const before = await Snapshot.track() expect(before).toBeTruthy() - const worktreeFile = `${worktreePath}/worktree.txt` + const worktreeFile = fwd(worktreePath, "worktree.txt") await Filesystem.write(worktreeFile, "worktree content") const patch = await Snapshot.patch(before!) @@ -832,7 +838,7 @@ test("revert should not delete files that existed but were deleted in snapshot", await Filesystem.write(`${tmp.path}/a.txt`, "recreated content") const patch = await Snapshot.patch(snapshot2!) - expect(patch.files).toContain(`${tmp.path}/a.txt`) + expect(patch.files).toContain(fwd(tmp.path, "a.txt")) await Snapshot.revert([patch]) @@ -861,8 +867,8 @@ test("revert preserves file that existed in snapshot when deleted then recreated await Filesystem.write(`${tmp.path}/newfile.txt`, "new") const patch = await Snapshot.patch(snapshot!) - expect(patch.files).toContain(`${tmp.path}/existing.txt`) - expect(patch.files).toContain(`${tmp.path}/newfile.txt`) + expect(patch.files).toContain(fwd(tmp.path, "existing.txt")) + expect(patch.files).toContain(fwd(tmp.path, "newfile.txt")) await Snapshot.revert([patch]) From 888b123387718aa1fc802fbcae7341c7aeef6f73 Mon Sep 17 00:00:00 2001 From: Noam Bressler Date: Tue, 24 Feb 2026 13:14:47 +0200 Subject: [PATCH 37/95] feat: ACP - stream bash output and synthetic pending events (#14079) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> --- packages/opencode/src/acp/agent.ts | 123 ++++++++++---- .../test/acp/event-subscription.test.ts | 158 +++++++++++++++++- 2 files changed, 244 insertions(+), 37 deletions(-) diff --git a/packages/opencode/src/acp/agent.ts b/packages/opencode/src/acp/agent.ts index 765c741c0d62..5db98bc7044f 100644 --- a/packages/opencode/src/acp/agent.ts +++ b/packages/opencode/src/acp/agent.ts @@ -41,7 +41,7 @@ import { Config } from "@/config/config" import { Todo } from "@/session/todo" import { z } from "zod" import { LoadAPIKeyError } from "ai" -import type { AssistantMessage, Event, OpencodeClient, SessionMessageResponse } from "@opencode-ai/sdk/v2" +import type { AssistantMessage, Event, OpencodeClient, SessionMessageResponse, ToolPart } from "@opencode-ai/sdk/v2" import { applyPatch } from "diff" type ModeOption = { id: string; name: string; description?: string } @@ -135,6 +135,8 @@ export namespace ACP { private sessionManager: ACPSessionManager private eventAbort = new AbortController() private eventStarted = false + private bashSnapshots = new Map() + private toolStarts = new Set() private permissionQueues = new Map>() private permissionOptions: PermissionOption[] = [ { optionId: "once", kind: "allow_once", name: "Allow once" }, @@ -266,47 +268,68 @@ export namespace ACP { const session = this.sessionManager.tryGet(part.sessionID) if (!session) return const sessionId = session.id - const directory = session.cwd - - const message = await this.sdk.session - .message( - { - sessionID: part.sessionID, - messageID: part.messageID, - directory, - }, - { throwOnError: true }, - ) - .then((x) => x.data) - .catch((error) => { - log.error("unexpected error when fetching message", { error }) - return undefined - }) - - if (!message || message.info.role !== "assistant") return if (part.type === "tool") { + if (!this.toolStarts.has(part.callID)) { + this.toolStarts.add(part.callID) + await this.connection + .sessionUpdate({ + sessionId, + update: { + sessionUpdate: "tool_call", + toolCallId: part.callID, + title: part.tool, + kind: toToolKind(part.tool), + status: "pending", + locations: [], + rawInput: {}, + }, + }) + .catch((error) => { + log.error("failed to send tool pending to ACP", { error }) + }) + } + switch (part.state.status) { case "pending": - await this.connection - .sessionUpdate({ - sessionId, - update: { - sessionUpdate: "tool_call", - toolCallId: part.callID, - title: part.tool, - kind: toToolKind(part.tool), - status: "pending", - locations: [], - rawInput: {}, - }, - }) - .catch((error) => { - log.error("failed to send tool pending to ACP", { error }) - }) + this.bashSnapshots.delete(part.callID) return case "running": + const output = this.bashOutput(part) + const content: ToolCallContent[] = [] + if (output) { + const hash = String(Bun.hash(output)) + if (part.tool === "bash") { + if (this.bashSnapshots.get(part.callID) === hash) { + await this.connection + .sessionUpdate({ + sessionId, + update: { + sessionUpdate: "tool_call_update", + toolCallId: part.callID, + status: "in_progress", + kind: toToolKind(part.tool), + title: part.tool, + locations: toLocations(part.tool, part.state.input), + rawInput: part.state.input, + }, + }) + .catch((error) => { + log.error("failed to send tool in_progress to ACP", { error }) + }) + return + } + this.bashSnapshots.set(part.callID, hash) + } + content.push({ + type: "content", + content: { + type: "text", + text: output, + }, + }) + } await this.connection .sessionUpdate({ sessionId, @@ -318,6 +341,7 @@ export namespace ACP { title: part.tool, locations: toLocations(part.tool, part.state.input), rawInput: part.state.input, + ...(content.length > 0 && { content }), }, }) .catch((error) => { @@ -326,6 +350,8 @@ export namespace ACP { return case "completed": { + this.toolStarts.delete(part.callID) + this.bashSnapshots.delete(part.callID) const kind = toToolKind(part.tool) const content: ToolCallContent[] = [ { @@ -405,6 +431,8 @@ export namespace ACP { return } case "error": + this.toolStarts.delete(part.callID) + this.bashSnapshots.delete(part.callID) await this.connection .sessionUpdate({ sessionId, @@ -426,6 +454,7 @@ export namespace ACP { ], rawOutput: { error: part.state.error, + metadata: part.state.metadata, }, }, }) @@ -802,6 +831,7 @@ export namespace ACP { if (part.type === "tool") { switch (part.state.status) { case "pending": + this.bashSnapshots.delete(part.callID) await this.connection .sessionUpdate({ sessionId, @@ -820,6 +850,17 @@ export namespace ACP { }) break case "running": + const output = this.bashOutput(part) + const runningContent: ToolCallContent[] = [] + if (output) { + runningContent.push({ + type: "content", + content: { + type: "text", + text: output, + }, + }) + } await this.connection .sessionUpdate({ sessionId, @@ -831,6 +872,7 @@ export namespace ACP { title: part.tool, locations: toLocations(part.tool, part.state.input), rawInput: part.state.input, + ...(runningContent.length > 0 && { content: runningContent }), }, }) .catch((err) => { @@ -838,6 +880,7 @@ export namespace ACP { }) break case "completed": + this.bashSnapshots.delete(part.callID) const kind = toToolKind(part.tool) const content: ToolCallContent[] = [ { @@ -916,6 +959,7 @@ export namespace ACP { }) break case "error": + this.bashSnapshots.delete(part.callID) await this.connection .sessionUpdate({ sessionId, @@ -937,6 +981,7 @@ export namespace ACP { ], rawOutput: { error: part.state.error, + metadata: part.state.metadata, }, }, }) @@ -1063,6 +1108,14 @@ export namespace ACP { } } + private bashOutput(part: ToolPart) { + if (part.tool !== "bash") return + if (!("metadata" in part.state) || !part.state.metadata || typeof part.state.metadata !== "object") return + const output = part.state.metadata["output"] + if (typeof output !== "string") return + return output + } + private async loadAvailableModes(directory: string): Promise { const agents = await this.config.sdk.app .agents( diff --git a/packages/opencode/test/acp/event-subscription.test.ts b/packages/opencode/test/acp/event-subscription.test.ts index 1145a1357d2d..7372c55bac99 100644 --- a/packages/opencode/test/acp/event-subscription.test.ts +++ b/packages/opencode/test/acp/event-subscription.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "bun:test" import { ACP } from "../../src/acp/agent" import type { AgentSideConnection } from "@agentclientprotocol/sdk" -import type { Event } from "@opencode-ai/sdk/v2" +import type { Event, EventMessagePartUpdated, ToolStatePending, ToolStateRunning } from "@opencode-ai/sdk/v2" import { Instance } from "../../src/project/instance" import { tmpdir } from "../fixture/fixture" @@ -19,6 +19,61 @@ type EventController = { close: () => void } +function inProgressText(update: SessionUpdateParams["update"]) { + if (update.sessionUpdate !== "tool_call_update") return undefined + if (update.status !== "in_progress") return undefined + if (!update.content || !Array.isArray(update.content)) return undefined + const first = update.content[0] + if (!first || first.type !== "content") return undefined + if (first.content.type !== "text") return undefined + return first.content.text +} + +function isToolCallUpdate( + update: SessionUpdateParams["update"], +): update is Extract { + return update.sessionUpdate === "tool_call_update" +} + +function toolEvent( + sessionId: string, + cwd: string, + opts: { + callID: string + tool: string + input: Record + } & ({ status: "running"; metadata?: Record } | { status: "pending"; raw: string }), +): GlobalEventEnvelope { + const state: ToolStatePending | ToolStateRunning = + opts.status === "running" + ? { + status: "running", + input: opts.input, + ...(opts.metadata && { metadata: opts.metadata }), + time: { start: Date.now() }, + } + : { + status: "pending", + input: opts.input, + raw: opts.raw, + } + const payload: EventMessagePartUpdated = { + type: "message.part.updated", + properties: { + part: { + id: `part_${opts.callID}`, + sessionID: sessionId, + messageID: `msg_${opts.callID}`, + type: "tool", + callID: opts.callID, + tool: opts.tool, + state, + }, + }, + } + return { directory: cwd, payload } +} + function createEventStream() { const queue: GlobalEventEnvelope[] = [] const waiters: Array<(value: GlobalEventEnvelope | undefined) => void> = [] @@ -65,6 +120,7 @@ function createEventStream() { function createFakeAgent() { const updates = new Map() const chunks = new Map() + const sessionUpdates: SessionUpdateParams[] = [] const record = (sessionId: string, type: string) => { const list = updates.get(sessionId) ?? [] list.push(type) @@ -73,6 +129,7 @@ function createFakeAgent() { const connection = { async sessionUpdate(params: SessionUpdateParams) { + sessionUpdates.push(params) const update = params.update const type = update?.sessionUpdate ?? "unknown" record(params.sessionId, type) @@ -197,7 +254,7 @@ function createFakeAgent() { ;(agent as any).eventAbort.abort() } - return { agent, controller, calls, updates, chunks, stop, sdk, connection } + return { agent, controller, calls, updates, chunks, sessionUpdates, stop, sdk, connection } } describe("acp.agent event subscription", () => { @@ -435,4 +492,101 @@ describe("acp.agent event subscription", () => { }, }) }) + + test("streams running bash output snapshots and de-dupes identical snapshots", async () => { + await using tmp = await tmpdir() + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const { agent, controller, sessionUpdates, stop } = createFakeAgent() + const cwd = "/tmp/opencode-acp-test" + const sessionId = await agent.newSession({ cwd, mcpServers: [] } as any).then((x) => x.sessionId) + const input = { command: "echo hello", description: "run command" } + + for (const output of ["a", "a", "ab"]) { + controller.push( + toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output } }), + ) + } + await new Promise((r) => setTimeout(r, 20)) + + const snapshots = sessionUpdates + .filter((u) => u.sessionId === sessionId) + .filter((u) => isToolCallUpdate(u.update)) + .map((u) => inProgressText(u.update)) + + expect(snapshots).toEqual(["a", undefined, "ab"]) + stop() + }, + }) + }) + + test("emits synthetic pending before first running update for any tool", async () => { + await using tmp = await tmpdir() + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const { agent, controller, sessionUpdates, stop } = createFakeAgent() + const cwd = "/tmp/opencode-acp-test" + const sessionId = await agent.newSession({ cwd, mcpServers: [] } as any).then((x) => x.sessionId) + + controller.push( + toolEvent(sessionId, cwd, { + callID: "call_bash", + tool: "bash", + status: "running", + input: { command: "echo hi", description: "run command" }, + metadata: { output: "hi\n" }, + }), + ) + controller.push( + toolEvent(sessionId, cwd, { + callID: "call_read", + tool: "read", + status: "running", + input: { filePath: "/tmp/example.txt" }, + }), + ) + await new Promise((r) => setTimeout(r, 20)) + + const types = sessionUpdates + .filter((u) => u.sessionId === sessionId) + .map((u) => u.update.sessionUpdate) + .filter((u) => u === "tool_call" || u === "tool_call_update") + expect(types).toEqual(["tool_call", "tool_call_update", "tool_call", "tool_call_update"]) + + const pendings = sessionUpdates.filter( + (u) => u.sessionId === sessionId && u.update.sessionUpdate === "tool_call", + ) + expect(pendings.every((p) => p.update.sessionUpdate === "tool_call" && p.update.status === "pending")).toBe(true) + stop() + }, + }) + }) + + test("clears bash snapshot marker on pending state", async () => { + await using tmp = await tmpdir() + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const { agent, controller, sessionUpdates, stop } = createFakeAgent() + const cwd = "/tmp/opencode-acp-test" + const sessionId = await agent.newSession({ cwd, mcpServers: [] } as any).then((x) => x.sessionId) + const input = { command: "echo hello", description: "run command" } + + controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output: "a" } })) + controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "pending", input, raw: '{"command":"echo hello"}' })) + controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output: "a" } })) + await new Promise((r) => setTimeout(r, 20)) + + const snapshots = sessionUpdates + .filter((u) => u.sessionId === sessionId) + .filter((u) => isToolCallUpdate(u.update)) + .map((u) => inProgressText(u.update)) + + expect(snapshots).toEqual(["a", "a"]) + stop() + }, + }) + }) }) From ef7f222d80d1b5d2f3c18e86efba99a1f308c1f9 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Tue, 24 Feb 2026 11:15:39 +0000 Subject: [PATCH 38/95] chore: generate --- .../test/acp/event-subscription.test.ts | 42 ++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/packages/opencode/test/acp/event-subscription.test.ts b/packages/opencode/test/acp/event-subscription.test.ts index 7372c55bac99..d61240d715bc 100644 --- a/packages/opencode/test/acp/event-subscription.test.ts +++ b/packages/opencode/test/acp/event-subscription.test.ts @@ -505,7 +505,13 @@ describe("acp.agent event subscription", () => { for (const output of ["a", "a", "ab"]) { controller.push( - toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output } }), + toolEvent(sessionId, cwd, { + callID: "call_1", + tool: "bash", + status: "running", + input, + metadata: { output }, + }), ) } await new Promise((r) => setTimeout(r, 20)) @@ -558,7 +564,9 @@ describe("acp.agent event subscription", () => { const pendings = sessionUpdates.filter( (u) => u.sessionId === sessionId && u.update.sessionUpdate === "tool_call", ) - expect(pendings.every((p) => p.update.sessionUpdate === "tool_call" && p.update.status === "pending")).toBe(true) + expect(pendings.every((p) => p.update.sessionUpdate === "tool_call" && p.update.status === "pending")).toBe( + true, + ) stop() }, }) @@ -574,9 +582,33 @@ describe("acp.agent event subscription", () => { const sessionId = await agent.newSession({ cwd, mcpServers: [] } as any).then((x) => x.sessionId) const input = { command: "echo hello", description: "run command" } - controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output: "a" } })) - controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "pending", input, raw: '{"command":"echo hello"}' })) - controller.push(toolEvent(sessionId, cwd, { callID: "call_1", tool: "bash", status: "running", input, metadata: { output: "a" } })) + controller.push( + toolEvent(sessionId, cwd, { + callID: "call_1", + tool: "bash", + status: "running", + input, + metadata: { output: "a" }, + }), + ) + controller.push( + toolEvent(sessionId, cwd, { + callID: "call_1", + tool: "bash", + status: "pending", + input, + raw: '{"command":"echo hello"}', + }), + ) + controller.push( + toolEvent(sessionId, cwd, { + callID: "call_1", + tool: "bash", + status: "running", + input, + metadata: { output: "a" }, + }), + ) await new Promise((r) => setTimeout(r, 20)) const snapshots = sessionUpdates From 79254c10201a3978ac72ef2a047bb4070efdc41d Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 21:40:38 +1000 Subject: [PATCH 39/95] fix(test): normalize git excludesFile path for Windows (#14893) --- packages/opencode/test/snapshot/snapshot.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/test/snapshot/snapshot.test.ts b/packages/opencode/test/snapshot/snapshot.test.ts index 79b1a83cd3a1..1804ab5c2a2b 100644 --- a/packages/opencode/test/snapshot/snapshot.test.ts +++ b/packages/opencode/test/snapshot/snapshot.test.ts @@ -548,7 +548,7 @@ test("git info exclude keeps global excludes", async () => { const global = `${tmp.path}/global.ignore` const config = `${tmp.path}/global.gitconfig` await Bun.write(global, "global.tmp\n") - await Bun.write(config, `[core]\n\texcludesFile = ${global}\n`) + await Bun.write(config, `[core]\n\texcludesFile = ${global.replaceAll("\\", "/")}\n`) const prev = process.env.GIT_CONFIG_GLOBAL process.env.GIT_CONFIG_GLOBAL = config From a292eddeb516ebf1774e68640b4c62ad284472b2 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 21:59:14 +1000 Subject: [PATCH 40/95] fix(test): harden preload cleanup against Windows EBUSY (#14895) --- packages/opencode/src/storage/db.ts | 13 +++++++++++++ packages/opencode/test/preload.ts | 21 ++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/storage/db.ts b/packages/opencode/src/storage/db.ts index 6d7bfd728102..f29aac18d163 100644 --- a/packages/opencode/src/storage/db.ts +++ b/packages/opencode/src/storage/db.ts @@ -33,6 +33,10 @@ export namespace Database { type Journal = { sql: string; timestamp: number }[] + const state = { + sqlite: undefined as BunDatabase | undefined, + } + function time(tag: string) { const match = /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/.exec(tag) if (!match) return 0 @@ -69,6 +73,7 @@ export namespace Database { log.info("opening database", { path: path.join(Global.Path.data, "opencode.db") }) const sqlite = new BunDatabase(path.join(Global.Path.data, "opencode.db"), { create: true }) + state.sqlite = sqlite sqlite.run("PRAGMA journal_mode = WAL") sqlite.run("PRAGMA synchronous = NORMAL") @@ -95,6 +100,14 @@ export namespace Database { return db }) + export function close() { + const sqlite = state.sqlite + if (!sqlite) return + sqlite.close() + state.sqlite = undefined + Client.reset() + } + export type TxOrDb = Transaction | Client const ctx = Context.create<{ diff --git a/packages/opencode/test/preload.ts b/packages/opencode/test/preload.ts index a6d96cf17bd8..41028633e83e 100644 --- a/packages/opencode/test/preload.ts +++ b/packages/opencode/test/preload.ts @@ -3,14 +3,29 @@ import os from "os" import path from "path" import fs from "fs/promises" -import fsSync from "fs" import { afterAll } from "bun:test" // Set XDG env vars FIRST, before any src/ imports const dir = path.join(os.tmpdir(), "opencode-test-data-" + process.pid) await fs.mkdir(dir, { recursive: true }) -afterAll(() => { - fsSync.rmSync(dir, { recursive: true, force: true, maxRetries: 3, retryDelay: 500 }) +afterAll(async () => { + const { Database } = await import("../src/storage/db") + Database.close() + const busy = (error: unknown) => + typeof error === "object" && error !== null && "code" in error && error.code === "EBUSY" + const rm = async (left: number): Promise => { + Bun.gc(true) + await Bun.sleep(100) + return fs.rm(dir, { recursive: true, force: true }).catch((error) => { + if (!busy(error)) throw error + if (left <= 1) throw error + return rm(left - 1) + }) + } + + // Windows can keep SQLite WAL handles alive until GC finalizers run, so we + // force GC and retry teardown to avoid flaky EBUSY in test cleanup. + await rm(30) }) process.env["XDG_DATA_HOME"] = path.join(dir, "share") From 1af3e9e557a6df4f933a01d0dad2e52e418ebd52 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 22:20:57 +1000 Subject: [PATCH 41/95] fix(win32): fix plugin resolution with createRequire fallback (#14898) --- packages/opencode/src/config/config.ts | 15 ++++++++++++--- packages/opencode/test/config/config.test.ts | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index aad0fd76c4be..71cf43d6da43 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -1,6 +1,7 @@ import { Log } from "../util/log" import path from "path" -import { pathToFileURL } from "url" +import { pathToFileURL, fileURLToPath } from "url" +import { createRequire } from "module" import os from "os" import z from "zod" import { Filesystem } from "../util/filesystem" @@ -276,7 +277,6 @@ export namespace Config { "@opencode-ai/plugin": targetVersion, } await Filesystem.writeJson(pkg, json) - await new Promise((resolve) => setTimeout(resolve, 3000)) const gitignore = path.join(dir, ".gitignore") const hasGitIgnore = await Filesystem.exists(gitignore) @@ -1332,7 +1332,16 @@ export namespace Config { const plugin = data.plugin[i] try { data.plugin[i] = import.meta.resolve!(plugin, options.path) - } catch (err) {} + } catch (e) { + try { + // import.meta.resolve sometimes fails with newly created node_modules + const require = createRequire(options.path) + const resolvedPath = require.resolve(plugin) + data.plugin[i] = pathToFileURL(resolvedPath).href + } catch { + // Ignore, plugin might be a generic string identifier like "mcp-server" + } + } } } return data diff --git a/packages/opencode/test/config/config.test.ts b/packages/opencode/test/config/config.test.ts index 56773570af57..2b1ba816ea3b 100644 --- a/packages/opencode/test/config/config.test.ts +++ b/packages/opencode/test/config/config.test.ts @@ -689,7 +689,7 @@ test("resolves scoped npm plugins in config", async () => { const pluginEntries = config.plugin ?? [] const baseUrl = pathToFileURL(path.join(tmp.path, "opencode.json")).href - const expected = import.meta.resolve("@scope/plugin", baseUrl) + const expected = pathToFileURL(path.join(tmp.path, "node_modules", "@scope", "plugin", "index.js")).href expect(pluginEntries.includes(expected)).toBe(true) From 1a0639e5b89265ac89afd7bcfae835a64744768d Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 22:42:48 +1000 Subject: [PATCH 42/95] fix(win32): normalize backslash paths in config rel() and file ignore (#14903) --- packages/opencode/src/config/config.ts | 5 +++-- packages/opencode/src/file/ignore.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index 71cf43d6da43..b1e00fccb850 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -342,10 +342,11 @@ export namespace Config { } function rel(item: string, patterns: string[]) { + const normalizedItem = item.replaceAll("\\", "/") for (const pattern of patterns) { - const index = item.indexOf(pattern) + const index = normalizedItem.indexOf(pattern) if (index === -1) continue - return item.slice(index + pattern.length) + return normalizedItem.slice(index + pattern.length) } } diff --git a/packages/opencode/src/file/ignore.ts b/packages/opencode/src/file/ignore.ts index 94ffaf5ce049..b9731040c7d7 100644 --- a/packages/opencode/src/file/ignore.ts +++ b/packages/opencode/src/file/ignore.ts @@ -67,7 +67,7 @@ export namespace FileIgnore { if (Glob.match(pattern, filepath)) return false } - const parts = filepath.split(sep) + const parts = filepath.split(/[/\\]/) for (let i = 0; i < parts.length; i++) { if (FOLDERS.has(parts[i])) return true } From 06f25c78f655257819d681b39598bf151837caf6 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 22:51:56 +1000 Subject: [PATCH 43/95] fix(test): use path.sep in discovery test for cross-platform path matching (#14905) --- packages/opencode/test/skill/discovery.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/test/skill/discovery.test.ts b/packages/opencode/test/skill/discovery.test.ts index d1963f697b98..5664fa32b8ad 100644 --- a/packages/opencode/test/skill/discovery.test.ts +++ b/packages/opencode/test/skill/discovery.test.ts @@ -77,7 +77,7 @@ describe("Discovery.pull", () => { test("downloads reference files alongside SKILL.md", async () => { const dirs = await Discovery.pull(CLOUDFLARE_SKILLS_URL) // find a skill dir that should have reference files (e.g. agents-sdk) - const agentsSdk = dirs.find((d) => d.endsWith("/agents-sdk")) + const agentsSdk = dirs.find((d) => d.endsWith(path.sep + "agents-sdk")) expect(agentsSdk).toBeDefined() if (agentsSdk) { const refs = path.join(agentsSdk, "references") From 3d379c20c4973ef2b1c0305dbd1064ba0f1d8e3f Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 23:03:18 +1000 Subject: [PATCH 44/95] fix(test): replace Unix-only assumptions with cross-platform alternatives (#14906) --- packages/opencode/test/tool/bash.test.ts | 10 ++++++---- .../opencode/test/tool/external-directory.test.ts | 4 ++-- packages/opencode/test/tool/write.test.ts | 15 +++++++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/packages/opencode/test/tool/bash.test.ts b/packages/opencode/test/tool/bash.test.ts index db05f8f623f6..ac93016927ac 100644 --- a/packages/opencode/test/tool/bash.test.ts +++ b/packages/opencode/test/tool/bash.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "bun:test" +import os from "os" import path from "path" import { BashTool } from "../../src/tool/bash" import { Instance } from "../../src/project/instance" @@ -138,14 +139,14 @@ describe("tool.bash permissions", () => { await bash.execute( { command: "ls", - workdir: "/tmp", - description: "List /tmp", + workdir: os.tmpdir(), + description: "List temp dir", }, testCtx, ) const extDirReq = requests.find((r) => r.permission === "external_directory") expect(extDirReq).toBeDefined() - expect(extDirReq!.patterns).toContain("/tmp/*") + expect(extDirReq!.patterns).toContain(path.join(os.tmpdir(), "*")) }, }) }) @@ -366,7 +367,8 @@ describe("tool.bash truncation", () => { ctx, ) expect((result.metadata as any).truncated).toBe(false) - expect(result.output).toBe("hello\n") + const eol = process.platform === "win32" ? "\r\n" : "\n" + expect(result.output).toBe(`hello${eol}`) }, }) }) diff --git a/packages/opencode/test/tool/external-directory.test.ts b/packages/opencode/test/tool/external-directory.test.ts index 33c5e2c7397f..a75f767b3b6c 100644 --- a/packages/opencode/test/tool/external-directory.test.ts +++ b/packages/opencode/test/tool/external-directory.test.ts @@ -65,7 +65,7 @@ describe("tool.assertExternalDirectory", () => { const directory = "/tmp/project" const target = "/tmp/outside/file.txt" - const expected = path.join(path.dirname(target), "*") + const expected = path.join(path.dirname(target), "*").replaceAll("\\", "/") await Instance.provide({ directory, @@ -91,7 +91,7 @@ describe("tool.assertExternalDirectory", () => { const directory = "/tmp/project" const target = "/tmp/outside" - const expected = path.join(target, "*") + const expected = path.join(target, "*").replaceAll("\\", "/") await Instance.provide({ directory, diff --git a/packages/opencode/test/tool/write.test.ts b/packages/opencode/test/tool/write.test.ts index 4f1a7d28e8cf..695d48ccbbc7 100644 --- a/packages/opencode/test/tool/write.test.ts +++ b/packages/opencode/test/tool/write.test.ts @@ -293,19 +293,26 @@ describe("tool.write", () => { }) describe("error handling", () => { - test("throws error for paths outside project", async () => { + test("throws error when OS denies write access", async () => { await using tmp = await tmpdir() - const outsidePath = "/etc/passwd" + const readonlyPath = path.join(tmp.path, "readonly.txt") + + // Create a read-only file + await fs.writeFile(readonlyPath, "test", "utf-8") + await fs.chmod(readonlyPath, 0o444) await Instance.provide({ directory: tmp.path, fn: async () => { + const { FileTime } = await import("../../src/file/time") + FileTime.read(ctx.sessionID, readonlyPath) + const write = await WriteTool.init() await expect( write.execute( { - filePath: outsidePath, - content: "test", + filePath: readonlyPath, + content: "new content", }, ctx, ), From 36197f5ff8d98e582b2ea9da3e851937102d2888 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 23:10:10 +1000 Subject: [PATCH 45/95] fix(win32): add 50ms tolerance for NTFS mtime fuzziness in FileTime assert (#14907) --- packages/opencode/src/file/time.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/file/time.ts b/packages/opencode/src/file/time.ts index c85781eb4116..efb1c437647f 100644 --- a/packages/opencode/src/file/time.ts +++ b/packages/opencode/src/file/time.ts @@ -61,7 +61,8 @@ export namespace FileTime { const time = get(sessionID, filepath) if (!time) throw new Error(`You must read file ${filepath} before overwriting it. Use the Read tool first`) const mtime = Filesystem.stat(filepath)?.mtime - if (mtime && mtime.getTime() > time.getTime()) { + // Allow a 50ms tolerance for Windows NTFS timestamp fuzziness / async flushing + if (mtime && mtime.getTime() > time.getTime() + 50) { throw new Error( `File ${filepath} has been modified since it was last read.\nLast modification: ${mtime.toISOString()}\nLast read: ${time.toISOString()}\n\nPlease read the file again before modifying it.`, ) From 32417774c4baccbcb23820162f0b9c196bbe06de Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 24 Feb 2026 23:16:24 +1000 Subject: [PATCH 46/95] fix(test): replace structuredClone with spread for process.env (#14908) --- packages/opencode/test/ide/ide.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/test/ide/ide.test.ts b/packages/opencode/test/ide/ide.test.ts index 4d70140197fe..e10700e80ffe 100644 --- a/packages/opencode/test/ide/ide.test.ts +++ b/packages/opencode/test/ide/ide.test.ts @@ -2,7 +2,7 @@ import { describe, expect, test, afterEach } from "bun:test" import { Ide } from "../../src/ide" describe("ide", () => { - const original = structuredClone(process.env) + const original = { ...process.env } afterEach(() => { Object.keys(process.env).forEach((key) => { From e27d3d5d4017b33b73d4278fac561513454b1cae Mon Sep 17 00:00:00 2001 From: adamelmore <2363879+adamdottv@users.noreply.github.com> Date: Tue, 24 Feb 2026 07:32:07 -0600 Subject: [PATCH 47/95] fix(app): remove filetree tooltips --- packages/app/src/components/file-tree.tsx | 163 +++++++--------------- 1 file changed, 51 insertions(+), 112 deletions(-) diff --git a/packages/app/src/components/file-tree.tsx b/packages/app/src/components/file-tree.tsx index cec094354254..3840f18ed871 100644 --- a/packages/app/src/components/file-tree.tsx +++ b/packages/app/src/components/file-tree.tsx @@ -3,7 +3,6 @@ import { encodeFilePath } from "@/context/file/path" import { Collapsible } from "@opencode-ai/ui/collapsible" import { FileIcon } from "@opencode-ai/ui/file-icon" import { Icon } from "@opencode-ai/ui/icon" -import { Tooltip } from "@opencode-ai/ui/tooltip" import { createEffect, createMemo, @@ -192,59 +191,6 @@ const FileTreeNode = ( ) } -const FileTreeNodeTooltip = (props: { enabled: boolean; node: FileNode; kind?: Kind; children: JSXElement }) => { - if (!props.enabled) return props.children - - const parts = props.node.path.split("/") - const leaf = parts[parts.length - 1] ?? props.node.path - const head = parts.slice(0, -1).join("/") - const prefix = head ? `${head}/` : "" - const label = - props.kind === "add" - ? "Additions" - : props.kind === "del" - ? "Deletions" - : props.kind === "mix" - ? "Modifications" - : undefined - - return ( - - - {prefix} - - {leaf} - - {(text) => ( - <> - - {text()} - - )} - - - <> - - Ignored - - -
- } - > - {props.children} - - ) -} - export default function FileTree(props: { path: string class?: string @@ -255,7 +201,6 @@ export default function FileTree(props: { modified?: readonly string[] kinds?: ReadonlyMap draggable?: boolean - tooltip?: boolean onFileClick?: (file: FileNode) => void _filter?: Filter @@ -267,7 +212,6 @@ export default function FileTree(props: { const file = useFile() const level = props.level ?? 0 const draggable = () => props.draggable ?? true - const tooltip = () => props.tooltip ?? true const key = (p: string) => file @@ -467,21 +411,19 @@ export default function FileTree(props: { onOpenChange={(open) => (open ? file.tree.expand(node.path) : file.tree.collapse(node.path))} > - - -
- -
-
-
+ +
+ +
+
- - props.onFileClick?.(node)} - > -
- - + props.onFileClick?.(node)} + > +
+ + + + + + + + + - - - - - - - - - - - - + + + + ) From 2cee947671fa373098db308b173c859cada0b108 Mon Sep 17 00:00:00 2001 From: Noam Bressler Date: Tue, 24 Feb 2026 15:54:10 +0200 Subject: [PATCH 48/95] =?UTF-8?q?fix:=20ACP=20both=20live=20and=20load=20s?= =?UTF-8?q?hare=20synthetic=20pending=20status=20preceeding=E2=80=A6=20(#1?= =?UTF-8?q?4916)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/opencode/src/acp/agent.ts | 60 ++++++++----------- .../test/acp/event-subscription.test.ts | 59 ++++++++++++++++++ 2 files changed, 84 insertions(+), 35 deletions(-) diff --git a/packages/opencode/src/acp/agent.ts b/packages/opencode/src/acp/agent.ts index 5db98bc7044f..8b338f1b5716 100644 --- a/packages/opencode/src/acp/agent.ts +++ b/packages/opencode/src/acp/agent.ts @@ -270,25 +270,7 @@ export namespace ACP { const sessionId = session.id if (part.type === "tool") { - if (!this.toolStarts.has(part.callID)) { - this.toolStarts.add(part.callID) - await this.connection - .sessionUpdate({ - sessionId, - update: { - sessionUpdate: "tool_call", - toolCallId: part.callID, - title: part.tool, - kind: toToolKind(part.tool), - status: "pending", - locations: [], - rawInput: {}, - }, - }) - .catch((error) => { - log.error("failed to send tool pending to ACP", { error }) - }) - } + await this.toolStart(sessionId, part) switch (part.state.status) { case "pending": @@ -829,25 +811,10 @@ export namespace ACP { for (const part of message.parts) { if (part.type === "tool") { + await this.toolStart(sessionId, part) switch (part.state.status) { case "pending": this.bashSnapshots.delete(part.callID) - await this.connection - .sessionUpdate({ - sessionId, - update: { - sessionUpdate: "tool_call", - toolCallId: part.callID, - title: part.tool, - kind: toToolKind(part.tool), - status: "pending", - locations: [], - rawInput: {}, - }, - }) - .catch((err) => { - log.error("failed to send tool pending to ACP", { error: err }) - }) break case "running": const output = this.bashOutput(part) @@ -880,6 +847,7 @@ export namespace ACP { }) break case "completed": + this.toolStarts.delete(part.callID) this.bashSnapshots.delete(part.callID) const kind = toToolKind(part.tool) const content: ToolCallContent[] = [ @@ -959,6 +927,7 @@ export namespace ACP { }) break case "error": + this.toolStarts.delete(part.callID) this.bashSnapshots.delete(part.callID) await this.connection .sessionUpdate({ @@ -1116,6 +1085,27 @@ export namespace ACP { return output } + private async toolStart(sessionId: string, part: ToolPart) { + if (this.toolStarts.has(part.callID)) return + this.toolStarts.add(part.callID) + await this.connection + .sessionUpdate({ + sessionId, + update: { + sessionUpdate: "tool_call", + toolCallId: part.callID, + title: part.tool, + kind: toToolKind(part.tool), + status: "pending", + locations: [], + rawInput: {}, + }, + }) + .catch((error) => { + log.error("failed to send tool pending to ACP", { error }) + }) + } + private async loadAvailableModes(directory: string): Promise { const agents = await this.config.sdk.app .agents( diff --git a/packages/opencode/test/acp/event-subscription.test.ts b/packages/opencode/test/acp/event-subscription.test.ts index d61240d715bc..1abf578281df 100644 --- a/packages/opencode/test/acp/event-subscription.test.ts +++ b/packages/opencode/test/acp/event-subscription.test.ts @@ -572,6 +572,65 @@ describe("acp.agent event subscription", () => { }) }) + test("does not emit duplicate synthetic pending after replayed running tool", async () => { + await using tmp = await tmpdir() + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const { agent, controller, sessionUpdates, stop, sdk } = createFakeAgent() + const cwd = "/tmp/opencode-acp-test" + const sessionId = await agent.newSession({ cwd, mcpServers: [] } as any).then((x) => x.sessionId) + const input = { command: "echo hi", description: "run command" } + + sdk.session.messages = async () => ({ + data: [ + { + info: { + role: "assistant", + sessionID: sessionId, + }, + parts: [ + { + type: "tool", + callID: "call_1", + tool: "bash", + state: { + status: "running", + input, + metadata: { output: "hi\n" }, + time: { start: Date.now() }, + }, + }, + ], + }, + ], + }) + + await agent.loadSession({ sessionId, cwd, mcpServers: [] } as any) + controller.push( + toolEvent(sessionId, cwd, { + callID: "call_1", + tool: "bash", + status: "running", + input, + metadata: { output: "hi\nthere\n" }, + }), + ) + await new Promise((r) => setTimeout(r, 20)) + + const types = sessionUpdates + .filter((u) => u.sessionId === sessionId) + .map((u) => u.update) + .filter((u) => "toolCallId" in u && u.toolCallId === "call_1") + .map((u) => u.sessionUpdate) + .filter((u) => u === "tool_call" || u === "tool_call_update") + + expect(types).toEqual(["tool_call", "tool_call_update", "tool_call_update"]) + stop() + }, + }) + }) + test("clears bash snapshot marker on pending state", async () => { await using tmp = await tmpdir() await Instance.provide({ From 082f0cc12734ccc961797ab9a63dd88a2ce3eed5 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Wed, 25 Feb 2026 00:03:15 +1000 Subject: [PATCH 49/95] fix(app): preserve native path separators in file path helpers (#14912) --- packages/app/src/context/file/path.test.ts | 4 ++-- packages/app/src/context/file/path.ts | 24 ++++++++++------------ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/packages/app/src/context/file/path.test.ts b/packages/app/src/context/file/path.test.ts index 7eb5e8b2a358..feef6d466ef4 100644 --- a/packages/app/src/context/file/path.test.ts +++ b/packages/app/src/context/file/path.test.ts @@ -15,10 +15,10 @@ describe("file path helpers", () => { test("normalizes Windows absolute paths with mixed separators", () => { const path = createPathHelpers(() => "C:\\repo") - expect(path.normalize("C:\\repo\\src\\app.ts")).toBe("src/app.ts") + expect(path.normalize("C:\\repo\\src\\app.ts")).toBe("src\\app.ts") expect(path.normalize("C:/repo/src/app.ts")).toBe("src/app.ts") expect(path.normalize("file://C:/repo/src/app.ts")).toBe("src/app.ts") - expect(path.normalize("c:\\repo\\src\\app.ts")).toBe("src/app.ts") + expect(path.normalize("c:\\repo\\src\\app.ts")).toBe("src\\app.ts") }) test("keeps query/hash stripping behavior stable", () => { diff --git a/packages/app/src/context/file/path.ts b/packages/app/src/context/file/path.ts index 72c058aec6b7..53f072b6cb26 100644 --- a/packages/app/src/context/file/path.ts +++ b/packages/app/src/context/file/path.ts @@ -103,32 +103,30 @@ export function encodeFilePath(filepath: string): string { export function createPathHelpers(scope: () => string) { const normalize = (input: string) => { - const root = scope().replace(/\\/g, "/") + const root = scope() - let path = unquoteGitPath(decodeFilePath(stripQueryAndHash(stripFileProtocol(input)))).replace(/\\/g, "/") + let path = unquoteGitPath(decodeFilePath(stripQueryAndHash(stripFileProtocol(input)))) - // Remove initial root prefix, if it's a complete match or followed by / - // (don't want /foo/bar to root of /f). - // For Windows paths, also check for case-insensitive match. - const windows = /^[A-Za-z]:/.test(root) - const canonRoot = windows ? root.toLowerCase() : root - const canonPath = windows ? path.toLowerCase() : path + // Separator-agnostic prefix stripping for Cygwin/native Windows compatibility + // Only case-insensitive on Windows (drive letter or UNC paths) + const windows = /^[A-Za-z]:/.test(root) || root.startsWith("\\\\") + const canonRoot = windows ? root.replace(/\\/g, "/").toLowerCase() : root.replace(/\\/g, "/") + const canonPath = windows ? path.replace(/\\/g, "/").toLowerCase() : path.replace(/\\/g, "/") if ( canonPath.startsWith(canonRoot) && - (canonRoot.endsWith("/") || canonPath === canonRoot || canonPath.startsWith(canonRoot + "/")) + (canonRoot.endsWith("/") || canonPath === canonRoot || canonPath[canonRoot.length] === "/") ) { - // If we match canonRoot + "/", the slash will be removed below. + // Slice from original path to preserve native separators path = path.slice(root.length) } - if (path.startsWith("./")) { + if (path.startsWith("./") || path.startsWith(".\\")) { path = path.slice(2) } - if (path.startsWith("/")) { + if (path.startsWith("/") || path.startsWith("\\")) { path = path.slice(1) } - return path } From c92913e9627ae29b0df64e86bd158302c0578c63 Mon Sep 17 00:00:00 2001 From: adamelmore <2363879+adamdottv@users.noreply.github.com> Date: Tue, 24 Feb 2026 08:21:02 -0600 Subject: [PATCH 50/95] chore: cleanup --- packages/ui/src/components/session-review.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/ui/src/components/session-review.css b/packages/ui/src/components/session-review.css index b9a2180cb8db..ec048d009bb4 100644 --- a/packages/ui/src/components/session-review.css +++ b/packages/ui/src/components/session-review.css @@ -10,6 +10,11 @@ display: none; } + .scroll-view__viewport { + display: flex; + flex-direction: column; + } + [data-slot="session-review-container"] { flex: 1 1 auto; padding-right: 4px; From 5190589632c97b570bb6f9035aa5c80c0fe833e7 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 24 Feb 2026 09:43:16 -0500 Subject: [PATCH 51/95] zen: remove alpha models from models endpoint --- packages/console/app/src/routes/zen/v1/models.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/console/app/src/routes/zen/v1/models.ts b/packages/console/app/src/routes/zen/v1/models.ts index f9c14ededdc0..d2592d20b070 100644 --- a/packages/console/app/src/routes/zen/v1/models.ts +++ b/packages/console/app/src/routes/zen/v1/models.ts @@ -25,6 +25,7 @@ export async function GET(input: APIEvent) { object: "list", data: Object.entries(zenData.models) .filter(([id]) => !disabledModels.includes(id)) + .filter(([id]) => !id.startsWith("alpha-")) .map(([id, _model]) => ({ id, object: "model", From cc02476ea5e02d3c827006dcd0c830f7673556e5 Mon Sep 17 00:00:00 2001 From: OpeOginni <107570612+OpeOginni@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:48:59 +0100 Subject: [PATCH 52/95] refactor: replace error handling with serverErrorMessage utility and checks for if error is ConfigInvalidError (#14685) --- packages/app/src/context/global-sync.tsx | 9 +-- .../app/src/context/global-sync/bootstrap.ts | 8 ++- packages/app/src/utils/server-errors.test.ts | 69 +++++++++++++++++++ packages/app/src/utils/server-errors.ts | 32 +++++++++ 4 files changed, 110 insertions(+), 8 deletions(-) create mode 100644 packages/app/src/utils/server-errors.test.ts create mode 100644 packages/app/src/utils/server-errors.ts diff --git a/packages/app/src/context/global-sync.tsx b/packages/app/src/context/global-sync.tsx index 7e242130f157..9fbc93bde63e 100644 --- a/packages/app/src/context/global-sync.tsx +++ b/packages/app/src/context/global-sync.tsx @@ -36,6 +36,7 @@ import type { ProjectMeta } from "./global-sync/types" import { SESSION_RECENT_LIMIT } from "./global-sync/types" import { sanitizeProject } from "./global-sync/utils" import { usePlatform } from "./platform" +import { formatServerError } from "@/utils/server-errors" type GlobalStore = { ready: boolean @@ -51,11 +52,6 @@ type GlobalStore = { reload: undefined | "pending" | "complete" } -function errorMessage(error: unknown) { - if (error instanceof Error && error.message) return error.message - if (typeof error === "string" && error) return error - return "Unknown error" -} function createGlobalSync() { const globalSDK = useGlobalSDK() @@ -207,8 +203,9 @@ function createGlobalSync() { console.error("Failed to load sessions", err) const project = getFilename(directory) showToast({ + variant: "error", title: language.t("toast.session.listFailed.title", { project }), - description: errorMessage(err), + description: formatServerError(err), }) }) diff --git a/packages/app/src/context/global-sync/bootstrap.ts b/packages/app/src/context/global-sync/bootstrap.ts index 6e7714828900..b35f1cd80145 100644 --- a/packages/app/src/context/global-sync/bootstrap.ts +++ b/packages/app/src/context/global-sync/bootstrap.ts @@ -16,6 +16,7 @@ import { batch } from "solid-js" import { reconcile, type SetStoreFunction, type Store } from "solid-js/store" import type { State, VcsCache } from "./types" import { cmp, normalizeProviderList } from "./utils" +import { formatServerError } from "@/utils/server-errors" type GlobalStore = { ready: boolean @@ -133,8 +134,11 @@ export async function bootstrapDirectory(input: { } catch (err) { console.error("Failed to bootstrap instance", err) const project = getFilename(input.directory) - const message = err instanceof Error ? err.message : String(err) - showToast({ title: `Failed to reload ${project}`, description: message }) + showToast({ + variant: "error", + title: `Failed to reload ${project}`, + description: formatServerError(err) + }) input.setStore("status", "partial") return } diff --git a/packages/app/src/utils/server-errors.test.ts b/packages/app/src/utils/server-errors.test.ts new file mode 100644 index 000000000000..1969d1afc271 --- /dev/null +++ b/packages/app/src/utils/server-errors.test.ts @@ -0,0 +1,69 @@ +import { describe, expect, test } from "bun:test" +import type { ConfigInvalidError } from "./server-errors" +import { formatServerError, parseReabaleConfigInvalidError } from "./server-errors" + +describe("parseReabaleConfigInvalidError", () => { + test("formats issues with file path", () => { + const error = { + name: "ConfigInvalidError", + data: { + path: "opencode.config.ts", + issues: [ + { path: ["settings", "host"], message: "Required" }, + { path: ["mode"], message: "Invalid" }, + ], + }, + } satisfies ConfigInvalidError + + const result = parseReabaleConfigInvalidError(error) + + expect(result).toBe( + ["Invalid configuration", "opencode.config.ts", "settings.host: Required", "mode: Invalid"].join("\n"), + ) + }) + + test("uses trimmed message when issues are missing", () => { + const error = { + name: "ConfigInvalidError", + data: { + path: "config", + message: " Bad value ", + }, + } satisfies ConfigInvalidError + + const result = parseReabaleConfigInvalidError(error) + + expect(result).toBe(["Invalid configuration", "Bad value"].join("\n")) + }) +}) + +describe("formatServerError", () => { + test("formats config invalid errors", () => { + const error = { + name: "ConfigInvalidError", + data: { + message: "Missing host", + }, + } satisfies ConfigInvalidError + + const result = formatServerError(error) + + expect(result).toBe(["Invalid configuration", "Missing host"].join("\n")) + }) + + test("returns error messages", () => { + expect(formatServerError(new Error("Request failed with status 503"))).toBe("Request failed with status 503") + }) + + test("returns provided string errors", () => { + expect(formatServerError("Failed to connect to server")).toBe("Failed to connect to server") + }) + + test("falls back to unknown", () => { + expect(formatServerError(0)).toBe("Unknown error") + }) + + test("falls back for unknown error objects and names", () => { + expect(formatServerError({ name: "ServerTimeoutError", data: { seconds: 30 } })).toBe("Unknown error") + }) +}) diff --git a/packages/app/src/utils/server-errors.ts b/packages/app/src/utils/server-errors.ts new file mode 100644 index 000000000000..4b9727e61d8f --- /dev/null +++ b/packages/app/src/utils/server-errors.ts @@ -0,0 +1,32 @@ +export type ConfigInvalidError = { + name: "ConfigInvalidError" + data: { + path?: string + message?: string + issues?: Array<{ message: string; path: string[] }> + } +} + +export function formatServerError(error: unknown) { + if (isConfigInvalidErrorLike(error)) return parseReabaleConfigInvalidError(error) + if (error instanceof Error && error.message) return error.message + if (typeof error === "string" && error) return error + return "Unknown error" +} + +function isConfigInvalidErrorLike(error: unknown): error is ConfigInvalidError { + if (typeof error !== "object" || error === null) return false + const o = error as Record + return o.name === "ConfigInvalidError" && typeof o.data === "object" && o.data !== null +} + +export function parseReabaleConfigInvalidError(errorInput: ConfigInvalidError) { + const head = "Invalid configuration" + const file = errorInput.data.path && errorInput.data.path !== "config" ? errorInput.data.path : "" + const detail = errorInput.data.message?.trim() ?? "" + const issues = (errorInput.data.issues ?? []).map((issue) => { + return `${issue.path.join(".")}: ${issue.message}` + }) + if (issues.length) return [head, file, "", ...issues].filter(Boolean).join("\n") + return [head, file, detail].filter(Boolean).join("\n") +} From 0d0d0578ebcf1b097d97d57e817664322a0740cc Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Tue, 24 Feb 2026 14:49:52 +0000 Subject: [PATCH 53/95] chore: generate --- packages/app/src/context/global-sync.tsx | 1 - packages/app/src/context/global-sync/bootstrap.ts | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/app/src/context/global-sync.tsx b/packages/app/src/context/global-sync.tsx index 9fbc93bde63e..f87c3fb394ed 100644 --- a/packages/app/src/context/global-sync.tsx +++ b/packages/app/src/context/global-sync.tsx @@ -52,7 +52,6 @@ type GlobalStore = { reload: undefined | "pending" | "complete" } - function createGlobalSync() { const globalSDK = useGlobalSDK() const platform = usePlatform() diff --git a/packages/app/src/context/global-sync/bootstrap.ts b/packages/app/src/context/global-sync/bootstrap.ts index b35f1cd80145..b2610656103d 100644 --- a/packages/app/src/context/global-sync/bootstrap.ts +++ b/packages/app/src/context/global-sync/bootstrap.ts @@ -134,10 +134,10 @@ export async function bootstrapDirectory(input: { } catch (err) { console.error("Failed to bootstrap instance", err) const project = getFilename(input.directory) - showToast({ - variant: "error", - title: `Failed to reload ${project}`, - description: formatServerError(err) + showToast({ + variant: "error", + title: `Failed to reload ${project}`, + description: formatServerError(err), }) input.setStore("status", "partial") return From c6d8e7624deb7470538c1156b73c6f33d2b9935c Mon Sep 17 00:00:00 2001 From: Filip <34747899+neriousy@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:55:17 +0100 Subject: [PATCH 54/95] fix(app): on cancel comment unhighlight lines (#14103) --- packages/app/src/pages/session/file-tabs.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/app/src/pages/session/file-tabs.tsx b/packages/app/src/pages/session/file-tabs.tsx index 032756cabd8d..4b30915d865c 100644 --- a/packages/app/src/pages/session/file-tabs.tsx +++ b/packages/app/src/pages/session/file-tabs.tsx @@ -371,6 +371,12 @@ export function FileTabContent(props: { tab: string }) { }) } + const cancelCommenting = () => { + const p = path() + if (p) file.setSelectedLines(p, null) + setNote("commenting", null) + } + createEffect( on( () => state()?.loaded, @@ -484,7 +490,7 @@ export function FileTabContent(props: { tab: string }) { value={note.draft} selection={formatCommentLabel(range())} onInput={(value) => setNote("draft", value)} - onCancel={() => setCommenting(null)} + onCancel={cancelCommenting} onSubmit={(value) => { const p = path() if (!p) return @@ -498,7 +504,7 @@ export function FileTabContent(props: { tab: string }) { setTimeout(() => { if (!document.activeElement || !current.contains(document.activeElement)) { - setCommenting(null) + cancelCommenting() } }, 0) }} From f8cfb697bd10a328afab4e6a074148c2e651fcb2 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 24 Feb 2026 09:56:05 -0500 Subject: [PATCH 55/95] zen: restrict alpha models to admin workspaces --- packages/console/app/src/routes/zen/util/handler.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/console/app/src/routes/zen/util/handler.ts b/packages/console/app/src/routes/zen/util/handler.ts index 80a4b3ab77b4..1719625839ce 100644 --- a/packages/console/app/src/routes/zen/util/handler.ts +++ b/packages/console/app/src/routes/zen/util/handler.ts @@ -34,6 +34,7 @@ import { createDataDumper } from "./dataDumper" import { createTrialLimiter } from "./trialLimiter" import { createStickyTracker } from "./stickyProviderTracker" import { LiteData } from "@opencode-ai/console-core/lite.js" +import { Resource } from "@opencode-ai/console-resource" type ZenData = Awaited> type RetryOptions = { @@ -59,7 +60,7 @@ export async function handler( const MAX_FAILOVER_RETRIES = 3 const MAX_429_RETRIES = 3 - const FREE_WORKSPACES = [ + const ADMIN_WORKSPACES = [ "wrk_01K46JDFR0E75SG2Q8K172KF3Y", // frank "wrk_01K6W1A3VE0KMNVSCQT43BG2SX", // opencode bench ] @@ -520,6 +521,13 @@ export async function handler( ) if (!data) throw new AuthError("Invalid API key.") + if ( + modelInfo.id.startsWith("alpha-") && + Resource.App.stage === "production" && + !ADMIN_WORKSPACES.includes(data.workspaceID) + ) + throw new AuthError(`Model ${modelInfo.id} not supported`) + logger.metric({ api_key: data.apiKey, workspace: data.workspaceID, @@ -546,7 +554,7 @@ export async function handler( black: data.black, lite: data.lite, provider: data.provider, - isFree: FREE_WORKSPACES.includes(data.workspaceID), + isFree: ADMIN_WORKSPACES.includes(data.workspaceID), isDisabled: !!data.timeDisabled, } } From 68cf011fd3432ffe5f38848c6ec747702077dfbe Mon Sep 17 00:00:00 2001 From: adamelmore <2363879+adamdottv@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:48:22 -0600 Subject: [PATCH 56/95] fix(app): ignore stale part deltas --- packages/app/src/context/global-sdk.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/app/src/context/global-sdk.tsx b/packages/app/src/context/global-sdk.tsx index 8c0035d555b7..c1a87b95b890 100644 --- a/packages/app/src/context/global-sdk.tsx +++ b/packages/app/src/context/global-sdk.tsx @@ -49,9 +49,12 @@ export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleCo let queue: Queued[] = [] let buffer: Queued[] = [] const coalesced = new Map() + const staleDeltas = new Set() let timer: ReturnType | undefined let last = 0 + const deltaKey = (directory: string, messageID: string, partID: string) => `${directory}:${messageID}:${partID}` + const key = (directory: string, payload: Event) => { if (payload.type === "session.status") return `session.status:${directory}:${payload.properties.sessionID}` if (payload.type === "lsp.updated") return `lsp.updated:${directory}` @@ -68,14 +71,20 @@ export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleCo if (queue.length === 0) return const events = queue + const skip = staleDeltas.size > 0 ? new Set(staleDeltas) : undefined queue = buffer buffer = events queue.length = 0 coalesced.clear() + staleDeltas.clear() last = Date.now() batch(() => { for (const event of events) { + if (skip && event.payload.type === "message.part.delta") { + const props = event.payload.properties + if (skip.has(deltaKey(event.directory, props.messageID, props.partID))) continue + } emitter.emit(event.directory, event.payload) } }) @@ -144,6 +153,10 @@ export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleCo const i = coalesced.get(k) if (i !== undefined) { queue[i] = { directory, payload } + if (payload.type === "message.part.updated") { + const part = payload.properties.part + staleDeltas.add(deltaKey(directory, part.messageID, part.id)) + } continue } coalesced.set(k, queue.length) From 2a87860c06b6aaa0e3d017b5cc464d83983efd1d Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 24 Feb 2026 14:49:05 -0500 Subject: [PATCH 57/95] zen: gpt 5.3 codex --- packages/web/src/content/docs/zen.mdx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/web/src/content/docs/zen.mdx b/packages/web/src/content/docs/zen.mdx index 453093206b98..48c040cf2dff 100644 --- a/packages/web/src/content/docs/zen.mdx +++ b/packages/web/src/content/docs/zen.mdx @@ -64,6 +64,7 @@ You can also access our models through the following API endpoints. | Model | Model ID | Endpoint | AI SDK Package | | ------------------ | ------------------ | -------------------------------------------------- | --------------------------- | +| GPT 5.3 Codex | gpt-5.3-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 | gpt-5.2 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.2 Codex | gpt-5.2-codex | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | | GPT 5.1 | gpt-5.1 | `https://opencode.ai/zen/v1/responses` | `@ai-sdk/openai` | @@ -88,11 +89,9 @@ You can also access our models through the following API endpoints. | MiniMax M2.5 Free | minimax-m2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | MiniMax M2.1 | minimax-m2.1 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 5 | glm-5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| GLM 5 Free | glm-5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.7 | glm-4.7 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | GLM 4.6 | glm-4.6 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2.5 | kimi-k2.5 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | -| Kimi K2.5 Free | kimi-k2.5-free | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 Thinking | kimi-k2-thinking | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Kimi K2 | kimi-k2 | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | | Qwen3 Coder 480B | qwen3-coder | `https://opencode.ai/zen/v1/chat/completions` | `@ai-sdk/openai-compatible` | @@ -124,11 +123,9 @@ We support a pay-as-you-go model. Below are the prices **per 1M tokens**. | MiniMax M2.5 Free | Free | Free | Free | - | | MiniMax M2.5 | $0.30 | $1.20 | $0.06 | - | | MiniMax M2.1 | $0.30 | $1.20 | $0.10 | - | -| GLM 5 Free | Free | Free | Free | - | | GLM 5 | $1.00 | $3.20 | $0.20 | - | | GLM 4.7 | $0.60 | $2.20 | $0.10 | - | | GLM 4.6 | $0.60 | $2.20 | $0.10 | - | -| Kimi K2.5 Free | Free | Free | Free | - | | Kimi K2.5 | $0.60 | $3.00 | $0.08 | - | | Kimi K2 Thinking | $0.40 | $2.50 | - | - | | Kimi K2 | $0.40 | $2.50 | - | - | @@ -150,6 +147,7 @@ We support a pay-as-you-go model. Below are the prices **per 1M tokens**. | Gemini 3 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - | | Gemini 3 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - | | Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - | +| GPT 5.3 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 | $1.75 | $14.00 | $0.175 | - | | GPT 5.2 Codex | $1.75 | $14.00 | $0.175 | - | | GPT 5.1 | $1.07 | $8.50 | $0.107 | - | @@ -168,8 +166,6 @@ Credit card fees are passed along at cost (4.4% + $0.30 per transaction); we don The free models: -- GLM 5 Free is available on OpenCode for a limited time. The team is using this time to collect feedback and improve the model. -- Kimi K2.5 Free is available on OpenCode for a limited time. The team is using this time to collect feedback and improve the model. - MiniMax M2.5 Free is available on OpenCode for a limited time. The team is using this time to collect feedback and improve the model. - Big Pickle is a stealth model that's free on OpenCode for a limited time. The team is using this time to collect feedback and improve the model. @@ -201,8 +197,6 @@ charging you more than $20 if your balance goes below $5. All our models are hosted in the US. Our providers follow a zero-retention policy and do not use your data for model training, with the following exceptions: - Big Pickle: During its free period, collected data may be used to improve the model. -- GLM 5 Free: During its free period, collected data may be used to improve the model. -- Kimi K2.5 Free: During its free period, collected data may be used to improve the model. - MiniMax M2.5 Free: During its free period, collected data may be used to improve the model. - OpenAI APIs: Requests are retained for 30 days in accordance with [OpenAI's Data Policies](https://platform.openai.com/docs/guides/your-data). - Anthropic APIs: Requests are retained for 30 days in accordance with [Anthropic's Data Policies](https://docs.anthropic.com/en/docs/claude-code/data-usage). From 2c00eb60bdc6e6ff0362e792e731eaa39204bf72 Mon Sep 17 00:00:00 2001 From: James Long Date: Tue, 24 Feb 2026 17:34:34 -0500 Subject: [PATCH 58/95] feat(core): add workspace-serve command (experimental) (#14960) --- .../opencode/src/cli/cmd/workspace-serve.ts | 59 +++++++++++++++++++ packages/opencode/src/index.ts | 9 ++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 packages/opencode/src/cli/cmd/workspace-serve.ts diff --git a/packages/opencode/src/cli/cmd/workspace-serve.ts b/packages/opencode/src/cli/cmd/workspace-serve.ts new file mode 100644 index 000000000000..9b47defd392f --- /dev/null +++ b/packages/opencode/src/cli/cmd/workspace-serve.ts @@ -0,0 +1,59 @@ +import { cmd } from "./cmd" +import { withNetworkOptions, resolveNetworkOptions } from "../network" +import { Installation } from "../../installation" + +export const WorkspaceServeCommand = cmd({ + command: "workspace-serve", + builder: (yargs) => withNetworkOptions(yargs), + describe: "starts a remote workspace websocket server", + handler: async (args) => { + const opts = await resolveNetworkOptions(args) + const server = Bun.serve<{ id: string }>({ + hostname: opts.hostname, + port: opts.port, + fetch(req, server) { + const url = new URL(req.url) + if (url.pathname === "/ws") { + const id = Bun.randomUUIDv7() + if (server.upgrade(req, { data: { id } })) return + return new Response("Upgrade failed", { status: 400 }) + } + + if (url.pathname === "/health") { + return new Response("ok", { + status: 200, + headers: { + "content-type": "text/plain; charset=utf-8", + }, + }) + } + + return new Response( + JSON.stringify({ + service: "workspace-server", + ws: `ws://${server.hostname}:${server.port}/ws`, + }), + { + status: 200, + headers: { + "content-type": "application/json; charset=utf-8", + }, + }, + ) + }, + websocket: { + open(ws) { + ws.send(JSON.stringify({ type: "ready", id: ws.data.id })) + }, + message(ws, msg) { + const text = typeof msg === "string" ? msg : msg.toString() + ws.send(JSON.stringify({ type: "message", id: ws.data.id, text })) + }, + close() {}, + }, + }) + + console.log(`workspace websocket server listening on ws://${server.hostname}:${server.port}/ws`) + await new Promise(() => {}) + }, +}) diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts index 65515658862b..9af79278c061 100644 --- a/packages/opencode/src/index.ts +++ b/packages/opencode/src/index.ts @@ -13,6 +13,7 @@ import { Installation } from "./installation" import { NamedError } from "@opencode-ai/util/error" import { FormatError } from "./cli/error" import { ServeCommand } from "./cli/cmd/serve" +import { WorkspaceServeCommand } from "./cli/cmd/workspace-serve" import { Filesystem } from "./util/filesystem" import { DebugCommand } from "./cli/cmd/debug" import { StatsCommand } from "./cli/cmd/stats" @@ -45,7 +46,7 @@ process.on("uncaughtException", (e) => { }) }) -const cli = yargs(hideBin(process.argv)) +let cli = yargs(hideBin(process.argv)) .parserConfiguration({ "populate--": true }) .scriptName("opencode") .wrap(100) @@ -141,6 +142,12 @@ const cli = yargs(hideBin(process.argv)) .command(PrCommand) .command(SessionCommand) .command(DbCommand) + +if (Installation.isLocal()) { + cli = cli.command(WorkspaceServeCommand) +} + +cli = cli .fail((msg, err) => { if ( msg?.startsWith("Unknown argument") || From 29ddd55088af6f31c24f392c9f5dbf472918114f Mon Sep 17 00:00:00 2001 From: opencode Date: Tue, 24 Feb 2026 23:29:02 +0000 Subject: [PATCH 59/95] release: v1.2.11 --- bun.lock | 30 +++++++++++++------------- packages/app/package.json | 2 +- packages/console/app/package.json | 2 +- packages/console/core/package.json | 2 +- packages/console/function/package.json | 2 +- packages/console/mail/package.json | 2 +- packages/desktop/package.json | 2 +- packages/enterprise/package.json | 2 +- packages/extensions/zed/extension.toml | 12 +++++------ packages/function/package.json | 2 +- packages/opencode/package.json | 2 +- packages/plugin/package.json | 2 +- packages/sdk/js/package.json | 2 +- packages/slack/package.json | 2 +- packages/ui/package.json | 2 +- packages/util/package.json | 2 +- packages/web/package.json | 2 +- sdks/vscode/package.json | 2 +- 18 files changed, 37 insertions(+), 37 deletions(-) diff --git a/bun.lock b/bun.lock index d68a9228fe77..d81245ff7d4f 100644 --- a/bun.lock +++ b/bun.lock @@ -25,7 +25,7 @@ }, "packages/app": { "name": "@opencode-ai/app", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", @@ -75,7 +75,7 @@ }, "packages/console/app": { "name": "@opencode-ai/console-app", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@cloudflare/vite-plugin": "1.15.2", "@ibm/plex": "6.4.1", @@ -109,7 +109,7 @@ }, "packages/console/core": { "name": "@opencode-ai/console-core", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@jsx-email/render": "1.1.1", @@ -136,7 +136,7 @@ }, "packages/console/function": { "name": "@opencode-ai/console-function", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@ai-sdk/anthropic": "2.0.0", "@ai-sdk/openai": "2.0.2", @@ -160,7 +160,7 @@ }, "packages/console/mail": { "name": "@opencode-ai/console-mail", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", @@ -184,7 +184,7 @@ }, "packages/desktop": { "name": "@opencode-ai/desktop", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@opencode-ai/app": "workspace:*", "@opencode-ai/ui": "workspace:*", @@ -217,7 +217,7 @@ }, "packages/enterprise": { "name": "@opencode-ai/enterprise", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@opencode-ai/ui": "workspace:*", "@opencode-ai/util": "workspace:*", @@ -246,7 +246,7 @@ }, "packages/function": { "name": "@opencode-ai/function", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@octokit/auth-app": "8.0.1", "@octokit/rest": "catalog:", @@ -262,7 +262,7 @@ }, "packages/opencode": { "name": "opencode", - "version": "1.2.10", + "version": "1.2.11", "bin": { "opencode": "./bin/opencode", }, @@ -376,7 +376,7 @@ }, "packages/plugin": { "name": "@opencode-ai/plugin", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@opencode-ai/sdk": "workspace:*", "zod": "catalog:", @@ -396,7 +396,7 @@ }, "packages/sdk/js": { "name": "@opencode-ai/sdk", - "version": "1.2.10", + "version": "1.2.11", "devDependencies": { "@hey-api/openapi-ts": "0.90.10", "@tsconfig/node22": "catalog:", @@ -407,7 +407,7 @@ }, "packages/slack": { "name": "@opencode-ai/slack", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@opencode-ai/sdk": "workspace:*", "@slack/bolt": "^3.17.1", @@ -420,7 +420,7 @@ }, "packages/ui": { "name": "@opencode-ai/ui", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", @@ -462,7 +462,7 @@ }, "packages/util": { "name": "@opencode-ai/util", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "zod": "catalog:", }, @@ -473,7 +473,7 @@ }, "packages/web": { "name": "@opencode-ai/web", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", diff --git a/packages/app/package.json b/packages/app/package.json index b9397b0f40de..360cbbcc01bb 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/app", - "version": "1.2.10", + "version": "1.2.11", "description": "", "type": "module", "exports": { diff --git a/packages/console/app/package.json b/packages/console/app/package.json index 395feeb4af5c..a866785ce081 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-app", - "version": "1.2.10", + "version": "1.2.11", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/console/core/package.json b/packages/console/core/package.json index aac79d669009..c06964f7d851 100644 --- a/packages/console/core/package.json +++ b/packages/console/core/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-core", - "version": "1.2.10", + "version": "1.2.11", "private": true, "type": "module", "license": "MIT", diff --git a/packages/console/function/package.json b/packages/console/function/package.json index 386ee19df23f..351f78bddcb8 100644 --- a/packages/console/function/package.json +++ b/packages/console/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-function", - "version": "1.2.10", + "version": "1.2.11", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/console/mail/package.json b/packages/console/mail/package.json index 7a08244bb629..f61e7f9ab41d 100644 --- a/packages/console/mail/package.json +++ b/packages/console/mail/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-mail", - "version": "1.2.10", + "version": "1.2.11", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", diff --git a/packages/desktop/package.json b/packages/desktop/package.json index dc25cb020373..fba0730b05e4 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@opencode-ai/desktop", "private": true, - "version": "1.2.10", + "version": "1.2.11", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/enterprise/package.json b/packages/enterprise/package.json index fae66ab31a87..229f6b2552a0 100644 --- a/packages/enterprise/package.json +++ b/packages/enterprise/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/enterprise", - "version": "1.2.10", + "version": "1.2.11", "private": true, "type": "module", "license": "MIT", diff --git a/packages/extensions/zed/extension.toml b/packages/extensions/zed/extension.toml index a112d793fd76..5e13ecdb6951 100644 --- a/packages/extensions/zed/extension.toml +++ b/packages/extensions/zed/extension.toml @@ -1,7 +1,7 @@ id = "opencode" name = "OpenCode" description = "The open source coding agent." -version = "1.2.10" +version = "1.2.11" schema_version = 1 authors = ["Anomaly"] repository = "https://github.com/anomalyco/opencode" @@ -11,26 +11,26 @@ name = "OpenCode" icon = "./icons/opencode.svg" [agent_servers.opencode.targets.darwin-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.10/opencode-darwin-arm64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-darwin-arm64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.darwin-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.10/opencode-darwin-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-darwin-x64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.10/opencode-linux-arm64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-linux-arm64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.10/opencode-linux-x64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-linux-x64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.windows-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.10/opencode-windows-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-windows-x64.zip" cmd = "./opencode.exe" args = ["acp"] diff --git a/packages/function/package.json b/packages/function/package.json index c67be670961b..26fc3c0410d0 100644 --- a/packages/function/package.json +++ b/packages/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/function", - "version": "1.2.10", + "version": "1.2.11", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/opencode/package.json b/packages/opencode/package.json index d19376adf38d..857e912c30e2 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "1.2.10", + "version": "1.2.11", "name": "opencode", "type": "module", "license": "MIT", diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 623a117929f7..97da559e7557 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/plugin", - "version": "1.2.10", + "version": "1.2.11", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json index bd3627e35b4c..d2b3c6115901 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/sdk", - "version": "1.2.10", + "version": "1.2.11", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/slack/package.json b/packages/slack/package.json index d000cb479943..678380474769 100644 --- a/packages/slack/package.json +++ b/packages/slack/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/slack", - "version": "1.2.10", + "version": "1.2.11", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/ui/package.json b/packages/ui/package.json index 3519996085d7..505d8bb8c533 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/ui", - "version": "1.2.10", + "version": "1.2.11", "type": "module", "license": "MIT", "exports": { diff --git a/packages/util/package.json b/packages/util/package.json index 4bcbb0305d4e..fbb123591b31 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/util", - "version": "1.2.10", + "version": "1.2.11", "private": true, "type": "module", "license": "MIT", diff --git a/packages/web/package.json b/packages/web/package.json index 110c6ca2354f..0b71c07142a7 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -2,7 +2,7 @@ "name": "@opencode-ai/web", "type": "module", "license": "MIT", - "version": "1.2.10", + "version": "1.2.11", "scripts": { "dev": "astro dev", "dev:remote": "VITE_API_URL=https://api.opencode.ai astro dev", diff --git a/sdks/vscode/package.json b/sdks/vscode/package.json index 2e2807923eab..fffd9e149dd9 100644 --- a/sdks/vscode/package.json +++ b/sdks/vscode/package.json @@ -2,7 +2,7 @@ "name": "opencode", "displayName": "opencode", "description": "opencode for VS Code", - "version": "1.2.10", + "version": "1.2.11", "publisher": "sst-dev", "repository": { "type": "git", From 3af12c53c433d1f49abde0874dc02c2e6c018930 Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:24:47 +1000 Subject: [PATCH 60/95] fix(opencode): import custom tools via file URL (#14971) --- packages/opencode/src/tool/registry.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/tool/registry.ts b/packages/opencode/src/tool/registry.ts index ef0e78ffa863..cf3c2cad838e 100644 --- a/packages/opencode/src/tool/registry.ts +++ b/packages/opencode/src/tool/registry.ts @@ -28,6 +28,7 @@ import { Truncate } from "./truncation" import { PlanExitTool, PlanEnterTool } from "./plan" import { ApplyPatchTool } from "./apply_patch" import { Glob } from "../util/glob" +import { pathToFileURL } from "url" export namespace ToolRegistry { const log = Log.create({ service: "tool.registry" }) @@ -43,7 +44,7 @@ export namespace ToolRegistry { if (matches.length) await Config.waitForDependencies() for (const match of matches) { const namespace = path.basename(match, path.extname(match)) - const mod = await import(match) + const mod = await import(pathToFileURL(match).href) for (const [id, def] of Object.entries(mod)) { custom.push(fromPlugin(id === "default" ? namespace : `${namespace}_${id}`, def)) } From e7182637784b7d558657da5b6aede92f0db1c11f Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:46:12 +1000 Subject: [PATCH 61/95] fix(project): await git id cache write (#14977) --- packages/opencode/src/project/project.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/project/project.ts b/packages/opencode/src/project/project.ts index adbe2b9fb159..a75a0a02e78f 100644 --- a/packages/opencode/src/project/project.ts +++ b/packages/opencode/src/project/project.ts @@ -138,7 +138,7 @@ export namespace Project { id = roots[0] if (id) { - void Filesystem.write(path.join(dotgit, "opencode"), id).catch(() => undefined) + await Filesystem.write(path.join(dotgit, "opencode"), id).catch(() => undefined) } } From da40ab7b3d242208b5c759e55e548c13c658372a Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Wed, 25 Feb 2026 11:38:23 +1000 Subject: [PATCH 62/95] fix(opencode): disable config bun cache in CI (#14985) --- packages/opencode/src/bun/index.ts | 2 +- packages/opencode/src/config/config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/bun/index.ts b/packages/opencode/src/bun/index.ts index 79aaae2bcc4a..35ad74ec4c34 100644 --- a/packages/opencode/src/bun/index.ts +++ b/packages/opencode/src/bun/index.ts @@ -93,7 +93,7 @@ export namespace BunProc { "--force", "--exact", // TODO: get rid of this case (see: https://github.com/oven-sh/bun/issues/19936) - ...(proxied() ? ["--no-cache"] : []), + ...(proxied() || process.env.CI ? ["--no-cache"] : []), "--cwd", Global.Path.cache, pkg + "@" + version, diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index b1e00fccb850..761ce23f3d6c 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -289,7 +289,7 @@ export namespace Config { [ "install", // TODO: get rid of this case (see: https://github.com/oven-sh/bun/issues/19936) - ...(proxied() ? ["--no-cache"] : []), + ...(proxied() || process.env.CI ? ["--no-cache"] : []), ], { cwd: dir }, ).catch((err) => { From 814c1d398cc4d8c3a6e321e8f96699d6f1dc10ae Mon Sep 17 00:00:00 2001 From: Dax Date: Tue, 24 Feb 2026 23:04:15 -0500 Subject: [PATCH 63/95] refactor: migrate Bun.spawn to Process utility with timeout and cleanup (#14448) --- packages/opencode/src/bun/index.ts | 21 ++---- packages/opencode/src/bun/registry.ts | 10 +-- packages/opencode/src/cli/cmd/auth.ts | 12 +++- packages/opencode/src/cli/cmd/session.ts | 9 ++- .../src/cli/cmd/tui/util/clipboard.ts | 13 ++-- .../opencode/src/cli/cmd/tui/util/editor.ts | 4 +- packages/opencode/src/file/ripgrep.ts | 57 +++++++-------- packages/opencode/src/format/formatter.ts | 10 +-- packages/opencode/src/format/index.ts | 17 +++-- packages/opencode/src/lsp/server.ts | 48 ++++++------- packages/opencode/src/tool/grep.ts | 14 ++-- packages/opencode/src/util/git.ts | 23 +++--- packages/opencode/src/util/process.ts | 71 +++++++++++++++++++ 13 files changed, 199 insertions(+), 110 deletions(-) create mode 100644 packages/opencode/src/util/process.ts diff --git a/packages/opencode/src/bun/index.ts b/packages/opencode/src/bun/index.ts index 35ad74ec4c34..e3bddcc22639 100644 --- a/packages/opencode/src/bun/index.ts +++ b/packages/opencode/src/bun/index.ts @@ -4,20 +4,21 @@ import { Log } from "../util/log" import path from "path" import { Filesystem } from "../util/filesystem" import { NamedError } from "@opencode-ai/util/error" -import { readableStreamToText } from "bun" +import { text } from "node:stream/consumers" import { Lock } from "../util/lock" import { PackageRegistry } from "./registry" import { proxied } from "@/util/proxied" +import { Process } from "../util/process" export namespace BunProc { const log = Log.create({ service: "bun" }) - export async function run(cmd: string[], options?: Bun.SpawnOptions.OptionsObject) { + export async function run(cmd: string[], options?: Process.Options) { log.info("running", { cmd: [which(), ...cmd], ...options, }) - const result = Bun.spawn([which(), ...cmd], { + const result = Process.spawn([which(), ...cmd], { ...options, stdout: "pipe", stderr: "pipe", @@ -28,23 +29,15 @@ export namespace BunProc { }, }) const code = await result.exited - const stdout = result.stdout - ? typeof result.stdout === "number" - ? result.stdout - : await readableStreamToText(result.stdout) - : undefined - const stderr = result.stderr - ? typeof result.stderr === "number" - ? result.stderr - : await readableStreamToText(result.stderr) - : undefined + const stdout = result.stdout ? await text(result.stdout) : undefined + const stderr = result.stderr ? await text(result.stderr) : undefined log.info("done", { code, stdout, stderr, }) if (code !== 0) { - throw new Error(`Command failed with exit code ${result.exitCode}`) + throw new Error(`Command failed with exit code ${code}`) } return result } diff --git a/packages/opencode/src/bun/registry.ts b/packages/opencode/src/bun/registry.ts index c567668acd71..a85a6c989c82 100644 --- a/packages/opencode/src/bun/registry.ts +++ b/packages/opencode/src/bun/registry.ts @@ -1,5 +1,7 @@ -import { readableStreamToText, semver } from "bun" +import { semver } from "bun" +import { text } from "node:stream/consumers" import { Log } from "../util/log" +import { Process } from "../util/process" export namespace PackageRegistry { const log = Log.create({ service: "bun" }) @@ -9,7 +11,7 @@ export namespace PackageRegistry { } export async function info(pkg: string, field: string, cwd?: string): Promise { - const result = Bun.spawn([which(), "info", pkg, field], { + const result = Process.spawn([which(), "info", pkg, field], { cwd, stdout: "pipe", stderr: "pipe", @@ -20,8 +22,8 @@ export namespace PackageRegistry { }) const code = await result.exited - const stdout = result.stdout ? await readableStreamToText(result.stdout) : "" - const stderr = result.stderr ? await readableStreamToText(result.stderr) : "" + const stdout = result.stdout ? await text(result.stdout) : "" + const stderr = result.stderr ? await text(result.stderr) : "" if (code !== 0) { log.warn("bun info failed", { pkg, field, code, stderr }) diff --git a/packages/opencode/src/cli/cmd/auth.ts b/packages/opencode/src/cli/cmd/auth.ts index e050a0abf803..4a97a5e0b83c 100644 --- a/packages/opencode/src/cli/cmd/auth.ts +++ b/packages/opencode/src/cli/cmd/auth.ts @@ -11,6 +11,8 @@ import { Global } from "../../global" import { Plugin } from "../../plugin" import { Instance } from "../../project/instance" import type { Hooks } from "@opencode-ai/plugin" +import { Process } from "../../util/process" +import { text } from "node:stream/consumers" type PluginAuth = NonNullable @@ -263,8 +265,7 @@ export const AuthLoginCommand = cmd({ if (args.url) { const wellknown = await fetch(`${args.url}/.well-known/opencode`).then((x) => x.json() as any) prompts.log.info(`Running \`${wellknown.auth.command.join(" ")}\``) - const proc = Bun.spawn({ - cmd: wellknown.auth.command, + const proc = Process.spawn(wellknown.auth.command, { stdout: "pipe", }) const exit = await proc.exited @@ -273,7 +274,12 @@ export const AuthLoginCommand = cmd({ prompts.outro("Done") return } - const token = await new Response(proc.stdout).text() + if (!proc.stdout) { + prompts.log.error("Failed") + prompts.outro("Done") + return + } + const token = await text(proc.stdout) await Auth.set(args.url, { type: "wellknown", key: wellknown.auth.env, diff --git a/packages/opencode/src/cli/cmd/session.ts b/packages/opencode/src/cli/cmd/session.ts index 4aa702359d17..7fb5fda97b9b 100644 --- a/packages/opencode/src/cli/cmd/session.ts +++ b/packages/opencode/src/cli/cmd/session.ts @@ -6,6 +6,7 @@ import { UI } from "../ui" import { Locale } from "../../util/locale" import { Flag } from "../../flag/flag" import { Filesystem } from "../../util/filesystem" +import { Process } from "../../util/process" import { EOL } from "os" import path from "path" @@ -102,13 +103,17 @@ export const SessionListCommand = cmd({ const shouldPaginate = process.stdout.isTTY && !args.maxCount && args.format === "table" if (shouldPaginate) { - const proc = Bun.spawn({ - cmd: pagerCmd(), + const proc = Process.spawn(pagerCmd(), { stdin: "pipe", stdout: "inherit", stderr: "inherit", }) + if (!proc.stdin) { + console.log(output) + return + } + proc.stdin.write(output) proc.stdin.end() await proc.exited diff --git a/packages/opencode/src/cli/cmd/tui/util/clipboard.ts b/packages/opencode/src/cli/cmd/tui/util/clipboard.ts index 7d1aad3a86e8..1a8197bf4e81 100644 --- a/packages/opencode/src/cli/cmd/tui/util/clipboard.ts +++ b/packages/opencode/src/cli/cmd/tui/util/clipboard.ts @@ -5,6 +5,7 @@ import { lazy } from "../../../../util/lazy.js" import { tmpdir } from "os" import path from "path" import { Filesystem } from "../../../../util/filesystem" +import { Process } from "../../../../util/process" /** * Writes text to clipboard via OSC 52 escape sequence. @@ -87,7 +88,8 @@ export namespace Clipboard { if (process.env["WAYLAND_DISPLAY"] && Bun.which("wl-copy")) { console.log("clipboard: using wl-copy") return async (text: string) => { - const proc = Bun.spawn(["wl-copy"], { stdin: "pipe", stdout: "ignore", stderr: "ignore" }) + const proc = Process.spawn(["wl-copy"], { stdin: "pipe", stdout: "ignore", stderr: "ignore" }) + if (!proc.stdin) return proc.stdin.write(text) proc.stdin.end() await proc.exited.catch(() => {}) @@ -96,11 +98,12 @@ export namespace Clipboard { if (Bun.which("xclip")) { console.log("clipboard: using xclip") return async (text: string) => { - const proc = Bun.spawn(["xclip", "-selection", "clipboard"], { + const proc = Process.spawn(["xclip", "-selection", "clipboard"], { stdin: "pipe", stdout: "ignore", stderr: "ignore", }) + if (!proc.stdin) return proc.stdin.write(text) proc.stdin.end() await proc.exited.catch(() => {}) @@ -109,11 +112,12 @@ export namespace Clipboard { if (Bun.which("xsel")) { console.log("clipboard: using xsel") return async (text: string) => { - const proc = Bun.spawn(["xsel", "--clipboard", "--input"], { + const proc = Process.spawn(["xsel", "--clipboard", "--input"], { stdin: "pipe", stdout: "ignore", stderr: "ignore", }) + if (!proc.stdin) return proc.stdin.write(text) proc.stdin.end() await proc.exited.catch(() => {}) @@ -125,7 +129,7 @@ export namespace Clipboard { console.log("clipboard: using powershell") return async (text: string) => { // Pipe via stdin to avoid PowerShell string interpolation ($env:FOO, $(), etc.) - const proc = Bun.spawn( + const proc = Process.spawn( [ "powershell.exe", "-NonInteractive", @@ -140,6 +144,7 @@ export namespace Clipboard { }, ) + if (!proc.stdin) return proc.stdin.write(text) proc.stdin.end() await proc.exited.catch(() => {}) diff --git a/packages/opencode/src/cli/cmd/tui/util/editor.ts b/packages/opencode/src/cli/cmd/tui/util/editor.ts index cb7c691bbde9..6d32c63c0010 100644 --- a/packages/opencode/src/cli/cmd/tui/util/editor.ts +++ b/packages/opencode/src/cli/cmd/tui/util/editor.ts @@ -4,6 +4,7 @@ import { tmpdir } from "node:os" import { join } from "node:path" import { CliRenderer } from "@opentui/core" import { Filesystem } from "@/util/filesystem" +import { Process } from "@/util/process" export namespace Editor { export async function open(opts: { value: string; renderer: CliRenderer }): Promise { @@ -17,8 +18,7 @@ export namespace Editor { opts.renderer.suspend() opts.renderer.currentRenderBuffer.clear() const parts = editor.split(" ") - const proc = Bun.spawn({ - cmd: [...parts, filepath], + const proc = Process.spawn([...parts, filepath], { stdin: "inherit", stdout: "inherit", stderr: "inherit", diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts index ca1eadae8e00..9c4e9cf02846 100644 --- a/packages/opencode/src/file/ripgrep.ts +++ b/packages/opencode/src/file/ripgrep.ts @@ -7,6 +7,8 @@ import { NamedError } from "@opencode-ai/util/error" import { lazy } from "../util/lazy" import { $ } from "bun" import { Filesystem } from "../util/filesystem" +import { Process } from "../util/process" +import { text } from "node:stream/consumers" import { ZipReader, BlobReader, BlobWriter } from "@zip.js/zip.js" import { Log } from "@/util/log" @@ -153,17 +155,19 @@ export namespace Ripgrep { if (platformKey.endsWith("-darwin")) args.push("--include=*/rg") if (platformKey.endsWith("-linux")) args.push("--wildcards", "*/rg") - const proc = Bun.spawn(args, { + const proc = Process.spawn(args, { cwd: Global.Path.bin, stderr: "pipe", stdout: "pipe", }) - await proc.exited - if (proc.exitCode !== 0) + const exit = await proc.exited + if (exit !== 0) { + const stderr = proc.stderr ? await text(proc.stderr) : "" throw new ExtractionFailedError({ filepath, - stderr: await Bun.readableStreamToText(proc.stderr), + stderr, }) + } } if (config.extension === "zip") { const zipFileReader = new ZipReader(new BlobReader(new Blob([arrayBuffer]))) @@ -227,8 +231,7 @@ export namespace Ripgrep { } } - // Bun.spawn should throw this, but it incorrectly reports that the executable does not exist. - // See https://github.com/oven-sh/bun/issues/24012 + // Guard against invalid cwd to provide a consistent ENOENT error. if (!(await fs.stat(input.cwd).catch(() => undefined))?.isDirectory()) { throw Object.assign(new Error(`No such file or directory: '${input.cwd}'`), { code: "ENOENT", @@ -237,41 +240,35 @@ export namespace Ripgrep { }) } - const proc = Bun.spawn(args, { + const proc = Process.spawn(args, { cwd: input.cwd, stdout: "pipe", stderr: "ignore", - maxBuffer: 1024 * 1024 * 20, - signal: input.signal, + abort: input.signal, }) - const reader = proc.stdout.getReader() - const decoder = new TextDecoder() - let buffer = "" - - try { - while (true) { - input.signal?.throwIfAborted() + if (!proc.stdout) { + throw new Error("Process output not available") + } - const { done, value } = await reader.read() - if (done) break + let buffer = "" + const stream = proc.stdout as AsyncIterable + for await (const chunk of stream) { + input.signal?.throwIfAborted() - buffer += decoder.decode(value, { stream: true }) - // Handle both Unix (\n) and Windows (\r\n) line endings - const lines = buffer.split(/\r?\n/) - buffer = lines.pop() || "" + buffer += typeof chunk === "string" ? chunk : chunk.toString() + // Handle both Unix (\n) and Windows (\r\n) line endings + const lines = buffer.split(/\r?\n/) + buffer = lines.pop() || "" - for (const line of lines) { - if (line) yield line - } + for (const line of lines) { + if (line) yield line } - - if (buffer) yield buffer - } finally { - reader.releaseLock() - await proc.exited } + if (buffer) yield buffer + await proc.exited + input.signal?.throwIfAborted() } diff --git a/packages/opencode/src/format/formatter.ts b/packages/opencode/src/format/formatter.ts index 47b2d6a12d21..19b9e2cbe971 100644 --- a/packages/opencode/src/format/formatter.ts +++ b/packages/opencode/src/format/formatter.ts @@ -1,7 +1,8 @@ -import { readableStreamToText } from "bun" +import { text } from "node:stream/consumers" import { BunProc } from "../bun" import { Instance } from "../project/instance" import { Filesystem } from "../util/filesystem" +import { Process } from "../util/process" import { Flag } from "@/flag/flag" export interface Info { @@ -213,12 +214,13 @@ export const rlang: Info = { if (airPath == null) return false try { - const proc = Bun.spawn(["air", "--help"], { + const proc = Process.spawn(["air", "--help"], { stdout: "pipe", stderr: "pipe", }) await proc.exited - const output = await readableStreamToText(proc.stdout) + if (!proc.stdout) return false + const output = await text(proc.stdout) // Check for "Air: An R language server and formatter" const firstLine = output.split("\n")[0] @@ -238,7 +240,7 @@ export const uvformat: Info = { async enabled() { if (await ruff.enabled()) return false if (Bun.which("uv") !== null) { - const proc = Bun.spawn(["uv", "format", "--help"], { stderr: "pipe", stdout: "pipe" }) + const proc = Process.spawn(["uv", "format", "--help"], { stderr: "pipe", stdout: "pipe" }) const code = await proc.exited return code === 0 } diff --git a/packages/opencode/src/format/index.ts b/packages/opencode/src/format/index.ts index bab758030b9f..b849f778ecef 100644 --- a/packages/opencode/src/format/index.ts +++ b/packages/opencode/src/format/index.ts @@ -8,6 +8,7 @@ import * as Formatter from "./formatter" import { Config } from "../config/config" import { mergeDeep } from "remeda" import { Instance } from "../project/instance" +import { Process } from "../util/process" export namespace Format { const log = Log.create({ service: "format" }) @@ -110,13 +111,15 @@ export namespace Format { for (const item of await getFormatter(ext)) { log.info("running", { command: item.command }) try { - const proc = Bun.spawn({ - cmd: item.command.map((x) => x.replace("$FILE", file)), - cwd: Instance.directory, - env: { ...process.env, ...item.environment }, - stdout: "ignore", - stderr: "ignore", - }) + const proc = Process.spawn( + item.command.map((x) => x.replace("$FILE", file)), + { + cwd: Instance.directory, + env: { ...process.env, ...item.environment }, + stdout: "ignore", + stderr: "ignore", + }, + ) const exit = await proc.exited if (exit !== 0) log.error("failed", { diff --git a/packages/opencode/src/lsp/server.ts b/packages/opencode/src/lsp/server.ts index a4ebeb5a2567..afd297a5ed60 100644 --- a/packages/opencode/src/lsp/server.ts +++ b/packages/opencode/src/lsp/server.ts @@ -4,12 +4,14 @@ import os from "os" import { Global } from "../global" import { Log } from "../util/log" import { BunProc } from "../bun" -import { $, readableStreamToText } from "bun" +import { $ } from "bun" +import { text } from "node:stream/consumers" import fs from "fs/promises" import { Filesystem } from "../util/filesystem" import { Instance } from "../project/instance" import { Flag } from "../flag/flag" import { Archive } from "../util/archive" +import { Process } from "../util/process" export namespace LSPServer { const log = Log.create({ service: "lsp.server" }) @@ -133,7 +135,7 @@ export namespace LSPServer { ) if (!(await Filesystem.exists(js))) { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return - await Bun.spawn([BunProc.which(), "install", "@vue/language-server"], { + await Process.spawn([BunProc.which(), "install", "@vue/language-server"], { cwd: Global.Path.bin, env: { ...process.env, @@ -263,14 +265,16 @@ export namespace LSPServer { } if (lintBin) { - const proc = Bun.spawn([lintBin, "--help"], { stdout: "pipe" }) + const proc = Process.spawn([lintBin, "--help"], { stdout: "pipe" }) await proc.exited - const help = await readableStreamToText(proc.stdout) - if (help.includes("--lsp")) { - return { - process: spawn(lintBin, ["--lsp"], { - cwd: root, - }), + if (proc.stdout) { + const help = await text(proc.stdout) + if (help.includes("--lsp")) { + return { + process: spawn(lintBin, ["--lsp"], { + cwd: root, + }), + } } } } @@ -372,8 +376,7 @@ export namespace LSPServer { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return log.info("installing gopls") - const proc = Bun.spawn({ - cmd: ["go", "install", "golang.org/x/tools/gopls@latest"], + const proc = Process.spawn(["go", "install", "golang.org/x/tools/gopls@latest"], { env: { ...process.env, GOBIN: Global.Path.bin }, stdout: "pipe", stderr: "pipe", @@ -414,8 +417,7 @@ export namespace LSPServer { } if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return log.info("installing rubocop") - const proc = Bun.spawn({ - cmd: ["gem", "install", "rubocop", "--bindir", Global.Path.bin], + const proc = Process.spawn(["gem", "install", "rubocop", "--bindir", Global.Path.bin], { stdout: "pipe", stderr: "pipe", stdin: "pipe", @@ -513,7 +515,7 @@ export namespace LSPServer { const js = path.join(Global.Path.bin, "node_modules", "pyright", "dist", "pyright-langserver.js") if (!(await Filesystem.exists(js))) { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return - await Bun.spawn([BunProc.which(), "install", "pyright"], { + await Process.spawn([BunProc.which(), "install", "pyright"], { cwd: Global.Path.bin, env: { ...process.env, @@ -746,8 +748,7 @@ export namespace LSPServer { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return log.info("installing csharp-ls via dotnet tool") - const proc = Bun.spawn({ - cmd: ["dotnet", "tool", "install", "csharp-ls", "--tool-path", Global.Path.bin], + const proc = Process.spawn(["dotnet", "tool", "install", "csharp-ls", "--tool-path", Global.Path.bin], { stdout: "pipe", stderr: "pipe", stdin: "pipe", @@ -786,8 +787,7 @@ export namespace LSPServer { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return log.info("installing fsautocomplete via dotnet tool") - const proc = Bun.spawn({ - cmd: ["dotnet", "tool", "install", "fsautocomplete", "--tool-path", Global.Path.bin], + const proc = Process.spawn(["dotnet", "tool", "install", "fsautocomplete", "--tool-path", Global.Path.bin], { stdout: "pipe", stderr: "pipe", stdin: "pipe", @@ -1047,7 +1047,7 @@ export namespace LSPServer { const js = path.join(Global.Path.bin, "node_modules", "svelte-language-server", "bin", "server.js") if (!(await Filesystem.exists(js))) { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return - await Bun.spawn([BunProc.which(), "install", "svelte-language-server"], { + await Process.spawn([BunProc.which(), "install", "svelte-language-server"], { cwd: Global.Path.bin, env: { ...process.env, @@ -1094,7 +1094,7 @@ export namespace LSPServer { const js = path.join(Global.Path.bin, "node_modules", "@astrojs", "language-server", "bin", "nodeServer.js") if (!(await Filesystem.exists(js))) { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return - await Bun.spawn([BunProc.which(), "install", "@astrojs/language-server"], { + await Process.spawn([BunProc.which(), "install", "@astrojs/language-server"], { cwd: Global.Path.bin, env: { ...process.env, @@ -1339,7 +1339,7 @@ export namespace LSPServer { const exists = await Filesystem.exists(js) if (!exists) { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return - await Bun.spawn([BunProc.which(), "install", "yaml-language-server"], { + await Process.spawn([BunProc.which(), "install", "yaml-language-server"], { cwd: Global.Path.bin, env: { ...process.env, @@ -1518,7 +1518,7 @@ export namespace LSPServer { const js = path.join(Global.Path.bin, "node_modules", "intelephense", "lib", "intelephense.js") if (!(await Filesystem.exists(js))) { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return - await Bun.spawn([BunProc.which(), "install", "intelephense"], { + await Process.spawn([BunProc.which(), "install", "intelephense"], { cwd: Global.Path.bin, env: { ...process.env, @@ -1615,7 +1615,7 @@ export namespace LSPServer { const js = path.join(Global.Path.bin, "node_modules", "bash-language-server", "out", "cli.js") if (!(await Filesystem.exists(js))) { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return - await Bun.spawn([BunProc.which(), "install", "bash-language-server"], { + await Process.spawn([BunProc.which(), "install", "bash-language-server"], { cwd: Global.Path.bin, env: { ...process.env, @@ -1827,7 +1827,7 @@ export namespace LSPServer { const js = path.join(Global.Path.bin, "node_modules", "dockerfile-language-server-nodejs", "lib", "server.js") if (!(await Filesystem.exists(js))) { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return - await Bun.spawn([BunProc.which(), "install", "dockerfile-language-server-nodejs"], { + await Process.spawn([BunProc.which(), "install", "dockerfile-language-server-nodejs"], { cwd: Global.Path.bin, env: { ...process.env, diff --git a/packages/opencode/src/tool/grep.ts b/packages/opencode/src/tool/grep.ts index 00497d4e3fd8..82e7ac1667e1 100644 --- a/packages/opencode/src/tool/grep.ts +++ b/packages/opencode/src/tool/grep.ts @@ -1,7 +1,9 @@ import z from "zod" +import { text } from "node:stream/consumers" import { Tool } from "./tool" import { Filesystem } from "../util/filesystem" import { Ripgrep } from "../file/ripgrep" +import { Process } from "../util/process" import DESCRIPTION from "./grep.txt" import { Instance } from "../project/instance" @@ -44,14 +46,18 @@ export const GrepTool = Tool.define("grep", { } args.push(searchPath) - const proc = Bun.spawn([rgPath, ...args], { + const proc = Process.spawn([rgPath, ...args], { stdout: "pipe", stderr: "pipe", - signal: ctx.abort, + abort: ctx.abort, }) - const output = await new Response(proc.stdout).text() - const errorOutput = await new Response(proc.stderr).text() + if (!proc.stdout || !proc.stderr) { + throw new Error("Process output not available") + } + + const output = await text(proc.stdout) + const errorOutput = await text(proc.stderr) const exitCode = await proc.exited // Exit codes: 0 = matches found, 1 = no matches, 2 = errors (but may still have matches) diff --git a/packages/opencode/src/util/git.ts b/packages/opencode/src/util/git.ts index 201def36a8c6..8e1427c99d54 100644 --- a/packages/opencode/src/util/git.ts +++ b/packages/opencode/src/util/git.ts @@ -1,5 +1,7 @@ import { $ } from "bun" +import { buffer } from "node:stream/consumers" import { Flag } from "../flag/flag" +import { Process } from "./process" export interface GitResult { exitCode: number @@ -14,12 +16,12 @@ export interface GitResult { * Uses Bun's lightweight `$` shell by default. When the process is running * as an ACP client, child processes inherit the parent's stdin pipe which * carries protocol data – on Windows this causes git to deadlock. In that - * case we fall back to `Bun.spawn` with `stdin: "ignore"`. + * case we fall back to `Process.spawn` with `stdin: "ignore"`. */ export async function git(args: string[], opts: { cwd: string; env?: Record }): Promise { if (Flag.OPENCODE_CLIENT === "acp") { try { - const proc = Bun.spawn(["git", ...args], { + const proc = Process.spawn(["git", ...args], { stdin: "ignore", stdout: "pipe", stderr: "pipe", @@ -27,18 +29,15 @@ export async function git(args: string[], opts: { cwd: string; env?: Record stdoutBuf.toString(), - stdout: stdoutBuf, - stderr: stderrBuf, + text: () => out.toString(), + stdout: out, + stderr: err, } } catch (error) { const stderr = Buffer.from(error instanceof Error ? error.message : String(error)) diff --git a/packages/opencode/src/util/process.ts b/packages/opencode/src/util/process.ts new file mode 100644 index 000000000000..09c55661fddd --- /dev/null +++ b/packages/opencode/src/util/process.ts @@ -0,0 +1,71 @@ +import { spawn as launch, type ChildProcess } from "child_process" + +export namespace Process { + export type Stdio = "inherit" | "pipe" | "ignore" + + export interface Options { + cwd?: string + env?: NodeJS.ProcessEnv | null + stdin?: Stdio + stdout?: Stdio + stderr?: Stdio + abort?: AbortSignal + kill?: NodeJS.Signals | number + timeout?: number + } + + export type Child = ChildProcess & { exited: Promise } + + export function spawn(cmd: string[], options: Options = {}): Child { + if (cmd.length === 0) throw new Error("Command is required") + options.abort?.throwIfAborted() + + const proc = launch(cmd[0], cmd.slice(1), { + cwd: options.cwd, + env: options.env === null ? {} : options.env ? { ...process.env, ...options.env } : undefined, + stdio: [options.stdin ?? "ignore", options.stdout ?? "ignore", options.stderr ?? "ignore"], + }) + + let aborted = false + let timer: ReturnType | undefined + + const abort = () => { + if (aborted) return + if (proc.exitCode !== null || proc.signalCode !== null) return + aborted = true + + proc.kill(options.kill ?? "SIGTERM") + + const timeout = options.timeout ?? 5_000 + if (timeout <= 0) return + + timer = setTimeout(() => { + proc.kill("SIGKILL") + }, timeout) + } + + const exited = new Promise((resolve, reject) => { + const done = () => { + options.abort?.removeEventListener("abort", abort) + if (timer) clearTimeout(timer) + } + proc.once("exit", (exitCode, signal) => { + done() + resolve(exitCode ?? (signal ? 1 : 0)) + }) + proc.once("error", (error) => { + done() + reject(error) + }) + }) + + if (options.abort) { + options.abort.addEventListener("abort", abort, { once: true }) + if (options.abort.aborted) abort() + } + + const child = proc as Child + child.exited = exited + return child + } +} From fa559b0385374222b933ba8f86dc3cd92f53c0de Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 24 Feb 2026 19:16:17 -0500 Subject: [PATCH 64/95] core: temporarily disable plan enter tool to prevent unintended mode switches during task execution --- packages/opencode/src/tool/plan.ts | 3 ++- packages/opencode/src/tool/registry.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/tool/plan.ts b/packages/opencode/src/tool/plan.ts index 6cb7a691c88b..ff84dccec447 100644 --- a/packages/opencode/src/tool/plan.ts +++ b/packages/opencode/src/tool/plan.ts @@ -8,7 +8,6 @@ import { Identifier } from "../id/id" import { Provider } from "../provider/provider" import { Instance } from "../project/instance" import EXIT_DESCRIPTION from "./plan-exit.txt" -import ENTER_DESCRIPTION from "./plan-enter.txt" async function getLastModel(sessionID: string) { for await (const item of MessageV2.stream(sessionID)) { @@ -72,6 +71,7 @@ export const PlanExitTool = Tool.define("plan_exit", { }, }) +/* export const PlanEnterTool = Tool.define("plan_enter", { description: ENTER_DESCRIPTION, parameters: z.object({}), @@ -128,3 +128,4 @@ export const PlanEnterTool = Tool.define("plan_enter", { } }, }) +*/ diff --git a/packages/opencode/src/tool/registry.ts b/packages/opencode/src/tool/registry.ts index cf3c2cad838e..c6d7fbc1e4b2 100644 --- a/packages/opencode/src/tool/registry.ts +++ b/packages/opencode/src/tool/registry.ts @@ -1,3 +1,4 @@ +import { PlanExitTool } from "./plan" import { QuestionTool } from "./question" import { BashTool } from "./bash" import { EditTool } from "./edit" @@ -25,7 +26,7 @@ import { Flag } from "@/flag/flag" import { Log } from "@/util/log" import { LspTool } from "./lsp" import { Truncate } from "./truncation" -import { PlanExitTool, PlanEnterTool } from "./plan" + import { ApplyPatchTool } from "./apply_patch" import { Glob } from "../util/glob" import { pathToFileURL } from "url" @@ -118,7 +119,7 @@ export namespace ToolRegistry { ApplyPatchTool, ...(Flag.OPENCODE_EXPERIMENTAL_LSP_TOOL ? [LspTool] : []), ...(config.experimental?.batch_tool === true ? [BatchTool] : []), - ...(Flag.OPENCODE_EXPERIMENTAL_PLAN_MODE && Flag.OPENCODE_CLIENT === "cli" ? [PlanExitTool, PlanEnterTool] : []), + ...(Flag.OPENCODE_EXPERIMENTAL_PLAN_MODE && Flag.OPENCODE_CLIENT === "cli" ? [PlanExitTool] : []), ...custom, ] } From 637059a515a6afd983a8a615f90650d997a821ce Mon Sep 17 00:00:00 2001 From: Dax Date: Tue, 24 Feb 2026 23:15:11 -0500 Subject: [PATCH 65/95] feat: show LSP errors for apply_patch tool (#14715) --- .../src/cli/cmd/tui/routes/session/index.tsx | 58 +++++++++---------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index f5a7f6f6ca49..365eb3314726 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -1762,11 +1762,6 @@ function Write(props: ToolProps) { return props.input.content }) - const diagnostics = createMemo(() => { - const filePath = Filesystem.normalizePath(props.input.filePath ?? "") - return props.metadata.diagnostics?.[filePath] ?? [] - }) - return ( @@ -1780,15 +1775,7 @@ function Write(props: ToolProps) { content={code()} /> - - - {(diagnostic) => ( - - Error [{diagnostic.range.start.line}:{diagnostic.range.start.character}]: {diagnostic.message} - - )} - - + @@ -1972,12 +1959,6 @@ function Edit(props: ToolProps) { const diffContent = createMemo(() => props.metadata.diff) - const diagnostics = createMemo(() => { - const filePath = Filesystem.normalizePath(props.input.filePath ?? "") - const arr = props.metadata.diagnostics?.[filePath] ?? [] - return arr.filter((x) => x.severity === 1).slice(0, 3) - }) - return ( @@ -2003,18 +1984,7 @@ function Edit(props: ToolProps) { removedLineNumberBg={theme.diffRemovedLineNumberBg} /> - - - - {(diagnostic) => ( - - Error [{diagnostic.range.start.line + 1}:{diagnostic.range.start.character + 1}]{" "} - {diagnostic.message} - - )} - - - + @@ -2086,6 +2056,7 @@ function ApplyPatch(props: ToolProps) { } > + )} @@ -2163,6 +2134,29 @@ function Skill(props: ToolProps) { ) } +function Diagnostics(props: { diagnostics?: Record[]>; filePath: string }) { + const { theme } = useTheme() + const errors = createMemo(() => { + const normalized = Filesystem.normalizePath(props.filePath) + const arr = props.diagnostics?.[normalized] ?? [] + return arr.filter((x) => x.severity === 1).slice(0, 3) + }) + + return ( + + + + {(diagnostic) => ( + + Error [{diagnostic.range.start.line + 1}:{diagnostic.range.start.character + 1}] {diagnostic.message} + + )} + + + + ) +} + function normalizePath(input?: string) { if (!input) return "" if (path.isAbsolute(input)) { From a487f11a30981f44896ac771f7ade87fba9d6092 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 24 Feb 2026 23:17:31 -0500 Subject: [PATCH 66/95] ci: auto-resolve merge conflicts in beta sync using opencode When merging PRs into the beta branch, the sync script now attempts to automatically resolve merge conflicts using opencode before failing. This reduces manual intervention needed for beta releases when multiple PRs have overlapping changes. --- .github/workflows/beta.yml | 4 ++ script/beta.ts | 75 +++++++++++++++++++++++++++++++------- 2 files changed, 66 insertions(+), 13 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 20d2bc18d825..a7106667b116 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -27,7 +27,11 @@ jobs: opencode-app-id: ${{ vars.OPENCODE_APP_ID }} opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }} + - name: Install OpenCode + run: bun i -g opencode-ai + - name: Sync beta branch env: GH_TOKEN: ${{ steps.setup-git-committer.outputs.token }} + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} run: bun script/beta.ts diff --git a/script/beta.ts b/script/beta.ts index a5fb027e6330..fbb1214093d6 100755 --- a/script/beta.ts +++ b/script/beta.ts @@ -30,6 +30,52 @@ Please resolve this issue to include this PR in the next beta release.` } } +async function conflicts() { + const out = await $`git diff --name-only --diff-filter=U`.text().catch(() => "") + return out + .split("\n") + .map((x) => x.trim()) + .filter(Boolean) +} + +async function cleanup() { + try { + await $`git merge --abort` + } catch {} + try { + await $`git checkout -- .` + } catch {} + try { + await $`git clean -fd` + } catch {} +} + +async function fix(pr: PR, files: string[]) { + console.log(` Trying to auto-resolve ${files.length} conflict(s) with opencode...`) + const prompt = [ + `Resolve the current git merge conflicts while merging PR #${pr.number} into the beta branch.`, + `Only touch these files: ${files.join(", ")}.`, + "Keep the merge in progress, do not abort the merge, and do not create a commit.", + "When done, leave the working tree with no unmerged files.", + ].join("\n") + + try { + await $`opencode run ${prompt}` + } catch (err) { + console.log(` opencode failed: ${err}`) + return false + } + + const left = await conflicts() + if (left.length > 0) { + console.log(` Conflicts remain: ${left.join(", ")}`) + return false + } + + console.log(" Conflicts resolved with opencode") + return true +} + async function main() { console.log("Fetching open PRs with beta label...") @@ -69,19 +115,22 @@ async function main() { try { await $`git merge --no-commit --no-ff pr/${pr.number}` } catch { - console.log(" Failed to merge (conflicts)") - try { - await $`git merge --abort` - } catch {} - try { - await $`git checkout -- .` - } catch {} - try { - await $`git clean -fd` - } catch {} - failed.push({ number: pr.number, title: pr.title, reason: "Merge conflicts" }) - await commentOnPR(pr.number, "Merge conflicts with dev branch") - continue + const files = await conflicts() + if (files.length > 0) { + console.log(" Failed to merge (conflicts)") + if (!(await fix(pr, files))) { + await cleanup() + failed.push({ number: pr.number, title: pr.title, reason: "Merge conflicts" }) + await commentOnPR(pr.number, "Merge conflicts with dev branch") + continue + } + } else { + console.log(" Failed to merge") + await cleanup() + failed.push({ number: pr.number, title: pr.title, reason: "Merge failed" }) + await commentOnPR(pr.number, "Merge failed") + continue + } } try { From 0b3fb5d46002745b37eb448115014cb814d49921 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 24 Feb 2026 23:22:56 -0500 Subject: [PATCH 67/95] ci: specify opencode/kimi-k2.5 model in beta script to ensure consistent PR processing --- script/beta.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/beta.ts b/script/beta.ts index fbb1214093d6..e931c9c0df41 100755 --- a/script/beta.ts +++ b/script/beta.ts @@ -60,7 +60,7 @@ async function fix(pr: PR, files: string[]) { ].join("\n") try { - await $`opencode run ${prompt}` + await $`opencode run -m opencode/kimi-k2.5 ${prompt}` } catch (err) { console.log(` opencode failed: ${err}`) return false From 6af7ddf03bd16b1e1d1cd7250e6b60aca87d437b Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 24 Feb 2026 23:26:03 -0500 Subject: [PATCH 68/95] ci: switch beta script to gpt-5.3-codex for improved code generation quality --- script/beta.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/beta.ts b/script/beta.ts index e931c9c0df41..b0e6c2dcc15f 100755 --- a/script/beta.ts +++ b/script/beta.ts @@ -60,7 +60,7 @@ async function fix(pr: PR, files: string[]) { ].join("\n") try { - await $`opencode run -m opencode/kimi-k2.5 ${prompt}` + await $`opencode run -m opencode/gpt-5.3-codex ${prompt}` } catch (err) { console.log(` opencode failed: ${err}`) return false From 76b60f3779b2e4d54fa4036759b7064c4649c9ca Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Wed, 25 Feb 2026 12:28:48 +0800 Subject: [PATCH 69/95] desktop: make readme more accurate --- packages/desktop/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/desktop/README.md b/packages/desktop/README.md index ebaf48822313..358b7d24d511 100644 --- a/packages/desktop/README.md +++ b/packages/desktop/README.md @@ -2,6 +2,10 @@ Native OpenCode desktop app, built with Tauri v2. +## Prerequisites + +Building the desktop app requires additional Tauri dependencies (Rust toolchain, platform-specific libraries). See the [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/) for setup instructions. + ## Development From the repo root: @@ -11,22 +15,18 @@ bun install bun run --cwd packages/desktop tauri dev ``` -This starts the Vite dev server on http://localhost:1420 and opens the native window. - -If you only want the web dev server (no native shell): +## Build ```bash -bun run --cwd packages/desktop dev +bun run --cwd packages/desktop tauri build ``` -## Build +## Troubleshooting + +### Rust compiler not found -To create a production `dist/` and build the native app bundle: +If you see errors about Rust not being found, install it via [rustup](https://rustup.rs/): ```bash -bun run --cwd packages/desktop tauri build +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` - -## Prerequisites - -Running the desktop app requires additional Tauri dependencies (Rust toolchain, platform-specific libraries). See the [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/) for setup instructions. From 6fc5506293eba8f7fc8c2c751fa5d9309d6eaea8 Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 25 Feb 2026 00:31:46 -0500 Subject: [PATCH 70/95] zen: go --- packages/console/app/src/i18n/ar.ts | 17 ++++++++++------- packages/console/app/src/i18n/br.ts | 17 ++++++++++------- packages/console/app/src/i18n/da.ts | 17 ++++++++++------- packages/console/app/src/i18n/de.ts | 17 ++++++++++------- packages/console/app/src/i18n/en.ts | 17 ++++++++++------- packages/console/app/src/i18n/es.ts | 17 ++++++++++------- packages/console/app/src/i18n/fr.ts | 17 ++++++++++------- packages/console/app/src/i18n/it.ts | 17 ++++++++++------- packages/console/app/src/i18n/ja.ts | 17 ++++++++++------- packages/console/app/src/i18n/ko.ts | 17 ++++++++++------- packages/console/app/src/i18n/no.ts | 17 ++++++++++------- packages/console/app/src/i18n/pl.ts | 17 ++++++++++------- packages/console/app/src/i18n/ru.ts | 17 ++++++++++------- packages/console/app/src/i18n/th.ts | 17 ++++++++++------- packages/console/app/src/i18n/tr.ts | 17 ++++++++++------- packages/console/app/src/i18n/zh.ts | 17 ++++++++++------- packages/console/app/src/i18n/zht.ts | 17 ++++++++++------- .../src/routes/workspace/[id]/billing/index.tsx | 2 +- .../[id]/billing/lite-section.module.css | 16 +++++++++++++++- .../workspace/[id]/billing/lite-section.tsx | 7 +++++++ 20 files changed, 193 insertions(+), 121 deletions(-) diff --git a/packages/console/app/src/i18n/ar.ts b/packages/console/app/src/i18n/ar.ts index 36c86ef101e1..79f1d34971a5 100644 --- a/packages/console/app/src/i18n/ar.ts +++ b/packages/console/app/src/i18n/ar.ts @@ -491,21 +491,24 @@ export const dict = { "workspace.lite.time.minute": "دقيقة", "workspace.lite.time.minutes": "دقائق", "workspace.lite.time.fewSeconds": "بضع ثوان", - "workspace.lite.subscription.title": "اشتراك Lite", - "workspace.lite.subscription.message": "أنت مشترك في OpenCode Lite.", + "workspace.lite.subscription.title": "اشتراك Go", + "workspace.lite.subscription.message": "أنت مشترك في OpenCode Go.", "workspace.lite.subscription.manage": "إدارة الاشتراك", "workspace.lite.subscription.rollingUsage": "الاستخدام المتجدد", "workspace.lite.subscription.weeklyUsage": "الاستخدام الأسبوعي", "workspace.lite.subscription.monthlyUsage": "الاستخدام الشهري", "workspace.lite.subscription.resetsIn": "إعادة تعيين في", "workspace.lite.subscription.useBalance": "استخدم رصيدك المتوفر بعد الوصول إلى حدود الاستخدام", - "workspace.lite.other.title": "اشتراك Lite", + "workspace.lite.other.title": "اشتراك Go", "workspace.lite.other.message": - "عضو آخر في مساحة العمل هذه مشترك بالفعل في OpenCode Lite. يمكن لعضو واحد فقط لكل مساحة عمل الاشتراك.", - "workspace.lite.promo.title": "OpenCode Lite", + "عضو آخر في مساحة العمل هذه مشترك بالفعل في OpenCode Go. يمكن لعضو واحد فقط لكل مساحة عمل الاشتراك.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "احصل على وصول إلى أفضل النماذج المفتوحة — Kimi K2.5، و GLM-5، و MiniMax M2.5 — مع حدود استخدام سخية مقابل $10 شهريًا.", - "workspace.lite.promo.subscribe": "الاشتراك في Lite", + "OpenCode Go هو اشتراك بسعر $10 شهريًا يوفر وصولاً موثوقًا إلى نماذج البرمجة المفتوحة الشائعة مع حدود استخدام سخية.", + "workspace.lite.promo.modelsTitle": "ما يتضمنه", + "workspace.lite.promo.footer": + "تم تصميم الخطة بشكل أساسي للمستخدمين الدوليين، مع استضافة النماذج في الولايات المتحدة والاتحاد الأوروبي وسنغافورة للحصول على وصول عالمي مستقر. قد تتغير الأسعار وحدود الاستخدام بناءً على تعلمنا من الاستخدام المبكر والملاحظات.", + "workspace.lite.promo.subscribe": "الاشتراك في Go", "workspace.lite.promo.subscribing": "جارٍ إعادة التوجيه...", "download.title": "OpenCode | تنزيل", diff --git a/packages/console/app/src/i18n/br.ts b/packages/console/app/src/i18n/br.ts index 5367a748bfeb..ff4e6ab7aa1d 100644 --- a/packages/console/app/src/i18n/br.ts +++ b/packages/console/app/src/i18n/br.ts @@ -497,21 +497,24 @@ export const dict = { "workspace.lite.time.minute": "minuto", "workspace.lite.time.minutes": "minutos", "workspace.lite.time.fewSeconds": "alguns segundos", - "workspace.lite.subscription.title": "Assinatura Lite", - "workspace.lite.subscription.message": "Você assina o OpenCode Lite.", + "workspace.lite.subscription.title": "Assinatura Go", + "workspace.lite.subscription.message": "Você assina o OpenCode Go.", "workspace.lite.subscription.manage": "Gerenciar Assinatura", "workspace.lite.subscription.rollingUsage": "Uso Contínuo", "workspace.lite.subscription.weeklyUsage": "Uso Semanal", "workspace.lite.subscription.monthlyUsage": "Uso Mensal", "workspace.lite.subscription.resetsIn": "Reinicia em", "workspace.lite.subscription.useBalance": "Use seu saldo disponível após atingir os limites de uso", - "workspace.lite.other.title": "Assinatura Lite", + "workspace.lite.other.title": "Assinatura Go", "workspace.lite.other.message": - "Outro membro neste workspace já assina o OpenCode Lite. Apenas um membro por workspace pode assinar.", - "workspace.lite.promo.title": "OpenCode Lite", + "Outro membro neste workspace já assina o OpenCode Go. Apenas um membro por workspace pode assinar.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Tenha acesso aos melhores modelos abertos — Kimi K2.5, GLM-5 e MiniMax M2.5 — com limites de uso generosos por $10 por mês.", - "workspace.lite.promo.subscribe": "Assinar Lite", + "O OpenCode Go é uma assinatura de $10 por mês que fornece acesso confiável a modelos abertos de codificação populares com limites de uso generosos.", + "workspace.lite.promo.modelsTitle": "O que está incluído", + "workspace.lite.promo.footer": + "O plano é projetado principalmente para usuários internacionais, com modelos hospedados nos EUA, UE e Singapura para acesso global estável. Preços e limites de uso podem mudar conforme aprendemos com o uso inicial e feedback.", + "workspace.lite.promo.subscribe": "Assinar Go", "workspace.lite.promo.subscribing": "Redirecionando...", "download.title": "OpenCode | Baixar", diff --git a/packages/console/app/src/i18n/da.ts b/packages/console/app/src/i18n/da.ts index 2f1be69cadd9..e3a7b789213e 100644 --- a/packages/console/app/src/i18n/da.ts +++ b/packages/console/app/src/i18n/da.ts @@ -495,21 +495,24 @@ export const dict = { "workspace.lite.time.minute": "minut", "workspace.lite.time.minutes": "minutter", "workspace.lite.time.fewSeconds": "et par sekunder", - "workspace.lite.subscription.title": "Lite-abonnement", - "workspace.lite.subscription.message": "Du abonnerer på OpenCode Lite.", + "workspace.lite.subscription.title": "Go-abonnement", + "workspace.lite.subscription.message": "Du abonnerer på OpenCode Go.", "workspace.lite.subscription.manage": "Administrer abonnement", "workspace.lite.subscription.rollingUsage": "Løbende forbrug", "workspace.lite.subscription.weeklyUsage": "Ugentligt forbrug", "workspace.lite.subscription.monthlyUsage": "Månedligt forbrug", "workspace.lite.subscription.resetsIn": "Nulstiller i", "workspace.lite.subscription.useBalance": "Brug din tilgængelige saldo, når du har nået forbrugsgrænserne", - "workspace.lite.other.title": "Lite-abonnement", + "workspace.lite.other.title": "Go-abonnement", "workspace.lite.other.message": - "Et andet medlem i dette workspace abonnerer allerede på OpenCode Lite. Kun ét medlem pr. workspace kan abonnere.", - "workspace.lite.promo.title": "OpenCode Lite", + "Et andet medlem i dette workspace abonnerer allerede på OpenCode Go. Kun ét medlem pr. workspace kan abonnere.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Få adgang til de bedste åbne modeller — Kimi K2.5, GLM-5 og MiniMax M2.5 — med generøse forbrugsgrænser for $10 om måneden.", - "workspace.lite.promo.subscribe": "Abonner på Lite", + "OpenCode Go er et abonnement til $10 om måneden, der giver pålidelig adgang til populære åbne kodningsmodeller med generøse forbrugsgrænser.", + "workspace.lite.promo.modelsTitle": "Hvad er inkluderet", + "workspace.lite.promo.footer": + "Planen er primært designet til internationale brugere, med modeller hostet i USA, EU og Singapore for stabil global adgang. Priser og forbrugsgrænser kan ændre sig, efterhånden som vi lærer af tidlig brug og feedback.", + "workspace.lite.promo.subscribe": "Abonner på Go", "workspace.lite.promo.subscribing": "Omdirigerer...", "download.title": "OpenCode | Download", diff --git a/packages/console/app/src/i18n/de.ts b/packages/console/app/src/i18n/de.ts index 49df65f8dc0b..888069b71246 100644 --- a/packages/console/app/src/i18n/de.ts +++ b/packages/console/app/src/i18n/de.ts @@ -497,21 +497,24 @@ export const dict = { "workspace.lite.time.minute": "Minute", "workspace.lite.time.minutes": "Minuten", "workspace.lite.time.fewSeconds": "einige Sekunden", - "workspace.lite.subscription.title": "Lite-Abonnement", - "workspace.lite.subscription.message": "Du hast OpenCode Lite abonniert.", + "workspace.lite.subscription.title": "Go-Abonnement", + "workspace.lite.subscription.message": "Du hast OpenCode Go abonniert.", "workspace.lite.subscription.manage": "Abo verwalten", "workspace.lite.subscription.rollingUsage": "Fortlaufende Nutzung", "workspace.lite.subscription.weeklyUsage": "Wöchentliche Nutzung", "workspace.lite.subscription.monthlyUsage": "Monatliche Nutzung", "workspace.lite.subscription.resetsIn": "Setzt zurück in", "workspace.lite.subscription.useBalance": "Nutze dein verfügbares Guthaben, nachdem die Nutzungslimits erreicht sind", - "workspace.lite.other.title": "Lite-Abonnement", + "workspace.lite.other.title": "Go-Abonnement", "workspace.lite.other.message": - "Ein anderes Mitglied in diesem Workspace hat OpenCode Lite bereits abonniert. Nur ein Mitglied pro Workspace kann abonnieren.", - "workspace.lite.promo.title": "OpenCode Lite", + "Ein anderes Mitglied in diesem Workspace hat OpenCode Go bereits abonniert. Nur ein Mitglied pro Workspace kann abonnieren.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Erhalte Zugriff auf die besten offenen Modelle — Kimi K2.5, GLM-5 und MiniMax M2.5 — mit großzügigen Nutzungslimits für $10 pro Monat.", - "workspace.lite.promo.subscribe": "Lite abonnieren", + "OpenCode Go ist ein Abonnement für $10 pro Monat, das zuverlässigen Zugriff auf beliebte offene Coding-Modelle mit großzügigen Nutzungslimits bietet.", + "workspace.lite.promo.modelsTitle": "Was enthalten ist", + "workspace.lite.promo.footer": + "Der Plan wurde hauptsächlich für internationale Nutzer entwickelt, wobei die Modelle in den USA, der EU und Singapur gehostet werden, um einen stabilen weltweiten Zugriff zu gewährleisten. Preise und Nutzungslimits können sich ändern, während wir aus der frühen Nutzung und dem Feedback lernen.", + "workspace.lite.promo.subscribe": "Go abonnieren", "workspace.lite.promo.subscribing": "Leite weiter...", "download.title": "OpenCode | Download", diff --git a/packages/console/app/src/i18n/en.ts b/packages/console/app/src/i18n/en.ts index 42b88dd16e5d..6080e2848173 100644 --- a/packages/console/app/src/i18n/en.ts +++ b/packages/console/app/src/i18n/en.ts @@ -489,21 +489,24 @@ export const dict = { "workspace.lite.time.minute": "minute", "workspace.lite.time.minutes": "minutes", "workspace.lite.time.fewSeconds": "a few seconds", - "workspace.lite.subscription.title": "Lite Subscription", - "workspace.lite.subscription.message": "You are subscribed to OpenCode Lite.", + "workspace.lite.subscription.title": "Go Subscription", + "workspace.lite.subscription.message": "You are subscribed to OpenCode Go.", "workspace.lite.subscription.manage": "Manage Subscription", "workspace.lite.subscription.rollingUsage": "Rolling Usage", "workspace.lite.subscription.weeklyUsage": "Weekly Usage", "workspace.lite.subscription.monthlyUsage": "Monthly Usage", "workspace.lite.subscription.resetsIn": "Resets in", "workspace.lite.subscription.useBalance": "Use your available balance after reaching the usage limits", - "workspace.lite.other.title": "Lite Subscription", + "workspace.lite.other.title": "Go Subscription", "workspace.lite.other.message": - "Another member in this workspace is already subscribed to OpenCode Lite. Only one member per workspace can subscribe.", - "workspace.lite.promo.title": "OpenCode Lite", + "Another member in this workspace is already subscribed to OpenCode Go. Only one member per workspace can subscribe.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Get access to the best open models — Kimi K2.5, GLM-5, and MiniMax M2.5 — with generous usage limits for $10 per month.", - "workspace.lite.promo.subscribe": "Subscribe to Lite", + "OpenCode Go is a $10 per month subscription that provides reliable access to popular open coding models with generous usage limits.", + "workspace.lite.promo.modelsTitle": "What's Included", + "workspace.lite.promo.footer": + "The plan is designed primarily for international users, with models hosted in the US, EU, and Singapore for stable global access. Pricing and usage limits may change as we learn from early usage and feedback.", + "workspace.lite.promo.subscribe": "Subscribe to Go", "workspace.lite.promo.subscribing": "Redirecting...", "download.title": "OpenCode | Download", diff --git a/packages/console/app/src/i18n/es.ts b/packages/console/app/src/i18n/es.ts index f4ac1cc63739..0cb5f0bd5440 100644 --- a/packages/console/app/src/i18n/es.ts +++ b/packages/console/app/src/i18n/es.ts @@ -498,21 +498,24 @@ export const dict = { "workspace.lite.time.minute": "minuto", "workspace.lite.time.minutes": "minutos", "workspace.lite.time.fewSeconds": "unos pocos segundos", - "workspace.lite.subscription.title": "Suscripción Lite", - "workspace.lite.subscription.message": "Estás suscrito a OpenCode Lite.", + "workspace.lite.subscription.title": "Suscripción Go", + "workspace.lite.subscription.message": "Estás suscrito a OpenCode Go.", "workspace.lite.subscription.manage": "Gestionar Suscripción", "workspace.lite.subscription.rollingUsage": "Uso Continuo", "workspace.lite.subscription.weeklyUsage": "Uso Semanal", "workspace.lite.subscription.monthlyUsage": "Uso Mensual", "workspace.lite.subscription.resetsIn": "Se reinicia en", "workspace.lite.subscription.useBalance": "Usa tu saldo disponible después de alcanzar los límites de uso", - "workspace.lite.other.title": "Suscripción Lite", + "workspace.lite.other.title": "Suscripción Go", "workspace.lite.other.message": - "Otro miembro de este espacio de trabajo ya está suscrito a OpenCode Lite. Solo un miembro por espacio de trabajo puede suscribirse.", - "workspace.lite.promo.title": "OpenCode Lite", + "Otro miembro de este espacio de trabajo ya está suscrito a OpenCode Go. Solo un miembro por espacio de trabajo puede suscribirse.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Obtén acceso a los mejores modelos abiertos — Kimi K2.5, GLM-5 y MiniMax M2.5 — con generosos límites de uso por $10 al mes.", - "workspace.lite.promo.subscribe": "Suscribirse a Lite", + "OpenCode Go es una suscripción de $10 al mes que proporciona acceso confiable a modelos de codificación abiertos populares con generosos límites de uso.", + "workspace.lite.promo.modelsTitle": "Qué incluye", + "workspace.lite.promo.footer": + "El plan está diseñado principalmente para usuarios internacionales, con modelos alojados en EE. UU., la UE y Singapur para un acceso global estable. Los precios y los límites de uso pueden cambiar a medida que aprendemos del uso inicial y los comentarios.", + "workspace.lite.promo.subscribe": "Suscribirse a Go", "workspace.lite.promo.subscribing": "Redirigiendo...", "download.title": "OpenCode | Descargar", diff --git a/packages/console/app/src/i18n/fr.ts b/packages/console/app/src/i18n/fr.ts index 05ee4e843528..9f4f42eaf7d7 100644 --- a/packages/console/app/src/i18n/fr.ts +++ b/packages/console/app/src/i18n/fr.ts @@ -506,8 +506,8 @@ export const dict = { "workspace.lite.time.minute": "minute", "workspace.lite.time.minutes": "minutes", "workspace.lite.time.fewSeconds": "quelques secondes", - "workspace.lite.subscription.title": "Abonnement Lite", - "workspace.lite.subscription.message": "Vous êtes abonné à OpenCode Lite.", + "workspace.lite.subscription.title": "Abonnement Go", + "workspace.lite.subscription.message": "Vous êtes abonné à OpenCode Go.", "workspace.lite.subscription.manage": "Gérer l'abonnement", "workspace.lite.subscription.rollingUsage": "Utilisation glissante", "workspace.lite.subscription.weeklyUsage": "Utilisation hebdomadaire", @@ -515,13 +515,16 @@ export const dict = { "workspace.lite.subscription.resetsIn": "Réinitialisation dans", "workspace.lite.subscription.useBalance": "Utilisez votre solde disponible après avoir atteint les limites d'utilisation", - "workspace.lite.other.title": "Abonnement Lite", + "workspace.lite.other.title": "Abonnement Go", "workspace.lite.other.message": - "Un autre membre de cet espace de travail est déjà abonné à OpenCode Lite. Un seul membre par espace de travail peut s'abonner.", - "workspace.lite.promo.title": "OpenCode Lite", + "Un autre membre de cet espace de travail est déjà abonné à OpenCode Go. Un seul membre par espace de travail peut s'abonner.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Accédez aux meilleurs modèles ouverts — Kimi K2.5, GLM-5 et MiniMax M2.5 — avec des limites d'utilisation généreuses pour 10 $ par mois.", - "workspace.lite.promo.subscribe": "S'abonner à Lite", + "OpenCode Go est un abonnement à 10 $ par mois qui offre un accès fiable aux modèles de codage ouverts populaires avec des limites d'utilisation généreuses.", + "workspace.lite.promo.modelsTitle": "Ce qui est inclus", + "workspace.lite.promo.footer": + "Le plan est conçu principalement pour les utilisateurs internationaux, avec des modèles hébergés aux États-Unis, dans l'UE et à Singapour pour un accès mondial stable. Les tarifs et les limites d'utilisation peuvent changer à mesure que nous apprenons des premières utilisations et des commentaires.", + "workspace.lite.promo.subscribe": "S'abonner à Go", "workspace.lite.promo.subscribing": "Redirection...", "download.title": "OpenCode | Téléchargement", diff --git a/packages/console/app/src/i18n/it.ts b/packages/console/app/src/i18n/it.ts index 08b7955047d1..3cfa8bc29ea5 100644 --- a/packages/console/app/src/i18n/it.ts +++ b/packages/console/app/src/i18n/it.ts @@ -497,21 +497,24 @@ export const dict = { "workspace.lite.time.minute": "minuto", "workspace.lite.time.minutes": "minuti", "workspace.lite.time.fewSeconds": "pochi secondi", - "workspace.lite.subscription.title": "Abbonamento Lite", - "workspace.lite.subscription.message": "Sei abbonato a OpenCode Lite.", + "workspace.lite.subscription.title": "Abbonamento Go", + "workspace.lite.subscription.message": "Sei abbonato a OpenCode Go.", "workspace.lite.subscription.manage": "Gestisci Abbonamento", "workspace.lite.subscription.rollingUsage": "Utilizzo Continuativo", "workspace.lite.subscription.weeklyUsage": "Utilizzo Settimanale", "workspace.lite.subscription.monthlyUsage": "Utilizzo Mensile", "workspace.lite.subscription.resetsIn": "Si resetta tra", "workspace.lite.subscription.useBalance": "Usa il tuo saldo disponibile dopo aver raggiunto i limiti di utilizzo", - "workspace.lite.other.title": "Abbonamento Lite", + "workspace.lite.other.title": "Abbonamento Go", "workspace.lite.other.message": - "Un altro membro in questo workspace è già abbonato a OpenCode Lite. Solo un membro per workspace può abbonarsi.", - "workspace.lite.promo.title": "OpenCode Lite", + "Un altro membro in questo workspace è già abbonato a OpenCode Go. Solo un membro per workspace può abbonarsi.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Ottieni l'accesso ai migliori modelli aperti — Kimi K2.5, GLM-5 e MiniMax M2.5 — con limiti di utilizzo generosi per $10 al mese.", - "workspace.lite.promo.subscribe": "Abbonati a Lite", + "OpenCode Go è un abbonamento a $10 al mese che fornisce un accesso affidabile a popolari modelli di coding aperti con generosi limiti di utilizzo.", + "workspace.lite.promo.modelsTitle": "Cosa è incluso", + "workspace.lite.promo.footer": + "Il piano è progettato principalmente per gli utenti internazionali, con modelli ospitati in US, EU e Singapore per un accesso globale stabile. I prezzi e i limiti di utilizzo potrebbero cambiare man mano che impariamo dall'utilizzo iniziale e dal feedback.", + "workspace.lite.promo.subscribe": "Abbonati a Go", "workspace.lite.promo.subscribing": "Reindirizzamento...", "download.title": "OpenCode | Download", diff --git a/packages/console/app/src/i18n/ja.ts b/packages/console/app/src/i18n/ja.ts index 2c8e9d6b4d00..25393b5b22c1 100644 --- a/packages/console/app/src/i18n/ja.ts +++ b/packages/console/app/src/i18n/ja.ts @@ -495,21 +495,24 @@ export const dict = { "workspace.lite.time.minute": "分", "workspace.lite.time.minutes": "分", "workspace.lite.time.fewSeconds": "数秒", - "workspace.lite.subscription.title": "Liteサブスクリプション", - "workspace.lite.subscription.message": "あなたは OpenCode Lite を購読しています。", + "workspace.lite.subscription.title": "Goサブスクリプション", + "workspace.lite.subscription.message": "あなたは OpenCode Go を購読しています。", "workspace.lite.subscription.manage": "サブスクリプションの管理", "workspace.lite.subscription.rollingUsage": "ローリング利用量", "workspace.lite.subscription.weeklyUsage": "週間利用量", "workspace.lite.subscription.monthlyUsage": "月間利用量", "workspace.lite.subscription.resetsIn": "リセットまで", "workspace.lite.subscription.useBalance": "利用限度額に達したら利用可能な残高を使用する", - "workspace.lite.other.title": "Liteサブスクリプション", + "workspace.lite.other.title": "Goサブスクリプション", "workspace.lite.other.message": - "このワークスペースの別のメンバーが既に OpenCode Lite を購読しています。ワークスペースにつき1人のメンバーのみが購読できます。", - "workspace.lite.promo.title": "OpenCode Lite", + "このワークスペースの別のメンバーが既に OpenCode Go を購読しています。ワークスペースにつき1人のメンバーのみが購読できます。", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "月額$10で、十分な利用枠が設けられた最高のオープンモデル — Kimi K2.5、GLM-5、および MiniMax M2.5 — にアクセスできます。", - "workspace.lite.promo.subscribe": "Liteを購読する", + "OpenCode Goは月額$10のサブスクリプションプランで、人気のオープンコーディングモデルへの安定したアクセスを十分な利用枠で提供します。", + "workspace.lite.promo.modelsTitle": "含まれるもの", + "workspace.lite.promo.footer": + "このプランは主にグローバルユーザー向けに設計されており、米国、EU、シンガポールでホストされたモデルにより安定したグローバルアクセスを提供します。料金と利用制限は、初期の利用状況やフィードバックに基づいて変更される可能性があります。", + "workspace.lite.promo.subscribe": "Goを購読する", "workspace.lite.promo.subscribing": "リダイレクト中...", "download.title": "OpenCode | ダウンロード", diff --git a/packages/console/app/src/i18n/ko.ts b/packages/console/app/src/i18n/ko.ts index 8f4e58e7de42..88acbf2742a3 100644 --- a/packages/console/app/src/i18n/ko.ts +++ b/packages/console/app/src/i18n/ko.ts @@ -490,21 +490,24 @@ export const dict = { "workspace.lite.time.minute": "분", "workspace.lite.time.minutes": "분", "workspace.lite.time.fewSeconds": "몇 초", - "workspace.lite.subscription.title": "Lite 구독", - "workspace.lite.subscription.message": "현재 OpenCode Lite를 구독 중입니다.", + "workspace.lite.subscription.title": "Go 구독", + "workspace.lite.subscription.message": "현재 OpenCode Go를 구독 중입니다.", "workspace.lite.subscription.manage": "구독 관리", "workspace.lite.subscription.rollingUsage": "롤링 사용량", "workspace.lite.subscription.weeklyUsage": "주간 사용량", "workspace.lite.subscription.monthlyUsage": "월간 사용량", "workspace.lite.subscription.resetsIn": "초기화까지 남은 시간:", "workspace.lite.subscription.useBalance": "사용 한도 도달 후에는 보유 잔액 사용", - "workspace.lite.other.title": "Lite 구독", + "workspace.lite.other.title": "Go 구독", "workspace.lite.other.message": - "이 워크스페이스의 다른 멤버가 이미 OpenCode Lite를 구독 중입니다. 워크스페이스당 한 명의 멤버만 구독할 수 있습니다.", - "workspace.lite.promo.title": "OpenCode Lite", + "이 워크스페이스의 다른 멤버가 이미 OpenCode Go를 구독 중입니다. 워크스페이스당 한 명의 멤버만 구독할 수 있습니다.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "월 $10의 넉넉한 사용 한도로 최고의 오픈 모델인 Kimi K2.5, GLM-5, MiniMax M2.5에 액세스하세요.", - "workspace.lite.promo.subscribe": "Lite 구독하기", + "OpenCode Go는 넉넉한 사용 한도와 함께 인기 있는 오픈 코딩 모델에 대한 안정적인 액세스를 제공하는 월 $10의 구독입니다.", + "workspace.lite.promo.modelsTitle": "포함 내역", + "workspace.lite.promo.footer": + "이 플랜은 주로 글로벌 사용자를 위해 설계되었으며, 안정적인 글로벌 액세스를 위해 미국, EU 및 싱가포르에 모델이 호스팅되어 있습니다. 가격 및 사용 한도는 초기 사용을 통해 학습하고 피드백을 수집함에 따라 변경될 수 있습니다.", + "workspace.lite.promo.subscribe": "Go 구독하기", "workspace.lite.promo.subscribing": "리디렉션 중...", "download.title": "OpenCode | 다운로드", diff --git a/packages/console/app/src/i18n/no.ts b/packages/console/app/src/i18n/no.ts index e5bfef989dd1..565becc014ec 100644 --- a/packages/console/app/src/i18n/no.ts +++ b/packages/console/app/src/i18n/no.ts @@ -495,21 +495,24 @@ export const dict = { "workspace.lite.time.minute": "minutt", "workspace.lite.time.minutes": "minutter", "workspace.lite.time.fewSeconds": "noen få sekunder", - "workspace.lite.subscription.title": "Lite-abonnement", - "workspace.lite.subscription.message": "Du abonnerer på OpenCode Lite.", + "workspace.lite.subscription.title": "Go-abonnement", + "workspace.lite.subscription.message": "Du abonnerer på OpenCode Go.", "workspace.lite.subscription.manage": "Administrer abonnement", "workspace.lite.subscription.rollingUsage": "Løpende bruk", "workspace.lite.subscription.weeklyUsage": "Ukentlig bruk", "workspace.lite.subscription.monthlyUsage": "Månedlig bruk", "workspace.lite.subscription.resetsIn": "Nullstilles om", "workspace.lite.subscription.useBalance": "Bruk din tilgjengelige saldo etter å ha nådd bruksgrensene", - "workspace.lite.other.title": "Lite-abonnement", + "workspace.lite.other.title": "Go-abonnement", "workspace.lite.other.message": - "Et annet medlem i dette arbeidsområdet abonnerer allerede på OpenCode Lite. Kun ett medlem per arbeidsområde kan abonnere.", - "workspace.lite.promo.title": "OpenCode Lite", + "Et annet medlem i dette arbeidsområdet abonnerer allerede på OpenCode Go. Kun ett medlem per arbeidsområde kan abonnere.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Få tilgang til de beste åpne modellene — Kimi K2.5, GLM-5 og MiniMax M2.5 — med generøse bruksgrenser for $10 per måned.", - "workspace.lite.promo.subscribe": "Abonner på Lite", + "OpenCode Go er et abonnement til $10 per måned som gir pålitelig tilgang til populære åpne kodemodeller med rause bruksgrenser.", + "workspace.lite.promo.modelsTitle": "Hva som er inkludert", + "workspace.lite.promo.footer": + "Planen er primært designet for internasjonale brukere, med modeller driftet i USA, EU og Singapore for stabil global tilgang. Priser og bruksgrenser kan endres etter hvert som vi lærer fra tidlig bruk og tilbakemeldinger.", + "workspace.lite.promo.subscribe": "Abonner på Go", "workspace.lite.promo.subscribing": "Omdirigerer...", "download.title": "OpenCode | Last ned", diff --git a/packages/console/app/src/i18n/pl.ts b/packages/console/app/src/i18n/pl.ts index c2f9b3712ef9..666da5668e1d 100644 --- a/packages/console/app/src/i18n/pl.ts +++ b/packages/console/app/src/i18n/pl.ts @@ -496,21 +496,24 @@ export const dict = { "workspace.lite.time.minute": "minuta", "workspace.lite.time.minutes": "minut(y)", "workspace.lite.time.fewSeconds": "kilka sekund", - "workspace.lite.subscription.title": "Subskrypcja Lite", - "workspace.lite.subscription.message": "Subskrybujesz OpenCode Lite.", + "workspace.lite.subscription.title": "Subskrypcja Go", + "workspace.lite.subscription.message": "Subskrybujesz OpenCode Go.", "workspace.lite.subscription.manage": "Zarządzaj subskrypcją", "workspace.lite.subscription.rollingUsage": "Użycie kroczące", "workspace.lite.subscription.weeklyUsage": "Użycie tygodniowe", "workspace.lite.subscription.monthlyUsage": "Użycie miesięczne", "workspace.lite.subscription.resetsIn": "Resetuje się za", "workspace.lite.subscription.useBalance": "Użyj dostępnego salda po osiągnięciu limitów użycia", - "workspace.lite.other.title": "Subskrypcja Lite", + "workspace.lite.other.title": "Subskrypcja Go", "workspace.lite.other.message": - "Inny członek tego obszaru roboczego już subskrybuje OpenCode Lite. Tylko jeden członek na obszar roboczy może subskrybować.", - "workspace.lite.promo.title": "OpenCode Lite", + "Inny członek tego obszaru roboczego już subskrybuje OpenCode Go. Tylko jeden członek na obszar roboczy może subskrybować.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Uzyskaj dostęp do najlepszych otwartych modeli — Kimi K2.5, GLM-5 i MiniMax M2.5 — z hojnymi limitami użycia za $10 miesięcznie.", - "workspace.lite.promo.subscribe": "Subskrybuj Lite", + "OpenCode Go to subskrypcja za $10 miesięcznie, która zapewnia niezawodny dostęp do popularnych otwartych modeli do kodowania z hojnymi limitami użycia.", + "workspace.lite.promo.modelsTitle": "Co zawiera", + "workspace.lite.promo.footer": + "Plan został zaprojektowany głównie dla użytkowników międzynarodowych, z modelami hostowanymi w USA, UE i Singapurze, aby zapewnić stabilny globalny dostęp. Ceny i limity użycia mogą ulec zmianie w miarę analizy wczesnego użycia i zbierania opinii.", + "workspace.lite.promo.subscribe": "Subskrybuj Go", "workspace.lite.promo.subscribing": "Przekierowywanie...", "download.title": "OpenCode | Pobierz", diff --git a/packages/console/app/src/i18n/ru.ts b/packages/console/app/src/i18n/ru.ts index 3bedf80b5ba4..36205b048065 100644 --- a/packages/console/app/src/i18n/ru.ts +++ b/packages/console/app/src/i18n/ru.ts @@ -501,21 +501,24 @@ export const dict = { "workspace.lite.time.minute": "минута", "workspace.lite.time.minutes": "минут", "workspace.lite.time.fewSeconds": "несколько секунд", - "workspace.lite.subscription.title": "Подписка Lite", - "workspace.lite.subscription.message": "Вы подписаны на OpenCode Lite.", + "workspace.lite.subscription.title": "Подписка Go", + "workspace.lite.subscription.message": "Вы подписаны на OpenCode Go.", "workspace.lite.subscription.manage": "Управление подпиской", "workspace.lite.subscription.rollingUsage": "Скользящее использование", "workspace.lite.subscription.weeklyUsage": "Недельное использование", "workspace.lite.subscription.monthlyUsage": "Ежемесячное использование", "workspace.lite.subscription.resetsIn": "Сброс через", "workspace.lite.subscription.useBalance": "Использовать доступный баланс после достижения лимитов", - "workspace.lite.other.title": "Подписка Lite", + "workspace.lite.other.title": "Подписка Go", "workspace.lite.other.message": - "Другой участник в этом рабочем пространстве уже подписан на OpenCode Lite. Только один участник в рабочем пространстве может оформить подписку.", - "workspace.lite.promo.title": "OpenCode Lite", + "Другой участник в этом рабочем пространстве уже подписан на OpenCode Go. Только один участник в рабочем пространстве может оформить подписку.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Получите доступ к лучшим открытым моделям — Kimi K2.5, GLM-5 и MiniMax M2.5 — с щедрыми лимитами использования за $10 в месяц.", - "workspace.lite.promo.subscribe": "Подписаться на Lite", + "OpenCode Go — это подписка за $10 в месяц, которая предоставляет надежный доступ к популярным открытым моделям для кодинга с щедрыми лимитами использования.", + "workspace.lite.promo.modelsTitle": "Что включено", + "workspace.lite.promo.footer": + "План предназначен в первую очередь для международных пользователей. Модели размещены в США, ЕС и Сингапуре для стабильного глобального доступа. Цены и лимиты использования могут меняться по мере того, как мы изучаем раннее использование и собираем отзывы.", + "workspace.lite.promo.subscribe": "Подписаться на Go", "workspace.lite.promo.subscribing": "Перенаправление...", "download.title": "OpenCode | Скачать", diff --git a/packages/console/app/src/i18n/th.ts b/packages/console/app/src/i18n/th.ts index 3d36dcbb2272..6fd026fd710c 100644 --- a/packages/console/app/src/i18n/th.ts +++ b/packages/console/app/src/i18n/th.ts @@ -494,21 +494,24 @@ export const dict = { "workspace.lite.time.minute": "นาที", "workspace.lite.time.minutes": "นาที", "workspace.lite.time.fewSeconds": "ไม่กี่วินาที", - "workspace.lite.subscription.title": "การสมัครสมาชิก Lite", - "workspace.lite.subscription.message": "คุณได้สมัครสมาชิก OpenCode Lite แล้ว", + "workspace.lite.subscription.title": "การสมัครสมาชิก Go", + "workspace.lite.subscription.message": "คุณได้สมัครสมาชิก OpenCode Go แล้ว", "workspace.lite.subscription.manage": "จัดการการสมัครสมาชิก", "workspace.lite.subscription.rollingUsage": "การใช้งานแบบหมุนเวียน", "workspace.lite.subscription.weeklyUsage": "การใช้งานรายสัปดาห์", "workspace.lite.subscription.monthlyUsage": "การใช้งานรายเดือน", "workspace.lite.subscription.resetsIn": "รีเซ็ตใน", "workspace.lite.subscription.useBalance": "ใช้ยอดคงเหลือของคุณหลังจากถึงขีดจำกัดการใช้งาน", - "workspace.lite.other.title": "การสมัครสมาชิก Lite", + "workspace.lite.other.title": "การสมัครสมาชิก Go", "workspace.lite.other.message": - "สมาชิกคนอื่นใน Workspace นี้ได้สมัคร OpenCode Lite แล้ว สามารถสมัครได้เพียงหนึ่งคนต่อหนึ่ง Workspace เท่านั้น", - "workspace.lite.promo.title": "OpenCode Lite", + "สมาชิกคนอื่นใน Workspace นี้ได้สมัคร OpenCode Go แล้ว สามารถสมัครได้เพียงหนึ่งคนต่อหนึ่ง Workspace เท่านั้น", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "เข้าถึงโมเดลเปิดที่ดีที่สุด — Kimi K2.5, GLM-5 และ MiniMax M2.5 — พร้อมขีดจำกัดการใช้งานมากมายในราคา $10 ต่อเดือน", - "workspace.lite.promo.subscribe": "สมัครสมาชิก Lite", + "OpenCode Go เป็นการสมัครสมาชิกราคา 10 ดอลลาร์ต่อเดือน ที่ให้การเข้าถึงโมเดลโอเพนโค้ดดิงยอดนิยมได้อย่างเสถียร ด้วยขีดจำกัดการใช้งานที่ครอบคลุม", + "workspace.lite.promo.modelsTitle": "สิ่งที่รวมอยู่ด้วย", + "workspace.lite.promo.footer": + "แผนนี้ออกแบบมาสำหรับผู้ใช้งานต่างประเทศเป็นหลัก โดยมีโมเดลโฮสต์อยู่ในสหรัฐอเมริกา สหภาพยุโรป และสิงคโปร์ เพื่อการเข้าถึงที่เสถียรทั่วโลก ราคาและขีดจำกัดการใช้งานอาจมีการเปลี่ยนแปลงตามที่เราได้เรียนรู้จากการใช้งานในช่วงแรกและข้อเสนอแนะ", + "workspace.lite.promo.subscribe": "สมัครสมาชิก Go", "workspace.lite.promo.subscribing": "กำลังเปลี่ยนเส้นทาง...", "download.title": "OpenCode | ดาวน์โหลด", diff --git a/packages/console/app/src/i18n/tr.ts b/packages/console/app/src/i18n/tr.ts index bfa7d09aef3f..24828d3bc290 100644 --- a/packages/console/app/src/i18n/tr.ts +++ b/packages/console/app/src/i18n/tr.ts @@ -497,21 +497,24 @@ export const dict = { "workspace.lite.time.minute": "dakika", "workspace.lite.time.minutes": "dakika", "workspace.lite.time.fewSeconds": "birkaç saniye", - "workspace.lite.subscription.title": "Lite Aboneliği", - "workspace.lite.subscription.message": "OpenCode Lite abonesisiniz.", + "workspace.lite.subscription.title": "Go Aboneliği", + "workspace.lite.subscription.message": "OpenCode Go abonesisiniz.", "workspace.lite.subscription.manage": "Aboneliği Yönet", "workspace.lite.subscription.rollingUsage": "Devam Eden Kullanım", "workspace.lite.subscription.weeklyUsage": "Haftalık Kullanım", "workspace.lite.subscription.monthlyUsage": "Aylık Kullanım", "workspace.lite.subscription.resetsIn": "Sıfırlama süresi", "workspace.lite.subscription.useBalance": "Kullanım limitlerine ulaştıktan sonra mevcut bakiyenizi kullanın", - "workspace.lite.other.title": "Lite Aboneliği", + "workspace.lite.other.title": "Go Aboneliği", "workspace.lite.other.message": - "Bu çalışma alanındaki başka bir üye zaten OpenCode Lite abonesi. Çalışma alanı başına yalnızca bir üye abone olabilir.", - "workspace.lite.promo.title": "OpenCode Lite", + "Bu çalışma alanındaki başka bir üye zaten OpenCode Go abonesi. Çalışma alanı başına yalnızca bir üye abone olabilir.", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "Ayda $10 karşılığında cömert kullanım limitleriyle en iyi açık modellere — Kimi K2.5, GLM-5 ve MiniMax M2.5 — erişin.", - "workspace.lite.promo.subscribe": "Lite'a Abone Ol", + "OpenCode Go, cömert kullanım limitleriyle popüler açık kodlama modellerine güvenilir erişim sağlayan aylık 10$'lık bir aboneliktir.", + "workspace.lite.promo.modelsTitle": "Neler Dahil", + "workspace.lite.promo.footer": + "Plan öncelikle uluslararası kullanıcılar için tasarlanmıştır; modeller istikrarlı küresel erişim için ABD, AB ve Singapur'da barındırılmaktadır. Erken kullanımdan öğrendikçe ve geri bildirim topladıkça fiyatlandırma ve kullanım limitleri değişebilir.", + "workspace.lite.promo.subscribe": "Go'ya Abone Ol", "workspace.lite.promo.subscribing": "Yönlendiriliyor...", "download.title": "OpenCode | İndir", diff --git a/packages/console/app/src/i18n/zh.ts b/packages/console/app/src/i18n/zh.ts index 2c41be7cf7c9..e2777c8cfcec 100644 --- a/packages/console/app/src/i18n/zh.ts +++ b/packages/console/app/src/i18n/zh.ts @@ -481,20 +481,23 @@ export const dict = { "workspace.lite.time.minute": "分钟", "workspace.lite.time.minutes": "分钟", "workspace.lite.time.fewSeconds": "几秒钟", - "workspace.lite.subscription.title": "Lite 订阅", - "workspace.lite.subscription.message": "您已订阅 OpenCode Lite。", + "workspace.lite.subscription.title": "Go 订阅", + "workspace.lite.subscription.message": "您已订阅 OpenCode Go。", "workspace.lite.subscription.manage": "管理订阅", "workspace.lite.subscription.rollingUsage": "滚动用量", "workspace.lite.subscription.weeklyUsage": "每周用量", "workspace.lite.subscription.monthlyUsage": "每月用量", "workspace.lite.subscription.resetsIn": "重置于", "workspace.lite.subscription.useBalance": "达到使用限额后使用您的可用余额", - "workspace.lite.other.title": "Lite 订阅", - "workspace.lite.other.message": "此工作区中的另一位成员已经订阅了 OpenCode Lite。每个工作区只有一名成员可以订阅。", - "workspace.lite.promo.title": "OpenCode Lite", + "workspace.lite.other.title": "Go 订阅", + "workspace.lite.other.message": "此工作区中的另一位成员已经订阅了 OpenCode Go。每个工作区只有一名成员可以订阅。", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "每月仅需 $10 即可访问最优秀的开源模型 — Kimi K2.5, GLM-5, 和 MiniMax M2.5 — 并享受充裕的使用限额。", - "workspace.lite.promo.subscribe": "订阅 Lite", + "OpenCode Go 是一个每月 $10 的订阅计划,提供对主流开源编码模型的稳定访问,并配备充足的使用额度。", + "workspace.lite.promo.modelsTitle": "包含模型", + "workspace.lite.promo.footer": + "该计划主要面向国际用户设计,模型部署在美国、欧盟和新加坡,以确保全球范围内的稳定访问体验。定价和使用额度可能会根据早期用户的使用情况和反馈持续调整与优化。", + "workspace.lite.promo.subscribe": "订阅 Go", "workspace.lite.promo.subscribing": "正在重定向...", "download.title": "OpenCode | 下载", diff --git a/packages/console/app/src/i18n/zht.ts b/packages/console/app/src/i18n/zht.ts index 87fcaa8e89e6..dd440ed7e0b8 100644 --- a/packages/console/app/src/i18n/zht.ts +++ b/packages/console/app/src/i18n/zht.ts @@ -481,20 +481,23 @@ export const dict = { "workspace.lite.time.minute": "分鐘", "workspace.lite.time.minutes": "分鐘", "workspace.lite.time.fewSeconds": "幾秒", - "workspace.lite.subscription.title": "Lite 訂閱", - "workspace.lite.subscription.message": "您已訂閱 OpenCode Lite。", + "workspace.lite.subscription.title": "Go 訂閱", + "workspace.lite.subscription.message": "您已訂閱 OpenCode Go。", "workspace.lite.subscription.manage": "管理訂閱", "workspace.lite.subscription.rollingUsage": "滾動使用量", "workspace.lite.subscription.weeklyUsage": "每週使用量", "workspace.lite.subscription.monthlyUsage": "每月使用量", "workspace.lite.subscription.resetsIn": "重置時間:", "workspace.lite.subscription.useBalance": "達到使用限制後使用您的可用餘額", - "workspace.lite.other.title": "Lite 訂閱", - "workspace.lite.other.message": "此工作區中的另一位成員已訂閱 OpenCode Lite。每個工作區只能有一位成員訂閱。", - "workspace.lite.promo.title": "OpenCode Lite", + "workspace.lite.other.title": "Go 訂閱", + "workspace.lite.other.message": "此工作區中的另一位成員已訂閱 OpenCode Go。每個工作區只能有一位成員訂閱。", + "workspace.lite.promo.title": "OpenCode Go", "workspace.lite.promo.description": - "每月只需 $10 即可使用最佳的開放模型 — Kimi K2.5、GLM-5 和 MiniMax M2.5 — 並享有慷慨的使用限制。", - "workspace.lite.promo.subscribe": "訂閱 Lite", + "OpenCode Go 是一個每月 $10 的訂閱方案,提供對主流開放原始碼編碼模型的穩定存取,並配備充足的使用額度。", + "workspace.lite.promo.modelsTitle": "包含模型", + "workspace.lite.promo.footer": + "該計畫主要面向國際用戶設計,模型部署在美國、歐盟和新加坡,以確保全球範圍內的穩定存取體驗。定價和使用額度可能會根據早期用戶的使用情況和回饋持續調整與優化。", + "workspace.lite.promo.subscribe": "訂閱 Go", "workspace.lite.promo.subscribing": "重新導向中...", "download.title": "OpenCode | 下載", diff --git a/packages/console/app/src/routes/workspace/[id]/billing/index.tsx b/packages/console/app/src/routes/workspace/[id]/billing/index.tsx index 9fbdad2ef742..e039a09ef8b3 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/index.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/index.tsx @@ -21,7 +21,7 @@ export default function () { - + diff --git a/packages/console/app/src/routes/workspace/[id]/billing/lite-section.module.css b/packages/console/app/src/routes/workspace/[id]/billing/lite-section.module.css index 20662ab61863..077ac40e0d90 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/lite-section.module.css +++ b/packages/console/app/src/routes/workspace/[id]/billing/lite-section.module.css @@ -147,12 +147,26 @@ } [data-slot="promo-description"] { - font-size: var(--font-size-sm); + font-size: var(--font-size-md); color: var(--color-text-secondary); line-height: 1.5; margin-top: var(--space-2); } + [data-slot="promo-models-title"] { + font-size: var(--font-size-md); + font-weight: 600; + margin-top: var(--space-4); + } + + [data-slot="promo-models"] { + margin: var(--space-2) 0 0 var(--space-4); + padding: 0; + font-size: var(--font-size-md); + color: var(--color-text-secondary); + line-height: 1.4; + } + [data-slot="subscribe-button"] { align-self: flex-start; margin-top: var(--space-4); diff --git a/packages/console/app/src/routes/workspace/[id]/billing/lite-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/lite-section.tsx index c9192fdcf695..568a8710f6bd 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/lite-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/lite-section.tsx @@ -252,6 +252,13 @@ export function LiteSection() {

{i18n.t("workspace.lite.promo.title")}

{i18n.t("workspace.lite.promo.description")}

+

{i18n.t("workspace.lite.promo.modelsTitle")}

+
    +
  • Kimi K2.5
  • +
  • GLM-5
  • +
  • MiniMax M2.5
  • +
+

{i18n.t("workspace.lite.promo.footer")}

+
+ {i18n.t("workspace.lite.subscription.selectProvider")}{" "} + + {i18n.t("common.learnMore")} + + . +
diff --git a/packages/web/src/content/docs/providers.mdx b/packages/web/src/content/docs/providers.mdx index db3bfeaeebeb..34e3626499cb 100644 --- a/packages/web/src/content/docs/providers.mdx +++ b/packages/web/src/content/docs/providers.mdx @@ -57,7 +57,39 @@ tested and verified to work well with OpenCode. [Learn more](/docs/zen). If you are new, we recommend starting with OpenCode Zen. ::: -1. Run the `/connect` command in the TUI, select opencode, and head to [opencode.ai/auth](https://opencode.ai/auth). +1. Run the `/connect` command in the TUI, select `OpenCode Zen`, and head to [opencode.ai/auth](https://opencode.ai/zen). + + ```txt + /connect + ``` + +2. Sign in, add your billing details, and copy your API key. + +3. Paste your API key. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + +4. Run `/models` in the TUI to see the list of models we recommend. + + ```txt + /models + ``` + +It works like any other provider in OpenCode and is completely optional to use. + +--- + +## OpenCode Go + +OpenCode Go is a low cost subscription plan that provides reliable access to popular open coding models provided by the OpenCode team that have been +tested and verified to work well with OpenCode. + +1. Run the `/connect` command in the TUI, select `OpenCode Go`, and head to [opencode.ai/auth](https://opencode.ai/zen). ```txt /connect From fc6e7934bd365ad1665dea68556dbfc80ac3b611 Mon Sep 17 00:00:00 2001 From: Filip <34747899+neriousy@users.noreply.github.com> Date: Wed, 25 Feb 2026 07:39:58 +0100 Subject: [PATCH 75/95] feat(desktop): enhance Windows app resolution and UI loading states (#13320) Co-authored-by: Brendan Allan Co-authored-by: Brendan Allan --- .../src/components/session/session-header.tsx | 127 +++-- packages/desktop/src-tauri/Cargo.lock | 5 +- packages/desktop/src-tauri/Cargo.toml | 3 +- packages/desktop/src-tauri/src/cli.rs | 4 +- packages/desktop/src-tauri/src/lib.rs | 158 +------ packages/desktop/src-tauri/src/os/mod.rs | 2 + packages/desktop/src-tauri/src/os/windows.rs | 439 ++++++++++++++++++ 7 files changed, 556 insertions(+), 182 deletions(-) create mode 100644 packages/desktop/src-tauri/src/os/mod.rs create mode 100644 packages/desktop/src-tauri/src/os/windows.rs diff --git a/packages/app/src/components/session/session-header.tsx b/packages/app/src/components/session/session-header.tsx index 825d1dab6cff..d531fa50ab60 100644 --- a/packages/app/src/components/session/session-header.tsx +++ b/packages/app/src/components/session/session-header.tsx @@ -1,28 +1,28 @@ +import { AppIcon } from "@opencode-ai/ui/app-icon" +import { Button } from "@opencode-ai/ui/button" +import { DropdownMenu } from "@opencode-ai/ui/dropdown-menu" +import { Icon } from "@opencode-ai/ui/icon" +import { IconButton } from "@opencode-ai/ui/icon-button" +import { Keybind } from "@opencode-ai/ui/keybind" +import { Popover } from "@opencode-ai/ui/popover" +import { Spinner } from "@opencode-ai/ui/spinner" +import { TextField } from "@opencode-ai/ui/text-field" +import { showToast } from "@opencode-ai/ui/toast" +import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip" +import { getFilename } from "@opencode-ai/util/path" +import { useParams } from "@solidjs/router" import { createEffect, createMemo, For, onCleanup, Show } from "solid-js" import { createStore } from "solid-js/store" import { Portal } from "solid-js/web" -import { useParams } from "@solidjs/router" -import { useLayout } from "@/context/layout" import { useCommand } from "@/context/command" +import { useGlobalSDK } from "@/context/global-sdk" import { useLanguage } from "@/context/language" +import { useLayout } from "@/context/layout" import { usePlatform } from "@/context/platform" import { useServer } from "@/context/server" import { useSync } from "@/context/sync" -import { useGlobalSDK } from "@/context/global-sdk" -import { getFilename } from "@opencode-ai/util/path" import { decode64 } from "@/utils/base64" import { Persist, persisted } from "@/utils/persist" - -import { Icon } from "@opencode-ai/ui/icon" -import { IconButton } from "@opencode-ai/ui/icon-button" -import { Button } from "@opencode-ai/ui/button" -import { AppIcon } from "@opencode-ai/ui/app-icon" -import { DropdownMenu } from "@opencode-ai/ui/dropdown-menu" -import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip" -import { Popover } from "@opencode-ai/ui/popover" -import { TextField } from "@opencode-ai/ui/text-field" -import { Keybind } from "@opencode-ai/ui/keybind" -import { showToast } from "@opencode-ai/ui/toast" import { StatusPopover } from "../status-popover" const OPEN_APPS = [ @@ -45,32 +45,67 @@ type OpenApp = (typeof OPEN_APPS)[number] type OS = "macos" | "windows" | "linux" | "unknown" const MAC_APPS = [ - { id: "vscode", label: "VS Code", icon: "vscode", openWith: "Visual Studio Code" }, + { + id: "vscode", + label: "VS Code", + icon: "vscode", + openWith: "Visual Studio Code", + }, { id: "cursor", label: "Cursor", icon: "cursor", openWith: "Cursor" }, { id: "zed", label: "Zed", icon: "zed", openWith: "Zed" }, { id: "textmate", label: "TextMate", icon: "textmate", openWith: "TextMate" }, - { id: "antigravity", label: "Antigravity", icon: "antigravity", openWith: "Antigravity" }, + { + id: "antigravity", + label: "Antigravity", + icon: "antigravity", + openWith: "Antigravity", + }, { id: "terminal", label: "Terminal", icon: "terminal", openWith: "Terminal" }, { id: "iterm2", label: "iTerm2", icon: "iterm2", openWith: "iTerm" }, { id: "ghostty", label: "Ghostty", icon: "ghostty", openWith: "Ghostty" }, { id: "xcode", label: "Xcode", icon: "xcode", openWith: "Xcode" }, - { id: "android-studio", label: "Android Studio", icon: "android-studio", openWith: "Android Studio" }, - { id: "sublime-text", label: "Sublime Text", icon: "sublime-text", openWith: "Sublime Text" }, + { + id: "android-studio", + label: "Android Studio", + icon: "android-studio", + openWith: "Android Studio", + }, + { + id: "sublime-text", + label: "Sublime Text", + icon: "sublime-text", + openWith: "Sublime Text", + }, ] as const const WINDOWS_APPS = [ { id: "vscode", label: "VS Code", icon: "vscode", openWith: "code" }, { id: "cursor", label: "Cursor", icon: "cursor", openWith: "cursor" }, { id: "zed", label: "Zed", icon: "zed", openWith: "zed" }, - { id: "powershell", label: "PowerShell", icon: "powershell", openWith: "powershell" }, - { id: "sublime-text", label: "Sublime Text", icon: "sublime-text", openWith: "Sublime Text" }, + { + id: "powershell", + label: "PowerShell", + icon: "powershell", + openWith: "powershell", + }, + { + id: "sublime-text", + label: "Sublime Text", + icon: "sublime-text", + openWith: "Sublime Text", + }, ] as const const LINUX_APPS = [ { id: "vscode", label: "VS Code", icon: "vscode", openWith: "code" }, { id: "cursor", label: "Cursor", icon: "cursor", openWith: "cursor" }, { id: "zed", label: "Zed", icon: "zed", openWith: "zed" }, - { id: "sublime-text", label: "Sublime Text", icon: "sublime-text", openWith: "Sublime Text" }, + { + id: "sublime-text", + label: "Sublime Text", + icon: "sublime-text", + openWith: "Sublime Text", + }, ] as const type OpenOption = (typeof MAC_APPS)[number] | (typeof WINDOWS_APPS)[number] | (typeof LINUX_APPS)[number] @@ -213,7 +248,9 @@ export function SessionHeader() { const view = createMemo(() => layout.view(sessionKey)) const os = createMemo(() => detectOS(platform)) - const [exists, setExists] = createStore>>({ finder: true }) + const [exists, setExists] = createStore>>({ + finder: true, + }) const apps = createMemo(() => { if (os() === "macos") return MAC_APPS @@ -259,18 +296,34 @@ export function SessionHeader() { const [prefs, setPrefs] = persisted(Persist.global("open.app"), createStore({ app: "finder" as OpenApp })) const [menu, setMenu] = createStore({ open: false }) + const [openRequest, setOpenRequest] = createStore({ + app: undefined as OpenApp | undefined, + }) const canOpen = createMemo(() => platform.platform === "desktop" && !!platform.openPath && server.isLocal()) const current = createMemo(() => options().find((o) => o.id === prefs.app) ?? options()[0]) + const opening = createMemo(() => openRequest.app !== undefined) + + createEffect(() => { + const value = prefs.app + if (options().some((o) => o.id === value)) return + setPrefs("app", options()[0]?.id ?? "finder") + }) const openDir = (app: OpenApp) => { + if (opening() || !canOpen() || !platform.openPath) return const directory = projectDirectory() if (!directory) return - if (!canOpen()) return const item = options().find((o) => o.id === app) const openWith = item && "openWith" in item ? item.openWith : undefined - Promise.resolve(platform.openPath?.(directory, openWith)).catch((err: unknown) => showRequestError(language, err)) + setOpenRequest("app", app) + platform + .openPath(directory, openWith) + .catch((err: unknown) => showRequestError(language, err)) + .finally(() => { + setOpenRequest("app", undefined) + }) } const copyPath = () => { @@ -315,7 +368,9 @@ export function SessionHeader() {
- {language.t("session.header.search.placeholder", { project: name() })} + {language.t("session.header.search.placeholder", { + project: name(), + })}
@@ -357,12 +412,21 @@ export function SessionHeader() {
@@ -377,7 +441,11 @@ export function SessionHeader() { as={IconButton} icon="chevron-down" variant="ghost" - class="rounded-none h-full w-[24px] p-0 border-none shadow-none data-[expanded]:bg-surface-raised-base-hover" + disabled={opening()} + class="rounded-none h-full w-[24px] p-0 border-none shadow-none data-[expanded]:bg-surface-raised-base-active disabled:!cursor-default" + classList={{ + "bg-surface-raised-base-active": opening(), + }} aria-label={language.t("session.header.open.menu")} /> @@ -395,6 +463,7 @@ export function SessionHeader() { {(o) => ( { setMenu("open", false) openDir(o.id) diff --git a/packages/desktop/src-tauri/Cargo.lock b/packages/desktop/src-tauri/Cargo.lock index f9516350e13a..55f0d5f36033 100644 --- a/packages/desktop/src-tauri/Cargo.lock +++ b/packages/desktop/src-tauri/Cargo.lock @@ -1988,7 +1988,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core 0.61.2", ] [[package]] @@ -3136,7 +3136,8 @@ dependencies = [ "tracing-subscriber", "uuid", "webkit2gtk", - "windows 0.62.2", + "windows-core 0.62.2", + "windows-sys 0.61.2", ] [[package]] diff --git a/packages/desktop/src-tauri/Cargo.toml b/packages/desktop/src-tauri/Cargo.toml index e98b8965c163..b228c7b6162c 100644 --- a/packages/desktop/src-tauri/Cargo.toml +++ b/packages/desktop/src-tauri/Cargo.toml @@ -55,7 +55,8 @@ tokio-stream = { version = "0.1.18", features = ["sync"] } process-wrap = { version = "9.0.3", features = ["tokio1"] } [target.'cfg(windows)'.dependencies] -windows = { version = "0.62", features = ["Win32_System_Threading"] } +windows-sys = { version = "0.61", features = ["Win32_System_Threading", "Win32_System_Registry"] } +windows-core = "0.62" [target.'cfg(target_os = "linux")'.dependencies] gtk = "0.18.2" diff --git a/packages/desktop/src-tauri/src/cli.rs b/packages/desktop/src-tauri/src/cli.rs index acab0fa7034c..0c5dfebaf5e5 100644 --- a/packages/desktop/src-tauri/src/cli.rs +++ b/packages/desktop/src-tauri/src/cli.rs @@ -19,7 +19,7 @@ use tokio::{ use tokio_stream::wrappers::ReceiverStream; use tracing::Instrument; #[cfg(windows)] -use windows::Win32::System::Threading::{CREATE_NO_WINDOW, CREATE_SUSPENDED}; +use windows_sys::Win32::System::Threading::{CREATE_NO_WINDOW, CREATE_SUSPENDED}; use crate::server::get_wsl_config; @@ -32,7 +32,7 @@ struct WinCreationFlags; #[cfg(windows)] impl CommandWrapper for WinCreationFlags { fn pre_spawn(&mut self, command: &mut Command, _core: &CommandWrap) -> std::io::Result<()> { - command.creation_flags((CREATE_NO_WINDOW | CREATE_SUSPENDED).0); + command.creation_flags(CREATE_NO_WINDOW | CREATE_SUSPENDED); Ok(()) } } diff --git a/packages/desktop/src-tauri/src/lib.rs b/packages/desktop/src-tauri/src/lib.rs index 7ea3aaa8a76b..71fe8407f029 100644 --- a/packages/desktop/src-tauri/src/lib.rs +++ b/packages/desktop/src-tauri/src/lib.rs @@ -6,6 +6,7 @@ pub mod linux_display; pub mod linux_windowing; mod logging; mod markdown; +mod os; mod server; mod window_customizer; mod windows; @@ -42,7 +43,7 @@ struct ServerReadyData { url: String, username: Option, password: Option, - is_sidecar: bool + is_sidecar: bool, } #[derive(Clone, Copy, serde::Serialize, specta::Type, Debug)] @@ -148,7 +149,7 @@ async fn await_initialization( fn check_app_exists(app_name: &str) -> bool { #[cfg(target_os = "windows")] { - check_windows_app(app_name) + os::windows::check_windows_app(app_name) } #[cfg(target_os = "macos")] @@ -162,156 +163,12 @@ fn check_app_exists(app_name: &str) -> bool { } } -#[cfg(target_os = "windows")] -fn check_windows_app(_app_name: &str) -> bool { - // Check if command exists in PATH, including .exe - return true; -} - -#[cfg(target_os = "windows")] -fn resolve_windows_app_path(app_name: &str) -> Option { - use std::path::{Path, PathBuf}; - - // Try to find the command using 'where' - let output = Command::new("where").arg(app_name).output().ok()?; - - if !output.status.success() { - return None; - } - - let paths = String::from_utf8_lossy(&output.stdout) - .lines() - .map(str::trim) - .filter(|line| !line.is_empty()) - .map(PathBuf::from) - .collect::>(); - - let has_ext = |path: &Path, ext: &str| { - path.extension() - .and_then(|v| v.to_str()) - .map(|v| v.eq_ignore_ascii_case(ext)) - .unwrap_or(false) - }; - - if let Some(path) = paths.iter().find(|path| has_ext(path, "exe")) { - return Some(path.to_string_lossy().to_string()); - } - - let resolve_cmd = |path: &Path| -> Option { - let content = std::fs::read_to_string(path).ok()?; - - for token in content.split('"') { - let lower = token.to_ascii_lowercase(); - if !lower.contains(".exe") { - continue; - } - - if let Some(index) = lower.find("%~dp0") { - let base = path.parent()?; - let suffix = &token[index + 5..]; - let mut resolved = PathBuf::from(base); - - for part in suffix.replace('/', "\\").split('\\') { - if part.is_empty() || part == "." { - continue; - } - if part == ".." { - let _ = resolved.pop(); - continue; - } - resolved.push(part); - } - - if resolved.exists() { - return Some(resolved.to_string_lossy().to_string()); - } - } - - let resolved = PathBuf::from(token); - if resolved.exists() { - return Some(resolved.to_string_lossy().to_string()); - } - } - - None - }; - - for path in &paths { - if has_ext(path, "cmd") || has_ext(path, "bat") { - if let Some(resolved) = resolve_cmd(path) { - return Some(resolved); - } - } - - if path.extension().is_none() { - let cmd = path.with_extension("cmd"); - if cmd.exists() { - if let Some(resolved) = resolve_cmd(&cmd) { - return Some(resolved); - } - } - - let bat = path.with_extension("bat"); - if bat.exists() { - if let Some(resolved) = resolve_cmd(&bat) { - return Some(resolved); - } - } - } - } - - let key = app_name - .chars() - .filter(|v| v.is_ascii_alphanumeric()) - .flat_map(|v| v.to_lowercase()) - .collect::(); - - if !key.is_empty() { - for path in &paths { - let dirs = [ - path.parent(), - path.parent().and_then(|dir| dir.parent()), - path.parent() - .and_then(|dir| dir.parent()) - .and_then(|dir| dir.parent()), - ]; - - for dir in dirs.into_iter().flatten() { - if let Ok(entries) = std::fs::read_dir(dir) { - for entry in entries.flatten() { - let candidate = entry.path(); - if !has_ext(&candidate, "exe") { - continue; - } - - let Some(stem) = candidate.file_stem().and_then(|v| v.to_str()) else { - continue; - }; - - let name = stem - .chars() - .filter(|v| v.is_ascii_alphanumeric()) - .flat_map(|v| v.to_lowercase()) - .collect::(); - - if name.contains(&key) || key.contains(&name) { - return Some(candidate.to_string_lossy().to_string()); - } - } - } - } - } - } - - paths.first().map(|path| path.to_string_lossy().to_string()) -} - #[tauri::command] #[specta::specta] fn resolve_app_path(app_name: &str) -> Option { #[cfg(target_os = "windows")] { - resolve_windows_app_path(app_name) + os::windows::resolve_windows_app_path(app_name) } #[cfg(not(target_os = "windows"))] @@ -634,7 +491,12 @@ async fn initialize(app: AppHandle) { app.state::().set_child(Some(child)); - Ok(ServerReadyData { url, username,password, is_sidecar: true }) + Ok(ServerReadyData { + url, + username, + password, + is_sidecar: true, + }) } .map(move |res| { let _ = server_ready_tx.send(res); diff --git a/packages/desktop/src-tauri/src/os/mod.rs b/packages/desktop/src-tauri/src/os/mod.rs new file mode 100644 index 000000000000..8c36e53f779f --- /dev/null +++ b/packages/desktop/src-tauri/src/os/mod.rs @@ -0,0 +1,2 @@ +#[cfg(windows)] +pub mod windows; diff --git a/packages/desktop/src-tauri/src/os/windows.rs b/packages/desktop/src-tauri/src/os/windows.rs new file mode 100644 index 000000000000..cab265b626bd --- /dev/null +++ b/packages/desktop/src-tauri/src/os/windows.rs @@ -0,0 +1,439 @@ +use std::{ + ffi::c_void, + os::windows::process::CommandExt, + path::{Path, PathBuf}, + process::Command, +}; +use windows_sys::Win32::{ + Foundation::ERROR_SUCCESS, + System::Registry::{ + HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, REG_EXPAND_SZ, REG_SZ, RRF_RT_REG_EXPAND_SZ, + RRF_RT_REG_SZ, RegGetValueW, + }, +}; + +pub fn check_windows_app(app_name: &str) -> bool { + resolve_windows_app_path(app_name).is_some() +} + +pub fn resolve_windows_app_path(app_name: &str) -> Option { + fn expand_env(value: &str) -> String { + let mut out = String::with_capacity(value.len()); + let mut index = 0; + + while let Some(start) = value[index..].find('%') { + let start = index + start; + out.push_str(&value[index..start]); + + let Some(end_rel) = value[start + 1..].find('%') else { + out.push_str(&value[start..]); + return out; + }; + + let end = start + 1 + end_rel; + let key = &value[start + 1..end]; + if key.is_empty() { + out.push('%'); + index = end + 1; + continue; + } + + if let Ok(v) = std::env::var(key) { + out.push_str(&v); + index = end + 1; + continue; + } + + out.push_str(&value[start..=end]); + index = end + 1; + } + + out.push_str(&value[index..]); + out + } + + fn extract_exe(value: &str) -> Option { + let value = value.trim(); + if value.is_empty() { + return None; + } + + if let Some(rest) = value.strip_prefix('"') { + if let Some(end) = rest.find('"') { + let inner = rest[..end].trim(); + if inner.to_ascii_lowercase().contains(".exe") { + return Some(inner.to_string()); + } + } + } + + let lower = value.to_ascii_lowercase(); + let end = lower.find(".exe")?; + Some(value[..end + 4].trim().trim_matches('"').to_string()) + } + + fn candidates(app_name: &str) -> Vec { + let app_name = app_name.trim().trim_matches('"'); + if app_name.is_empty() { + return vec![]; + } + + let mut out = Vec::::new(); + let mut push = |value: String| { + let value = value.trim().trim_matches('"').to_string(); + if value.is_empty() { + return; + } + if out.iter().any(|v| v.eq_ignore_ascii_case(&value)) { + return; + } + out.push(value); + }; + + push(app_name.to_string()); + + let lower = app_name.to_ascii_lowercase(); + if !lower.ends_with(".exe") { + push(format!("{app_name}.exe")); + } + + let snake = { + let mut s = String::new(); + let mut underscore = false; + for c in lower.chars() { + if c.is_ascii_alphanumeric() { + s.push(c); + underscore = false; + continue; + } + if underscore { + continue; + } + s.push('_'); + underscore = true; + } + s.trim_matches('_').to_string() + }; + + if !snake.is_empty() { + push(snake.clone()); + if !snake.ends_with(".exe") { + push(format!("{snake}.exe")); + } + } + + let alnum = lower + .chars() + .filter(|c| c.is_ascii_alphanumeric()) + .collect::(); + + if !alnum.is_empty() { + push(alnum.clone()); + push(format!("{alnum}.exe")); + } + + match lower.as_str() { + "sublime text" | "sublime-text" | "sublime_text" | "sublime text.exe" => { + push("subl".to_string()); + push("subl.exe".to_string()); + push("sublime_text".to_string()); + push("sublime_text.exe".to_string()); + } + _ => {} + } + + out + } + + fn reg_app_path(exe: &str) -> Option { + let exe = exe.trim().trim_matches('"'); + if exe.is_empty() { + return None; + } + + let query = |root: *mut c_void, subkey: &str| -> Option { + let flags = RRF_RT_REG_SZ | RRF_RT_REG_EXPAND_SZ; + let mut kind: u32 = 0; + let mut size = 0u32; + + let mut key = subkey.encode_utf16().collect::>(); + key.push(0); + + let status = unsafe { + RegGetValueW( + root, + key.as_ptr(), + std::ptr::null(), + flags, + &mut kind, + std::ptr::null_mut(), + &mut size, + ) + }; + + if status != ERROR_SUCCESS || size == 0 { + return None; + } + + if kind != REG_SZ && kind != REG_EXPAND_SZ { + return None; + } + + let mut data = vec![0u8; size as usize]; + let status = unsafe { + RegGetValueW( + root, + key.as_ptr(), + std::ptr::null(), + flags, + &mut kind, + data.as_mut_ptr() as *mut c_void, + &mut size, + ) + }; + + if status != ERROR_SUCCESS || size < 2 { + return None; + } + + let words = unsafe { + std::slice::from_raw_parts(data.as_ptr().cast::(), (size as usize) / 2) + }; + let len = words.iter().position(|v| *v == 0).unwrap_or(words.len()); + let value = String::from_utf16_lossy(&words[..len]).trim().to_string(); + + if value.is_empty() { + return None; + } + + Some(value) + }; + + let keys = [ + ( + HKEY_CURRENT_USER, + format!(r"Software\Microsoft\Windows\CurrentVersion\App Paths\{exe}"), + ), + ( + HKEY_LOCAL_MACHINE, + format!(r"Software\Microsoft\Windows\CurrentVersion\App Paths\{exe}"), + ), + ( + HKEY_LOCAL_MACHINE, + format!(r"Software\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\{exe}"), + ), + ]; + + for (root, key) in keys { + let Some(value) = query(root, &key) else { + continue; + }; + + let Some(exe) = extract_exe(&value) else { + continue; + }; + + let exe = expand_env(&exe); + let path = Path::new(exe.trim().trim_matches('"')); + if path.exists() { + return Some(path.to_string_lossy().to_string()); + } + } + + None + } + + let app_name = app_name.trim().trim_matches('"'); + if app_name.is_empty() { + return None; + } + + let direct = Path::new(app_name); + if direct.is_absolute() && direct.exists() { + return Some(direct.to_string_lossy().to_string()); + } + + let key = app_name + .chars() + .filter(|v| v.is_ascii_alphanumeric()) + .flat_map(|v| v.to_lowercase()) + .collect::(); + + let has_ext = |path: &Path, ext: &str| { + path.extension() + .and_then(|v| v.to_str()) + .map(|v| v.eq_ignore_ascii_case(ext)) + .unwrap_or(false) + }; + + let resolve_cmd = |path: &Path| -> Option { + let bytes = std::fs::read(path).ok()?; + let content = String::from_utf8_lossy(&bytes); + + for token in content.split('"') { + let Some(exe) = extract_exe(token) else { + continue; + }; + + let lower = exe.to_ascii_lowercase(); + if let Some(index) = lower.find("%~dp0") { + let base = path.parent()?; + let suffix = &exe[index + 5..]; + let mut resolved = PathBuf::from(base); + + for part in suffix.replace('/', "\\").split('\\') { + if part.is_empty() || part == "." { + continue; + } + if part == ".." { + let _ = resolved.pop(); + continue; + } + resolved.push(part); + } + + if resolved.exists() { + return Some(resolved.to_string_lossy().to_string()); + } + + continue; + } + + let resolved = PathBuf::from(expand_env(&exe)); + if resolved.exists() { + return Some(resolved.to_string_lossy().to_string()); + } + } + + None + }; + + let resolve_where = |query: &str| -> Option { + let output = Command::new("where") + .creation_flags(0x08000000) + .arg(query) + .output() + .ok()?; + if !output.status.success() { + return None; + } + + let paths = String::from_utf8_lossy(&output.stdout) + .lines() + .map(str::trim) + .filter(|line| !line.is_empty()) + .map(PathBuf::from) + .collect::>(); + + if paths.is_empty() { + return None; + } + + if let Some(path) = paths.iter().find(|path| has_ext(path, "exe")) { + return Some(path.to_string_lossy().to_string()); + } + + for path in &paths { + if has_ext(path, "cmd") || has_ext(path, "bat") { + if let Some(resolved) = resolve_cmd(path) { + return Some(resolved); + } + } + + if path.extension().is_none() { + let cmd = path.with_extension("cmd"); + if cmd.exists() { + if let Some(resolved) = resolve_cmd(&cmd) { + return Some(resolved); + } + } + + let bat = path.with_extension("bat"); + if bat.exists() { + if let Some(resolved) = resolve_cmd(&bat) { + return Some(resolved); + } + } + } + } + + if !key.is_empty() { + for path in &paths { + let dirs = [ + path.parent(), + path.parent().and_then(|dir| dir.parent()), + path.parent() + .and_then(|dir| dir.parent()) + .and_then(|dir| dir.parent()), + ]; + + for dir in dirs.into_iter().flatten() { + if let Ok(entries) = std::fs::read_dir(dir) { + for entry in entries.flatten() { + let candidate = entry.path(); + if !has_ext(&candidate, "exe") { + continue; + } + + let Some(stem) = candidate.file_stem().and_then(|v| v.to_str()) else { + continue; + }; + + let name = stem + .chars() + .filter(|v| v.is_ascii_alphanumeric()) + .flat_map(|v| v.to_lowercase()) + .collect::(); + + if name.contains(&key) || key.contains(&name) { + return Some(candidate.to_string_lossy().to_string()); + } + } + } + } + } + } + + paths.first().map(|path| path.to_string_lossy().to_string()) + }; + + let list = candidates(app_name); + for query in &list { + if let Some(path) = resolve_where(query) { + return Some(path); + } + } + + let mut exes = Vec::::new(); + for query in &list { + let query = query.trim().trim_matches('"'); + if query.is_empty() { + continue; + } + + let name = Path::new(query) + .file_name() + .and_then(|v| v.to_str()) + .unwrap_or(query); + + let exe = if name.to_ascii_lowercase().ends_with(".exe") { + name.to_string() + } else { + format!("{name}.exe") + }; + + if exes.iter().any(|v| v.eq_ignore_ascii_case(&exe)) { + continue; + } + + exes.push(exe); + } + + for exe in exes { + if let Some(path) = reg_app_path(&exe) { + return Some(path); + } + } + + None +} From 3c6c74457d53a01a3f42a758ad1317cd6ed1b963 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Wed, 25 Feb 2026 01:38:58 -0500 Subject: [PATCH 76/95] sync --- packages/opencode/BUN_SHELL_MIGRATION_PLAN.md | 136 ++++++++++++++++++ packages/opencode/src/util/git.ts | 74 +++------- packages/opencode/src/util/process.ts | 97 ++++++++++--- packages/opencode/test/util/process.test.ts | 59 ++++++++ 4 files changed, 294 insertions(+), 72 deletions(-) create mode 100644 packages/opencode/BUN_SHELL_MIGRATION_PLAN.md create mode 100644 packages/opencode/test/util/process.test.ts diff --git a/packages/opencode/BUN_SHELL_MIGRATION_PLAN.md b/packages/opencode/BUN_SHELL_MIGRATION_PLAN.md new file mode 100644 index 000000000000..6cb21ac8f61f --- /dev/null +++ b/packages/opencode/BUN_SHELL_MIGRATION_PLAN.md @@ -0,0 +1,136 @@ +# Bun shell migration plan + +Practical phased replacement of Bun `$` calls. + +## Goal + +Replace runtime Bun shell template-tag usage in `packages/opencode/src` with a unified `Process` API in `util/process.ts`. + +Keep behavior stable while improving safety, testability, and observability. + +Current baseline from audit: + +- 143 runtime command invocations across 17 files +- 84 are git commands +- Largest hotspots: + - `src/cli/cmd/github.ts` (33) + - `src/worktree/index.ts` (22) + - `src/lsp/server.ts` (21) + - `src/installation/index.ts` (20) + - `src/snapshot/index.ts` (18) + +## Decisions + +- Extend `src/util/process.ts` (do not create a separate exec module). +- Proceed with phased migration for both git and non-git paths. +- Keep plugin `$` compatibility in 1.x and remove in 2.0. + +## Non-goals + +- Do not remove plugin `$` compatibility in this effort. +- Do not redesign command semantics beyond what is needed to preserve behavior. + +## Constraints + +- Keep migration phased, not big-bang. +- Minimize behavioral drift. +- Keep these explicit shell-only exceptions: + - `src/session/prompt.ts` raw command execution + - worktree start scripts in `src/worktree/index.ts` + +## Process API proposal (`src/util/process.ts`) + +Add higher-level wrappers on top of current spawn support. + +Core methods: + +- `Process.run(cmd, opts)` +- `Process.text(cmd, opts)` +- `Process.lines(cmd, opts)` +- `Process.status(cmd, opts)` +- `Process.shell(command, opts)` for intentional shell execution + +Git helpers: + +- `Process.git(args, opts)` +- `Process.gitText(args, opts)` + +Shared options: + +- `cwd`, `env`, `stdin`, `stdout`, `stderr`, `abort`, `timeout`, `kill` +- `allowFailure` / non-throw mode +- optional redaction + trace metadata + +Standard result shape: + +- `code`, `stdout`, `stderr`, `duration_ms`, `cmd` +- helpers like `text()` and `arrayBuffer()` where useful + +## Phased rollout + +### Phase 0: Foundation + +- Implement Process wrappers in `src/util/process.ts`. +- Refactor `src/util/git.ts` to use Process only. +- Add tests for exit handling, timeout, abort, and output capture. + +### Phase 1: High-impact hotspots + +Migrate these first: + +- `src/cli/cmd/github.ts` +- `src/worktree/index.ts` +- `src/lsp/server.ts` +- `src/installation/index.ts` +- `src/snapshot/index.ts` + +Within each file, migrate git paths first where applicable. + +### Phase 2: Remaining git-heavy files + +Migrate git-centric call sites to `Process.git*` helpers: + +- `src/file/index.ts` +- `src/project/vcs.ts` +- `src/file/watcher.ts` +- `src/storage/storage.ts` +- `src/cli/cmd/pr.ts` + +### Phase 3: Remaining non-git files + +Migrate residual non-git usages: + +- `src/cli/cmd/tui/util/clipboard.ts` +- `src/util/archive.ts` +- `src/file/ripgrep.ts` +- `src/tool/bash.ts` +- `src/cli/cmd/uninstall.ts` + +### Phase 4: Stabilize + +- Remove dead wrappers and one-off patterns. +- Keep plugin `$` compatibility isolated and documented as temporary. +- Create linked 2.0 task for plugin `$` removal. + +## Validation strategy + +- Unit tests for new `Process` methods and options. +- Integration tests on hotspot modules. +- Smoke tests for install, snapshot, worktree, and GitHub flows. +- Regression checks for output parsing behavior. + +## Risk mitigation + +- File-by-file PRs with small diffs. +- Preserve behavior first, simplify second. +- Keep shell-only exceptions explicit and documented. +- Add consistent error shaping and logging at Process layer. + +## Definition of done + +- Runtime Bun `$` usage in `packages/opencode/src` is removed except: + - approved shell-only exceptions + - temporary plugin compatibility path (1.x) +- Git paths use `Process.git*` consistently. +- CI and targeted smoke tests pass. +- 2.0 issue exists for plugin `$` removal. diff --git a/packages/opencode/src/util/git.ts b/packages/opencode/src/util/git.ts index 8e1427c99d54..731131357f21 100644 --- a/packages/opencode/src/util/git.ts +++ b/packages/opencode/src/util/git.ts @@ -1,63 +1,35 @@ -import { $ } from "bun" -import { buffer } from "node:stream/consumers" -import { Flag } from "../flag/flag" import { Process } from "./process" export interface GitResult { exitCode: number - text(): string | Promise - stdout: Buffer | ReadableStream - stderr: Buffer | ReadableStream + text(): string + stdout: Buffer + stderr: Buffer } /** * Run a git command. * - * Uses Bun's lightweight `$` shell by default. When the process is running - * as an ACP client, child processes inherit the parent's stdin pipe which - * carries protocol data – on Windows this causes git to deadlock. In that - * case we fall back to `Process.spawn` with `stdin: "ignore"`. + * Uses Process helpers with stdin ignored to avoid protocol pipe inheritance + * issues in embedded/client environments. */ export async function git(args: string[], opts: { cwd: string; env?: Record }): Promise { - if (Flag.OPENCODE_CLIENT === "acp") { - try { - const proc = Process.spawn(["git", ...args], { - stdin: "ignore", - stdout: "pipe", - stderr: "pipe", - cwd: opts.cwd, - env: opts.env ? { ...process.env, ...opts.env } : process.env, - }) - // Read output concurrently with exit to avoid pipe buffer deadlock - if (!proc.stdout || !proc.stderr) { - throw new Error("Process output not available") - } - const [exitCode, out, err] = await Promise.all([proc.exited, buffer(proc.stdout), buffer(proc.stderr)]) - return { - exitCode, - text: () => out.toString(), - stdout: out, - stderr: err, - } - } catch (error) { - const stderr = Buffer.from(error instanceof Error ? error.message : String(error)) - return { - exitCode: 1, - text: () => "", - stdout: Buffer.alloc(0), - stderr, - } - } - } - - const env = opts.env ? { ...process.env, ...opts.env } : undefined - let cmd = $`git ${args}`.quiet().nothrow().cwd(opts.cwd) - if (env) cmd = cmd.env(env) - const result = await cmd - return { - exitCode: result.exitCode, - text: () => result.text(), - stdout: result.stdout, - stderr: result.stderr, - } + return Process.run(["git", ...args], { + cwd: opts.cwd, + env: opts.env, + stdin: "ignore", + nothrow: true, + }) + .then((result) => ({ + exitCode: result.code, + text: () => result.stdout.toString(), + stdout: result.stdout, + stderr: result.stderr, + })) + .catch((error) => ({ + exitCode: 1, + text: () => "", + stdout: Buffer.alloc(0), + stderr: Buffer.from(error instanceof Error ? error.message : String(error)), + })) } diff --git a/packages/opencode/src/util/process.ts b/packages/opencode/src/util/process.ts index 09c55661fddd..71f001a86a13 100644 --- a/packages/opencode/src/util/process.ts +++ b/packages/opencode/src/util/process.ts @@ -1,4 +1,5 @@ import { spawn as launch, type ChildProcess } from "child_process" +import { buffer } from "node:stream/consumers" export namespace Process { export type Stdio = "inherit" | "pipe" | "ignore" @@ -14,58 +15,112 @@ export namespace Process { timeout?: number } + export interface RunOptions extends Omit { + nothrow?: boolean + } + + export interface Result { + code: number + stdout: Buffer + stderr: Buffer + } + + export class RunFailedError extends Error { + readonly cmd: string[] + readonly code: number + readonly stdout: Buffer + readonly stderr: Buffer + + constructor(cmd: string[], code: number, stdout: Buffer, stderr: Buffer) { + const text = stderr.toString().trim() + super( + text + ? `Command failed with code ${code}: ${cmd.join(" ")}\n${text}` + : `Command failed with code ${code}: ${cmd.join(" ")}`, + ) + this.name = "ProcessRunFailedError" + this.cmd = [...cmd] + this.code = code + this.stdout = stdout + this.stderr = stderr + } + } + export type Child = ChildProcess & { exited: Promise } - export function spawn(cmd: string[], options: Options = {}): Child { + export function spawn(cmd: string[], opts: Options = {}): Child { if (cmd.length === 0) throw new Error("Command is required") - options.abort?.throwIfAborted() + opts.abort?.throwIfAborted() const proc = launch(cmd[0], cmd.slice(1), { - cwd: options.cwd, - env: options.env === null ? {} : options.env ? { ...process.env, ...options.env } : undefined, - stdio: [options.stdin ?? "ignore", options.stdout ?? "ignore", options.stderr ?? "ignore"], + cwd: opts.cwd, + env: opts.env === null ? {} : opts.env ? { ...process.env, ...opts.env } : undefined, + stdio: [opts.stdin ?? "ignore", opts.stdout ?? "ignore", opts.stderr ?? "ignore"], }) - let aborted = false + let closed = false let timer: ReturnType | undefined const abort = () => { - if (aborted) return + if (closed) return if (proc.exitCode !== null || proc.signalCode !== null) return - aborted = true - - proc.kill(options.kill ?? "SIGTERM") + closed = true - const timeout = options.timeout ?? 5_000 - if (timeout <= 0) return + proc.kill(opts.kill ?? "SIGTERM") - timer = setTimeout(() => { - proc.kill("SIGKILL") - }, timeout) + const ms = opts.timeout ?? 5_000 + if (ms <= 0) return + timer = setTimeout(() => proc.kill("SIGKILL"), ms) } const exited = new Promise((resolve, reject) => { const done = () => { - options.abort?.removeEventListener("abort", abort) + opts.abort?.removeEventListener("abort", abort) if (timer) clearTimeout(timer) } - proc.once("exit", (exitCode, signal) => { + + proc.once("exit", (code, signal) => { done() - resolve(exitCode ?? (signal ? 1 : 0)) + resolve(code ?? (signal ? 1 : 0)) }) + proc.once("error", (error) => { done() reject(error) }) }) - if (options.abort) { - options.abort.addEventListener("abort", abort, { once: true }) - if (options.abort.aborted) abort() + if (opts.abort) { + opts.abort.addEventListener("abort", abort, { once: true }) + if (opts.abort.aborted) abort() } const child = proc as Child child.exited = exited return child } + + export async function run(cmd: string[], opts: RunOptions = {}): Promise { + const proc = spawn(cmd, { + cwd: opts.cwd, + env: opts.env, + stdin: opts.stdin, + abort: opts.abort, + kill: opts.kill, + timeout: opts.timeout, + stdout: "pipe", + stderr: "pipe", + }) + + if (!proc.stdout || !proc.stderr) throw new Error("Process output not available") + + const [code, stdout, stderr] = await Promise.all([proc.exited, buffer(proc.stdout), buffer(proc.stderr)]) + const out = { + code, + stdout, + stderr, + } + if (out.code === 0 || opts.nothrow) return out + throw new RunFailedError(cmd, out.code, out.stdout, out.stderr) + } } diff --git a/packages/opencode/test/util/process.test.ts b/packages/opencode/test/util/process.test.ts new file mode 100644 index 000000000000..ce599d6d8f06 --- /dev/null +++ b/packages/opencode/test/util/process.test.ts @@ -0,0 +1,59 @@ +import { describe, expect, test } from "bun:test" +import { Process } from "../../src/util/process" + +function node(script: string) { + return [process.execPath, "-e", script] +} + +describe("util.process", () => { + test("captures stdout and stderr", async () => { + const out = await Process.run(node('process.stdout.write("out");process.stderr.write("err")')) + expect(out.code).toBe(0) + expect(out.stdout.toString()).toBe("out") + expect(out.stderr.toString()).toBe("err") + }) + + test("returns code when nothrow is enabled", async () => { + const out = await Process.run(node("process.exit(7)"), { nothrow: true }) + expect(out.code).toBe(7) + }) + + test("throws RunFailedError on non-zero exit", async () => { + const err = await Process.run(node('process.stderr.write("bad");process.exit(3)')).catch((error) => error) + expect(err).toBeInstanceOf(Process.RunFailedError) + if (!(err instanceof Process.RunFailedError)) throw err + expect(err.code).toBe(3) + expect(err.stderr.toString()).toBe("bad") + }) + + test("aborts a running process", async () => { + const abort = new AbortController() + const started = Date.now() + setTimeout(() => abort.abort(), 25) + + const out = await Process.run(node("setInterval(() => {}, 1000)"), { + abort: abort.signal, + nothrow: true, + }) + + expect(out.code).not.toBe(0) + expect(Date.now() - started).toBeLessThan(1000) + }, 3000) + + test("kills after timeout when process ignores terminate signal", async () => { + if (process.platform === "win32") return + + const abort = new AbortController() + const started = Date.now() + setTimeout(() => abort.abort(), 25) + + const out = await Process.run(node('process.on("SIGTERM", () => {}); setInterval(() => {}, 1000)'), { + abort: abort.signal, + nothrow: true, + timeout: 25, + }) + + expect(out.code).not.toBe(0) + expect(Date.now() - started).toBeLessThan(1000) + }, 3000) +}) From 561f9f5f059ccefdad89ca01e79cc1234b913820 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Wed, 25 Feb 2026 01:54:28 -0500 Subject: [PATCH 77/95] opencode go copy --- .../cli/cmd/tui/component/dialog-provider.tsx | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx index 9682bee4ead2..d88dfdd86f17 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx @@ -16,10 +16,11 @@ import { useToast } from "../ui/toast" const PROVIDER_PRIORITY: Record = { opencode: 0, - anthropic: 1, + openai: 1, "github-copilot": 2, - openai: 3, - google: 4, + "opencode-go": 3, + anthropic: 4, + google: 5, } export function createDialogProviderOptions() { @@ -37,6 +38,7 @@ export function createDialogProviderOptions() { opencode: "(Recommended)", anthropic: "(Claude Max or API key)", openai: "(ChatGPT Plus/Pro or API key)", + "opencode-go": "(Low cost)", }[provider.id], category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Other", async onSelect() { @@ -214,16 +216,30 @@ function ApiMethod(props: ApiMethodProps) { title={props.title} placeholder="API key" description={ - props.providerID === "opencode" ? ( - - - OpenCode Zen gives you access to all the best coding models at the cheapest prices with a single API key. - - - Go to https://opencode.ai/zen to get a key - - - ) : undefined + { + opencode: ( + + + OpenCode Zen gives you access to all the best coding models at the cheapest prices with a single API + key. + + + Go to https://opencode.ai/zen to get a key + + + ), + "opencode-go": ( + + + OpenCode Go is a $10 per month subscription that provides reliable access to popular open coding models + with generous usage limits. + + + Go to https://opencode.ai/zen and enable OpenCode Go + + + ), + }[props.providerID] ?? undefined } onConfirm={async (value) => { if (!value) return From d848c9b6a32f408e8b9bf6448b83af05629454d0 Mon Sep 17 00:00:00 2001 From: opencode Date: Wed, 25 Feb 2026 07:27:19 +0000 Subject: [PATCH 78/95] release: v1.2.13 --- bun.lock | 30 +++++++++++++------------- packages/app/package.json | 2 +- packages/console/app/package.json | 2 +- packages/console/core/package.json | 2 +- packages/console/function/package.json | 2 +- packages/console/mail/package.json | 2 +- packages/desktop/package.json | 2 +- packages/enterprise/package.json | 2 +- packages/extensions/zed/extension.toml | 12 +++++------ packages/function/package.json | 2 +- packages/opencode/package.json | 2 +- packages/plugin/package.json | 2 +- packages/sdk/js/package.json | 2 +- packages/slack/package.json | 2 +- packages/ui/package.json | 2 +- packages/util/package.json | 2 +- packages/web/package.json | 2 +- sdks/vscode/package.json | 2 +- 18 files changed, 37 insertions(+), 37 deletions(-) diff --git a/bun.lock b/bun.lock index d81245ff7d4f..52bc415a7f31 100644 --- a/bun.lock +++ b/bun.lock @@ -25,7 +25,7 @@ }, "packages/app": { "name": "@opencode-ai/app", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", @@ -75,7 +75,7 @@ }, "packages/console/app": { "name": "@opencode-ai/console-app", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@cloudflare/vite-plugin": "1.15.2", "@ibm/plex": "6.4.1", @@ -109,7 +109,7 @@ }, "packages/console/core": { "name": "@opencode-ai/console-core", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@jsx-email/render": "1.1.1", @@ -136,7 +136,7 @@ }, "packages/console/function": { "name": "@opencode-ai/console-function", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@ai-sdk/anthropic": "2.0.0", "@ai-sdk/openai": "2.0.2", @@ -160,7 +160,7 @@ }, "packages/console/mail": { "name": "@opencode-ai/console-mail", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", @@ -184,7 +184,7 @@ }, "packages/desktop": { "name": "@opencode-ai/desktop", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@opencode-ai/app": "workspace:*", "@opencode-ai/ui": "workspace:*", @@ -217,7 +217,7 @@ }, "packages/enterprise": { "name": "@opencode-ai/enterprise", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@opencode-ai/ui": "workspace:*", "@opencode-ai/util": "workspace:*", @@ -246,7 +246,7 @@ }, "packages/function": { "name": "@opencode-ai/function", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@octokit/auth-app": "8.0.1", "@octokit/rest": "catalog:", @@ -262,7 +262,7 @@ }, "packages/opencode": { "name": "opencode", - "version": "1.2.11", + "version": "1.2.13", "bin": { "opencode": "./bin/opencode", }, @@ -376,7 +376,7 @@ }, "packages/plugin": { "name": "@opencode-ai/plugin", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@opencode-ai/sdk": "workspace:*", "zod": "catalog:", @@ -396,7 +396,7 @@ }, "packages/sdk/js": { "name": "@opencode-ai/sdk", - "version": "1.2.11", + "version": "1.2.13", "devDependencies": { "@hey-api/openapi-ts": "0.90.10", "@tsconfig/node22": "catalog:", @@ -407,7 +407,7 @@ }, "packages/slack": { "name": "@opencode-ai/slack", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@opencode-ai/sdk": "workspace:*", "@slack/bolt": "^3.17.1", @@ -420,7 +420,7 @@ }, "packages/ui": { "name": "@opencode-ai/ui", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", @@ -462,7 +462,7 @@ }, "packages/util": { "name": "@opencode-ai/util", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "zod": "catalog:", }, @@ -473,7 +473,7 @@ }, "packages/web": { "name": "@opencode-ai/web", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", diff --git a/packages/app/package.json b/packages/app/package.json index 360cbbcc01bb..beaeb2a316b6 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/app", - "version": "1.2.11", + "version": "1.2.13", "description": "", "type": "module", "exports": { diff --git a/packages/console/app/package.json b/packages/console/app/package.json index a866785ce081..bfed09c3ebb6 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-app", - "version": "1.2.11", + "version": "1.2.13", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/console/core/package.json b/packages/console/core/package.json index c06964f7d851..5427c906a76d 100644 --- a/packages/console/core/package.json +++ b/packages/console/core/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-core", - "version": "1.2.11", + "version": "1.2.13", "private": true, "type": "module", "license": "MIT", diff --git a/packages/console/function/package.json b/packages/console/function/package.json index 351f78bddcb8..6cd13bf0fcaa 100644 --- a/packages/console/function/package.json +++ b/packages/console/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-function", - "version": "1.2.11", + "version": "1.2.13", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/console/mail/package.json b/packages/console/mail/package.json index f61e7f9ab41d..2dd381581b67 100644 --- a/packages/console/mail/package.json +++ b/packages/console/mail/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-mail", - "version": "1.2.11", + "version": "1.2.13", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", diff --git a/packages/desktop/package.json b/packages/desktop/package.json index fba0730b05e4..6db85fcbddb2 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@opencode-ai/desktop", "private": true, - "version": "1.2.11", + "version": "1.2.13", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/enterprise/package.json b/packages/enterprise/package.json index 229f6b2552a0..9d39fcf9ee5b 100644 --- a/packages/enterprise/package.json +++ b/packages/enterprise/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/enterprise", - "version": "1.2.11", + "version": "1.2.13", "private": true, "type": "module", "license": "MIT", diff --git a/packages/extensions/zed/extension.toml b/packages/extensions/zed/extension.toml index 5e13ecdb6951..6353f7653843 100644 --- a/packages/extensions/zed/extension.toml +++ b/packages/extensions/zed/extension.toml @@ -1,7 +1,7 @@ id = "opencode" name = "OpenCode" description = "The open source coding agent." -version = "1.2.11" +version = "1.2.13" schema_version = 1 authors = ["Anomaly"] repository = "https://github.com/anomalyco/opencode" @@ -11,26 +11,26 @@ name = "OpenCode" icon = "./icons/opencode.svg" [agent_servers.opencode.targets.darwin-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-darwin-arm64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-darwin-arm64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.darwin-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-darwin-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-darwin-x64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-linux-arm64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-linux-arm64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-linux-x64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-linux-x64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.windows-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.11/opencode-windows-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-windows-x64.zip" cmd = "./opencode.exe" args = ["acp"] diff --git a/packages/function/package.json b/packages/function/package.json index 26fc3c0410d0..04969d9827d5 100644 --- a/packages/function/package.json +++ b/packages/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/function", - "version": "1.2.11", + "version": "1.2.13", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/opencode/package.json b/packages/opencode/package.json index 857e912c30e2..0e3594dc7d79 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "1.2.11", + "version": "1.2.13", "name": "opencode", "type": "module", "license": "MIT", diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 97da559e7557..339b87647807 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/plugin", - "version": "1.2.11", + "version": "1.2.13", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json index d2b3c6115901..158683ba4933 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/sdk", - "version": "1.2.11", + "version": "1.2.13", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/slack/package.json b/packages/slack/package.json index 678380474769..e241919b2ca7 100644 --- a/packages/slack/package.json +++ b/packages/slack/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/slack", - "version": "1.2.11", + "version": "1.2.13", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/ui/package.json b/packages/ui/package.json index 505d8bb8c533..7a198d9bae14 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/ui", - "version": "1.2.11", + "version": "1.2.13", "type": "module", "license": "MIT", "exports": { diff --git a/packages/util/package.json b/packages/util/package.json index fbb123591b31..fa89670d9799 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/util", - "version": "1.2.11", + "version": "1.2.13", "private": true, "type": "module", "license": "MIT", diff --git a/packages/web/package.json b/packages/web/package.json index 0b71c07142a7..a8f7decb4576 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -2,7 +2,7 @@ "name": "@opencode-ai/web", "type": "module", "license": "MIT", - "version": "1.2.11", + "version": "1.2.13", "scripts": { "dev": "astro dev", "dev:remote": "VITE_API_URL=https://api.opencode.ai astro dev", diff --git a/sdks/vscode/package.json b/sdks/vscode/package.json index fffd9e149dd9..cfe9d6cedb4c 100644 --- a/sdks/vscode/package.json +++ b/sdks/vscode/package.json @@ -2,7 +2,7 @@ "name": "opencode", "displayName": "opencode", "description": "opencode for VS Code", - "version": "1.2.11", + "version": "1.2.13", "publisher": "sst-dev", "repository": { "type": "git", From 088a81c116f3fda865851292c92754385292b92d Mon Sep 17 00:00:00 2001 From: Ayush Thakur <51413362+Ayushlm10@users.noreply.github.com> Date: Wed, 25 Feb 2026 18:52:52 +0530 Subject: [PATCH 79/95] fix: consume stdout concurrently with process exit in auth login (#15058) --- packages/opencode/src/cli/cmd/auth.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/cli/cmd/auth.ts b/packages/opencode/src/cli/cmd/auth.ts index 4a97a5e0b83c..95635916413a 100644 --- a/packages/opencode/src/cli/cmd/auth.ts +++ b/packages/opencode/src/cli/cmd/auth.ts @@ -268,18 +268,17 @@ export const AuthLoginCommand = cmd({ const proc = Process.spawn(wellknown.auth.command, { stdout: "pipe", }) - const exit = await proc.exited - if (exit !== 0) { + if (!proc.stdout) { prompts.log.error("Failed") prompts.outro("Done") return } - if (!proc.stdout) { + const [exit, token] = await Promise.all([proc.exited, text(proc.stdout)]) + if (exit !== 0) { prompts.log.error("Failed") prompts.outro("Done") return } - const token = await text(proc.stdout) await Auth.set(args.url, { type: "wellknown", key: wellknown.auth.env, From 79b5ce58e9d3ad940330c2fd82784a4d8b7e004d Mon Sep 17 00:00:00 2001 From: Shantur Rathore Date: Wed, 25 Feb 2026 14:25:26 +0000 Subject: [PATCH 80/95] feat(core): add message delete endpoint (#14417) --- .../opencode/src/server/routes/session.ts | 36 +++++++++++++++++ packages/opencode/src/session/index.ts | 8 +++- packages/sdk/js/src/v2/gen/sdk.gen.ts | 38 ++++++++++++++++++ packages/sdk/js/src/v2/gen/types.gen.ts | 40 +++++++++++++++++++ 4 files changed, 120 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/server/routes/session.ts b/packages/opencode/src/server/routes/session.ts index 1195529e06a8..12938aeaba04 100644 --- a/packages/opencode/src/server/routes/session.ts +++ b/packages/opencode/src/server/routes/session.ts @@ -618,6 +618,42 @@ export const SessionRoutes = lazy(() => return c.json(message) }, ) + .delete( + "/:sessionID/message/:messageID", + describeRoute({ + summary: "Delete message", + description: + "Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.", + operationId: "session.deleteMessage", + responses: { + 200: { + description: "Successfully deleted message", + content: { + "application/json": { + schema: resolver(z.boolean()), + }, + }, + }, + ...errors(400, 404), + }, + }), + validator( + "param", + z.object({ + sessionID: z.string().meta({ description: "Session ID" }), + messageID: z.string().meta({ description: "Message ID" }), + }), + ), + async (c) => { + const params = c.req.valid("param") + SessionPrompt.assertNotBusy(params.sessionID) + await Session.removeMessage({ + sessionID: params.sessionID, + messageID: params.messageID, + }) + return c.json(true) + }, + ) .delete( "/:sessionID/message/:messageID/part/:partID", describeRoute({ diff --git a/packages/opencode/src/session/index.ts b/packages/opencode/src/session/index.ts index 8454a9c3e975..22de477f8d18 100644 --- a/packages/opencode/src/session/index.ts +++ b/packages/opencode/src/session/index.ts @@ -697,7 +697,9 @@ export namespace Session { async (input) => { // CASCADE delete handles parts automatically Database.use((db) => { - db.delete(MessageTable).where(eq(MessageTable.id, input.messageID)).run() + db.delete(MessageTable) + .where(and(eq(MessageTable.id, input.messageID), eq(MessageTable.session_id, input.sessionID))) + .run() Database.effect(() => Bus.publish(MessageV2.Event.Removed, { sessionID: input.sessionID, @@ -717,7 +719,9 @@ export namespace Session { }), async (input) => { Database.use((db) => { - db.delete(PartTable).where(eq(PartTable.id, input.partID)).run() + db.delete(PartTable) + .where(and(eq(PartTable.id, input.partID), eq(PartTable.session_id, input.sessionID))) + .run() Database.effect(() => Bus.publish(MessageV2.Event.PartRemoved, { sessionID: input.sessionID, diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index b4848e605404..6165c0f7b096 100644 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts @@ -107,6 +107,8 @@ import type { SessionCreateErrors, SessionCreateResponses, SessionDeleteErrors, + SessionDeleteMessageErrors, + SessionDeleteMessageResponses, SessionDeleteResponses, SessionDiffResponses, SessionForkResponses, @@ -1561,6 +1563,42 @@ export class Session2 extends HeyApiClient { }) } + /** + * Delete message + * + * Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message. + */ + public deleteMessage( + parameters: { + sessionID: string + messageID: string + directory?: string + }, + options?: Options, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "path", key: "sessionID" }, + { in: "path", key: "messageID" }, + { in: "query", key: "directory" }, + ], + }, + ], + ) + return (options?.client ?? this.client).delete< + SessionDeleteMessageResponses, + SessionDeleteMessageErrors, + ThrowOnError + >({ + url: "/session/{sessionID}/message/{messageID}", + ...options, + ...params, + }) + } + /** * Get message * diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index 4050ef15738c..28d5caa02bba 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -3564,6 +3564,46 @@ export type SessionPromptResponses = { export type SessionPromptResponse = SessionPromptResponses[keyof SessionPromptResponses] +export type SessionDeleteMessageData = { + body?: never + path: { + /** + * Session ID + */ + sessionID: string + /** + * Message ID + */ + messageID: string + } + query?: { + directory?: string + } + url: "/session/{sessionID}/message/{messageID}" +} + +export type SessionDeleteMessageErrors = { + /** + * Bad request + */ + 400: BadRequestError + /** + * Not found + */ + 404: NotFoundError +} + +export type SessionDeleteMessageError = SessionDeleteMessageErrors[keyof SessionDeleteMessageErrors] + +export type SessionDeleteMessageResponses = { + /** + * Successfully deleted message + */ + 200: boolean +} + +export type SessionDeleteMessageResponse = SessionDeleteMessageResponses[keyof SessionDeleteMessageResponses] + export type SessionMessageData = { body?: never path: { From de2bc25677b419d2af0da8b6a24a05d3f22b67a8 Mon Sep 17 00:00:00 2001 From: opencode Date: Wed, 25 Feb 2026 14:55:56 +0000 Subject: [PATCH 81/95] release: v1.2.14 --- bun.lock | 30 +++++++++++++------------- packages/app/package.json | 2 +- packages/console/app/package.json | 2 +- packages/console/core/package.json | 2 +- packages/console/function/package.json | 2 +- packages/console/mail/package.json | 2 +- packages/desktop/package.json | 2 +- packages/enterprise/package.json | 2 +- packages/extensions/zed/extension.toml | 12 +++++------ packages/function/package.json | 2 +- packages/opencode/package.json | 2 +- packages/plugin/package.json | 2 +- packages/sdk/js/package.json | 2 +- packages/slack/package.json | 2 +- packages/ui/package.json | 2 +- packages/util/package.json | 2 +- packages/web/package.json | 2 +- sdks/vscode/package.json | 2 +- 18 files changed, 37 insertions(+), 37 deletions(-) diff --git a/bun.lock b/bun.lock index 52bc415a7f31..2bdab5cb6afb 100644 --- a/bun.lock +++ b/bun.lock @@ -25,7 +25,7 @@ }, "packages/app": { "name": "@opencode-ai/app", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", @@ -75,7 +75,7 @@ }, "packages/console/app": { "name": "@opencode-ai/console-app", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@cloudflare/vite-plugin": "1.15.2", "@ibm/plex": "6.4.1", @@ -109,7 +109,7 @@ }, "packages/console/core": { "name": "@opencode-ai/console-core", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@jsx-email/render": "1.1.1", @@ -136,7 +136,7 @@ }, "packages/console/function": { "name": "@opencode-ai/console-function", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@ai-sdk/anthropic": "2.0.0", "@ai-sdk/openai": "2.0.2", @@ -160,7 +160,7 @@ }, "packages/console/mail": { "name": "@opencode-ai/console-mail", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", @@ -184,7 +184,7 @@ }, "packages/desktop": { "name": "@opencode-ai/desktop", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@opencode-ai/app": "workspace:*", "@opencode-ai/ui": "workspace:*", @@ -217,7 +217,7 @@ }, "packages/enterprise": { "name": "@opencode-ai/enterprise", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@opencode-ai/ui": "workspace:*", "@opencode-ai/util": "workspace:*", @@ -246,7 +246,7 @@ }, "packages/function": { "name": "@opencode-ai/function", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@octokit/auth-app": "8.0.1", "@octokit/rest": "catalog:", @@ -262,7 +262,7 @@ }, "packages/opencode": { "name": "opencode", - "version": "1.2.13", + "version": "1.2.14", "bin": { "opencode": "./bin/opencode", }, @@ -376,7 +376,7 @@ }, "packages/plugin": { "name": "@opencode-ai/plugin", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@opencode-ai/sdk": "workspace:*", "zod": "catalog:", @@ -396,7 +396,7 @@ }, "packages/sdk/js": { "name": "@opencode-ai/sdk", - "version": "1.2.13", + "version": "1.2.14", "devDependencies": { "@hey-api/openapi-ts": "0.90.10", "@tsconfig/node22": "catalog:", @@ -407,7 +407,7 @@ }, "packages/slack": { "name": "@opencode-ai/slack", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@opencode-ai/sdk": "workspace:*", "@slack/bolt": "^3.17.1", @@ -420,7 +420,7 @@ }, "packages/ui": { "name": "@opencode-ai/ui", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", @@ -462,7 +462,7 @@ }, "packages/util": { "name": "@opencode-ai/util", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "zod": "catalog:", }, @@ -473,7 +473,7 @@ }, "packages/web": { "name": "@opencode-ai/web", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", diff --git a/packages/app/package.json b/packages/app/package.json index beaeb2a316b6..37d2801baf78 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/app", - "version": "1.2.13", + "version": "1.2.14", "description": "", "type": "module", "exports": { diff --git a/packages/console/app/package.json b/packages/console/app/package.json index bfed09c3ebb6..adf2d2d28dad 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-app", - "version": "1.2.13", + "version": "1.2.14", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/console/core/package.json b/packages/console/core/package.json index 5427c906a76d..078d662072da 100644 --- a/packages/console/core/package.json +++ b/packages/console/core/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-core", - "version": "1.2.13", + "version": "1.2.14", "private": true, "type": "module", "license": "MIT", diff --git a/packages/console/function/package.json b/packages/console/function/package.json index 6cd13bf0fcaa..ac1c6bfd89a3 100644 --- a/packages/console/function/package.json +++ b/packages/console/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-function", - "version": "1.2.13", + "version": "1.2.14", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/console/mail/package.json b/packages/console/mail/package.json index 2dd381581b67..1b91c7cbe01f 100644 --- a/packages/console/mail/package.json +++ b/packages/console/mail/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-mail", - "version": "1.2.13", + "version": "1.2.14", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 6db85fcbddb2..2bd9cce9a35e 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,7 +1,7 @@ { "name": "@opencode-ai/desktop", "private": true, - "version": "1.2.13", + "version": "1.2.14", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/enterprise/package.json b/packages/enterprise/package.json index 9d39fcf9ee5b..0cd3ec690831 100644 --- a/packages/enterprise/package.json +++ b/packages/enterprise/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/enterprise", - "version": "1.2.13", + "version": "1.2.14", "private": true, "type": "module", "license": "MIT", diff --git a/packages/extensions/zed/extension.toml b/packages/extensions/zed/extension.toml index 6353f7653843..436b2e9e191f 100644 --- a/packages/extensions/zed/extension.toml +++ b/packages/extensions/zed/extension.toml @@ -1,7 +1,7 @@ id = "opencode" name = "OpenCode" description = "The open source coding agent." -version = "1.2.13" +version = "1.2.14" schema_version = 1 authors = ["Anomaly"] repository = "https://github.com/anomalyco/opencode" @@ -11,26 +11,26 @@ name = "OpenCode" icon = "./icons/opencode.svg" [agent_servers.opencode.targets.darwin-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-darwin-arm64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.14/opencode-darwin-arm64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.darwin-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-darwin-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.14/opencode-darwin-x64.zip" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-aarch64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-linux-arm64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.14/opencode-linux-arm64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.linux-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-linux-x64.tar.gz" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.14/opencode-linux-x64.tar.gz" cmd = "./opencode" args = ["acp"] [agent_servers.opencode.targets.windows-x86_64] -archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.13/opencode-windows-x64.zip" +archive = "https://github.com/anomalyco/opencode/releases/download/v1.2.14/opencode-windows-x64.zip" cmd = "./opencode.exe" args = ["acp"] diff --git a/packages/function/package.json b/packages/function/package.json index 04969d9827d5..7a68ef5b9d29 100644 --- a/packages/function/package.json +++ b/packages/function/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/function", - "version": "1.2.13", + "version": "1.2.14", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/opencode/package.json b/packages/opencode/package.json index 0e3594dc7d79..e23d2e41ad3e 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "version": "1.2.13", + "version": "1.2.14", "name": "opencode", "type": "module", "license": "MIT", diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 339b87647807..c4ed60455abe 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/plugin", - "version": "1.2.13", + "version": "1.2.14", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json index 158683ba4933..3faee471736b 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/sdk", - "version": "1.2.13", + "version": "1.2.14", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/slack/package.json b/packages/slack/package.json index e241919b2ca7..c61ff7521b34 100644 --- a/packages/slack/package.json +++ b/packages/slack/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/slack", - "version": "1.2.13", + "version": "1.2.14", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/ui/package.json b/packages/ui/package.json index 7a198d9bae14..08f46d633bc7 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/ui", - "version": "1.2.13", + "version": "1.2.14", "type": "module", "license": "MIT", "exports": { diff --git a/packages/util/package.json b/packages/util/package.json index fa89670d9799..d389d3ade1b2 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/util", - "version": "1.2.13", + "version": "1.2.14", "private": true, "type": "module", "license": "MIT", diff --git a/packages/web/package.json b/packages/web/package.json index a8f7decb4576..12bffe86d6b3 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -2,7 +2,7 @@ "name": "@opencode-ai/web", "type": "module", "license": "MIT", - "version": "1.2.13", + "version": "1.2.14", "scripts": { "dev": "astro dev", "dev:remote": "VITE_API_URL=https://api.opencode.ai astro dev", diff --git a/sdks/vscode/package.json b/sdks/vscode/package.json index cfe9d6cedb4c..a661b25d80f0 100644 --- a/sdks/vscode/package.json +++ b/sdks/vscode/package.json @@ -2,7 +2,7 @@ "name": "opencode", "displayName": "opencode", "description": "opencode for VS Code", - "version": "1.2.13", + "version": "1.2.14", "publisher": "sst-dev", "repository": { "type": "git", From 5e5823ed85ff83e1e3461b861fb582f27cc38969 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Wed, 25 Feb 2026 14:26:38 +0000 Subject: [PATCH 82/95] chore: generate --- packages/sdk/openapi.json | 70 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json index 2741c2362ec4..80a4a8d72ae0 100644 --- a/packages/sdk/openapi.json +++ b/packages/sdk/openapi.json @@ -2630,6 +2630,76 @@ "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.message({\n ...\n})" } ] + }, + "delete": { + "operationId": "session.deleteMessage", + "parameters": [ + { + "in": "query", + "name": "directory", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "sessionID", + "schema": { + "type": "string" + }, + "required": true, + "description": "Session ID" + }, + { + "in": "path", + "name": "messageID", + "schema": { + "type": "string" + }, + "required": true, + "description": "Message ID" + } + ], + "summary": "Delete message", + "description": "Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.", + "responses": { + "200": { + "description": "Successfully deleted message", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "js", + "source": "import { createOpencodeClient } from \"@opencode-ai/sdk\n\nconst client = createOpencodeClient()\nawait client.session.deleteMessage({\n ...\n})" + } + ] } }, "/session/{sessionID}/message/{messageID}/part/{partID}": { From e48c1ccf0714a2a78a8bbf27e8ade0b8bcbdcf3b Mon Sep 17 00:00:00 2001 From: Ryan Vogel Date: Wed, 25 Feb 2026 09:42:52 -0500 Subject: [PATCH 83/95] chore(workflows): label vouched users and restrict vouch managers (#15075) --- .github/workflows/vouch-check-issue.yml | 58 ++++++++++++++------- .github/workflows/vouch-check-pr.yml | 55 +++++++++++++------ .github/workflows/vouch-manage-by-issue.yml | 1 + 3 files changed, 78 insertions(+), 36 deletions(-) diff --git a/.github/workflows/vouch-check-issue.yml b/.github/workflows/vouch-check-issue.yml index 94569f47312a..4c2aa960b2a8 100644 --- a/.github/workflows/vouch-check-issue.yml +++ b/.github/workflows/vouch-check-issue.yml @@ -42,15 +42,17 @@ jobs: throw error; } - // Parse the .td file for denounced users + // Parse the .td file for vouched and denounced users + const vouched = new Set(); const denounced = new Map(); for (const line of content.split('\n')) { const trimmed = line.trim(); if (!trimmed || trimmed.startsWith('#')) continue; - if (!trimmed.startsWith('-')) continue; - const rest = trimmed.slice(1).trim(); + const isDenounced = trimmed.startsWith('-'); + const rest = isDenounced ? trimmed.slice(1).trim() : trimmed; if (!rest) continue; + const spaceIdx = rest.indexOf(' '); const handle = spaceIdx === -1 ? rest : rest.slice(0, spaceIdx); const reason = spaceIdx === -1 ? null : rest.slice(spaceIdx + 1).trim(); @@ -65,32 +67,50 @@ jobs: const username = colonIdx === -1 ? handle : handle.slice(colonIdx + 1); if (!username) continue; - denounced.set(username.toLowerCase(), reason); + if (isDenounced) { + denounced.set(username.toLowerCase(), reason); + continue; + } + + vouched.add(username.toLowerCase()); } // Check if the author is denounced const reason = denounced.get(author.toLowerCase()); - if (reason === undefined) { - core.info(`User ${author} is not denounced. Allowing issue.`); + if (reason !== undefined) { + // Author is denounced — close the issue + const body = 'This issue has been automatically closed.'; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + body, + }); + + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + state: 'closed', + state_reason: 'not_planned', + }); + + core.info(`Closed issue #${issueNumber} from denounced user ${author}`); return; } - // Author is denounced — close the issue - const body = 'This issue has been automatically closed.'; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issueNumber, - body, - }); + // Author is positively vouched — add label + if (!vouched.has(author.toLowerCase())) { + core.info(`User ${author} is not denounced or vouched. Allowing issue.`); + return; + } - await github.rest.issues.update({ + await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issueNumber, - state: 'closed', - state_reason: 'not_planned', + labels: ['Vouched'], }); - core.info(`Closed issue #${issueNumber} from denounced user ${author}`); + core.info(`Added vouched label to issue #${issueNumber} from ${author}`); diff --git a/.github/workflows/vouch-check-pr.yml b/.github/workflows/vouch-check-pr.yml index 470b8e0a5ad7..51816dfb7590 100644 --- a/.github/workflows/vouch-check-pr.yml +++ b/.github/workflows/vouch-check-pr.yml @@ -6,6 +6,7 @@ on: permissions: contents: read + issues: write pull-requests: write jobs: @@ -42,15 +43,17 @@ jobs: throw error; } - // Parse the .td file for denounced users + // Parse the .td file for vouched and denounced users + const vouched = new Set(); const denounced = new Map(); for (const line of content.split('\n')) { const trimmed = line.trim(); if (!trimmed || trimmed.startsWith('#')) continue; - if (!trimmed.startsWith('-')) continue; - const rest = trimmed.slice(1).trim(); + const isDenounced = trimmed.startsWith('-'); + const rest = isDenounced ? trimmed.slice(1).trim() : trimmed; if (!rest) continue; + const spaceIdx = rest.indexOf(' '); const handle = spaceIdx === -1 ? rest : rest.slice(0, spaceIdx); const reason = spaceIdx === -1 ? null : rest.slice(spaceIdx + 1).trim(); @@ -65,29 +68,47 @@ jobs: const username = colonIdx === -1 ? handle : handle.slice(colonIdx + 1); if (!username) continue; - denounced.set(username.toLowerCase(), reason); + if (isDenounced) { + denounced.set(username.toLowerCase(), reason); + continue; + } + + vouched.add(username.toLowerCase()); } // Check if the author is denounced const reason = denounced.get(author.toLowerCase()); - if (reason === undefined) { - core.info(`User ${author} is not denounced. Allowing PR.`); + if (reason !== undefined) { + // Author is denounced — close the PR + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + body: 'This pull request has been automatically closed.', + }); + + await github.rest.pulls.update({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: prNumber, + state: 'closed', + }); + + core.info(`Closed PR #${prNumber} from denounced user ${author}`); return; } - // Author is denounced — close the PR - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - body: 'This pull request has been automatically closed.', - }); + // Author is positively vouched — add label + if (!vouched.has(author.toLowerCase())) { + core.info(`User ${author} is not denounced or vouched. Allowing PR.`); + return; + } - await github.rest.pulls.update({ + await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, - pull_number: prNumber, - state: 'closed', + issue_number: prNumber, + labels: ['Vouched'], }); - core.info(`Closed PR #${prNumber} from denounced user ${author}`); + core.info(`Added vouched label to PR #${prNumber} from ${author}`); diff --git a/.github/workflows/vouch-manage-by-issue.yml b/.github/workflows/vouch-manage-by-issue.yml index cf0524c21a8e..9604bf87f375 100644 --- a/.github/workflows/vouch-manage-by-issue.yml +++ b/.github/workflows/vouch-manage-by-issue.yml @@ -33,5 +33,6 @@ jobs: with: issue-id: ${{ github.event.issue.number }} comment-id: ${{ github.event.comment.id }} + roles: admin,maintain env: GITHUB_TOKEN: ${{ steps.committer.outputs.token }} From 286992269623bcb410f0de89e128ff14361d5e97 Mon Sep 17 00:00:00 2001 From: Oleksii Pavliuk <71220725+Oleksii-Pavliuk@users.noreply.github.com> Date: Thu, 26 Feb 2026 01:54:15 +1100 Subject: [PATCH 84/95] fix(app): correct Copilot provider description in i18n files (#15071) --- packages/app/src/i18n/bs.ts | 2 +- packages/app/src/i18n/da.ts | 2 +- packages/app/src/i18n/en.ts | 2 +- packages/app/src/i18n/es.ts | 2 +- packages/app/src/i18n/no.ts | 2 +- packages/app/src/i18n/pl.ts | 2 +- packages/app/src/i18n/ru.ts | 2 +- packages/app/src/i18n/th.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/app/src/i18n/bs.ts b/packages/app/src/i18n/bs.ts index d658926268e2..cb0274042ed0 100644 --- a/packages/app/src/i18n/bs.ts +++ b/packages/app/src/i18n/bs.ts @@ -100,7 +100,7 @@ export const dict = { "dialog.provider.tag.recommended": "Preporučeno", "dialog.provider.opencode.note": "Kurirani modeli uključujući Claude, GPT, Gemini i druge", "dialog.provider.anthropic.note": "Direktan pristup Claude modelima, uključujući Pro i Max", - "dialog.provider.copilot.note": "Claude modeli za pomoć pri kodiranju", + "dialog.provider.copilot.note": "AI modeli za pomoć pri kodiranju putem GitHub Copilot", "dialog.provider.openai.note": "GPT modeli za brze, sposobne opšte AI zadatke", "dialog.provider.google.note": "Gemini modeli za brze, strukturirane odgovore", "dialog.provider.openrouter.note": "Pristup svim podržanim modelima preko jednog provajdera", diff --git a/packages/app/src/i18n/da.ts b/packages/app/src/i18n/da.ts index fabefcab7562..30cc555eb1a0 100644 --- a/packages/app/src/i18n/da.ts +++ b/packages/app/src/i18n/da.ts @@ -100,7 +100,7 @@ export const dict = { "dialog.provider.tag.recommended": "Anbefalet", "dialog.provider.opencode.note": "Udvalgte modeller inklusive Claude, GPT, Gemini og flere", "dialog.provider.anthropic.note": "Direkte adgang til Claude-modeller, inklusive Pro og Max", - "dialog.provider.copilot.note": "Claude-modeller til kodningsassistance", + "dialog.provider.copilot.note": "AI-modeller til kodningsassistance via GitHub Copilot", "dialog.provider.openai.note": "GPT-modeller til hurtige, kompetente generelle AI-opgaver", "dialog.provider.google.note": "Gemini-modeller til hurtige, strukturerede svar", "dialog.provider.openrouter.note": "Få adgang til alle understøttede modeller fra én udbyder", diff --git a/packages/app/src/i18n/en.ts b/packages/app/src/i18n/en.ts index 992509fcfa4e..0b4388ceb19a 100644 --- a/packages/app/src/i18n/en.ts +++ b/packages/app/src/i18n/en.ts @@ -100,7 +100,7 @@ export const dict = { "dialog.provider.tag.recommended": "Recommended", "dialog.provider.opencode.note": "Curated models including Claude, GPT, Gemini and more", "dialog.provider.anthropic.note": "Direct access to Claude models, including Pro and Max", - "dialog.provider.copilot.note": "Claude models for coding assistance", + "dialog.provider.copilot.note": "AI models for coding assistance via GitHub Copilot", "dialog.provider.openai.note": "GPT models for fast, capable general AI tasks", "dialog.provider.google.note": "Gemini models for fast, structured responses", "dialog.provider.openrouter.note": "Access all supported models from one provider", diff --git a/packages/app/src/i18n/es.ts b/packages/app/src/i18n/es.ts index b55d54c0ca55..3566226d7bfd 100644 --- a/packages/app/src/i18n/es.ts +++ b/packages/app/src/i18n/es.ts @@ -100,7 +100,7 @@ export const dict = { "dialog.provider.tag.recommended": "Recomendado", "dialog.provider.opencode.note": "Modelos seleccionados incluyendo Claude, GPT, Gemini y más", "dialog.provider.anthropic.note": "Acceso directo a modelos Claude, incluyendo Pro y Max", - "dialog.provider.copilot.note": "Modelos Claude para asistencia de codificación", + "dialog.provider.copilot.note": "Modelos de IA para asistencia de codificación a través de GitHub Copilot", "dialog.provider.openai.note": "Modelos GPT para tareas de IA generales rápidas y capaces", "dialog.provider.google.note": "Modelos Gemini para respuestas rápidas y estructuradas", "dialog.provider.openrouter.note": "Accede a todos los modelos soportados desde un solo proveedor", diff --git a/packages/app/src/i18n/no.ts b/packages/app/src/i18n/no.ts index 8e1b1ce629dc..3fbe75716d0c 100644 --- a/packages/app/src/i18n/no.ts +++ b/packages/app/src/i18n/no.ts @@ -103,7 +103,7 @@ export const dict = { "dialog.provider.tag.recommended": "Anbefalt", "dialog.provider.opencode.note": "Utvalgte modeller inkludert Claude, GPT, Gemini og mer", "dialog.provider.anthropic.note": "Direkte tilgang til Claude-modeller, inkludert Pro og Max", - "dialog.provider.copilot.note": "Claude-modeller for kodeassistanse", + "dialog.provider.copilot.note": "AI-modeller for kodeassistanse via GitHub Copilot", "dialog.provider.openai.note": "GPT-modeller for raske, dyktige generelle AI-oppgaver", "dialog.provider.google.note": "Gemini-modeller for raske, strukturerte svar", "dialog.provider.openrouter.note": "Tilgang til alle støttede modeller fra én leverandør", diff --git a/packages/app/src/i18n/pl.ts b/packages/app/src/i18n/pl.ts index 9b924fd642ea..d8ae150d7cb5 100644 --- a/packages/app/src/i18n/pl.ts +++ b/packages/app/src/i18n/pl.ts @@ -92,7 +92,7 @@ export const dict = { "dialog.provider.tag.recommended": "Zalecane", "dialog.provider.opencode.note": "Wyselekcjonowane modele, w tym Claude, GPT, Gemini i inne", "dialog.provider.anthropic.note": "Bezpośredni dostęp do modeli Claude, w tym Pro i Max", - "dialog.provider.copilot.note": "Modele Claude do pomocy w kodowaniu", + "dialog.provider.copilot.note": "Modele AI do pomocy w kodowaniu przez GitHub Copilot", "dialog.provider.openai.note": "Modele GPT do szybkich i wszechstronnych zadań AI", "dialog.provider.google.note": "Modele Gemini do szybkich i ustrukturyzowanych odpowiedzi", "dialog.provider.openrouter.note": "Dostęp do wszystkich obsługiwanych modeli od jednego dostawcy", diff --git a/packages/app/src/i18n/ru.ts b/packages/app/src/i18n/ru.ts index cf02285821e4..a7d328924a41 100644 --- a/packages/app/src/i18n/ru.ts +++ b/packages/app/src/i18n/ru.ts @@ -100,7 +100,7 @@ export const dict = { "dialog.provider.tag.recommended": "Рекомендуемые", "dialog.provider.opencode.note": "Отобранные модели, включая Claude, GPT, Gemini и другие", "dialog.provider.anthropic.note": "Прямой доступ к моделям Claude, включая Pro и Max", - "dialog.provider.copilot.note": "Модели Claude для помощи в кодировании", + "dialog.provider.copilot.note": "ИИ-модели для помощи в кодировании через GitHub Copilot", "dialog.provider.openai.note": "Модели GPT для быстрых и мощных задач общего ИИ", "dialog.provider.google.note": "Модели Gemini для быстрых и структурированных ответов", "dialog.provider.openrouter.note": "Доступ ко всем поддерживаемым моделям через одного провайдера", diff --git a/packages/app/src/i18n/th.ts b/packages/app/src/i18n/th.ts index 1b8abe953b77..1e9773bf021c 100644 --- a/packages/app/src/i18n/th.ts +++ b/packages/app/src/i18n/th.ts @@ -100,7 +100,7 @@ export const dict = { "dialog.provider.tag.recommended": "แนะนำ", "dialog.provider.opencode.note": "โมเดลที่คัดสรร รวมถึง Claude, GPT, Gemini และอื่น ๆ", "dialog.provider.anthropic.note": "เข้าถึงโมเดล Claude โดยตรง รวมถึง Pro และ Max", - "dialog.provider.copilot.note": "โมเดล Claude สำหรับการช่วยเหลือในการเขียนโค้ด", + "dialog.provider.copilot.note": "โมเดล AI สำหรับการช่วยเหลือในการเขียนโค้ดผ่าน GitHub Copilot", "dialog.provider.openai.note": "โมเดล GPT สำหรับงาน AI ทั่วไปที่รวดเร็วและมีความสามารถ", "dialog.provider.google.note": "โมเดล Gemini สำหรับการตอบสนองที่รวดเร็วและมีโครงสร้าง", "dialog.provider.openrouter.note": "เข้าถึงโมเดลที่รองรับทั้งหมดจากผู้ให้บริการเดียว", From 45191ad144f6546c051fb3a94f9f3cb1e2c00ed3 Mon Sep 17 00:00:00 2001 From: Filip <34747899+neriousy@users.noreply.github.com> Date: Wed, 25 Feb 2026 15:57:13 +0100 Subject: [PATCH 85/95] fix(app): keyboard navigation previous/next message (#15047) --- packages/app/src/pages/session.tsx | 11 ++++++----- packages/app/src/pages/session/message-timeline.tsx | 1 + .../app/src/pages/session/use-session-hash-scroll.ts | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/app/src/pages/session.tsx b/packages/app/src/pages/session.tsx index e0ef92682d94..2e440a6b036c 100644 --- a/packages/app/src/pages/session.tsx +++ b/packages/app/src/pages/session.tsx @@ -254,12 +254,13 @@ export default function Page() { const msgs = visibleUserMessages() if (msgs.length === 0) return - const current = activeMessage() - const currentIndex = current ? msgs.findIndex((m) => m.id === current.id) : -1 - const targetIndex = currentIndex === -1 ? (offset > 0 ? 0 : msgs.length - 1) : currentIndex + offset - if (targetIndex < 0 || targetIndex >= msgs.length) return + const current = store.messageId + const base = current ? msgs.findIndex((m) => m.id === current) : msgs.length + const currentIndex = base === -1 ? msgs.length : base + const targetIndex = currentIndex + offset + if (targetIndex < 0 || targetIndex > msgs.length) return - if (targetIndex === msgs.length - 1) { + if (targetIndex === msgs.length) { resumeScroll() return } diff --git a/packages/app/src/pages/session/message-timeline.tsx b/packages/app/src/pages/session/message-timeline.tsx index 615d1a0bea4d..b84109035507 100644 --- a/packages/app/src/pages/session/message-timeline.tsx +++ b/packages/app/src/pages/session/message-timeline.tsx @@ -376,6 +376,7 @@ export function MessageTimeline(props: { >
Date: Fri, 20 Feb 2026 01:46:21 +0000 Subject: [PATCH 86/95] tweak(ui): keep reasoning inline code subdued in dark mode --- packages/ui/src/components/message-part.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/ui/src/components/message-part.css b/packages/ui/src/components/message-part.css index ce76d8e18877..f063076e079b 100644 --- a/packages/ui/src/components/message-part.css +++ b/packages/ui/src/components/message-part.css @@ -252,6 +252,12 @@ } } +@media (prefers-color-scheme: dark) { + [data-component="reasoning-part"] [data-component="markdown"] :not(pre) > code { + opacity: 0.6; + } +} + [data-component="tool-error"] { display: flex; align-items: start; From b368181ac90b0365af535b3d0bd8284c2032240c Mon Sep 17 00:00:00 2001 From: adamelmore <2363879+adamdottv@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:29:02 -0600 Subject: [PATCH 87/95] chore: move glossary --- .github/workflows/docs-locale-sync.yml | 8 ++++---- .opencode/agent/translator.md | 2 +- .opencode/{agent => }/glossary/README.md | 0 .opencode/{agent => }/glossary/ar.md | 0 .opencode/{agent => }/glossary/br.md | 0 .opencode/{agent => }/glossary/bs.md | 0 .opencode/{agent => }/glossary/da.md | 0 .opencode/{agent => }/glossary/de.md | 0 .opencode/{agent => }/glossary/es.md | 0 .opencode/{agent => }/glossary/fr.md | 0 .opencode/{agent => }/glossary/ja.md | 0 .opencode/{agent => }/glossary/ko.md | 0 .opencode/{agent => }/glossary/no.md | 0 .opencode/{agent => }/glossary/pl.md | 0 .opencode/{agent => }/glossary/ru.md | 0 .opencode/{agent => }/glossary/th.md | 0 .opencode/{agent => }/glossary/zh-cn.md | 0 .opencode/{agent => }/glossary/zh-tw.md | 0 18 files changed, 5 insertions(+), 5 deletions(-) rename .opencode/{agent => }/glossary/README.md (100%) rename .opencode/{agent => }/glossary/ar.md (100%) rename .opencode/{agent => }/glossary/br.md (100%) rename .opencode/{agent => }/glossary/bs.md (100%) rename .opencode/{agent => }/glossary/da.md (100%) rename .opencode/{agent => }/glossary/de.md (100%) rename .opencode/{agent => }/glossary/es.md (100%) rename .opencode/{agent => }/glossary/fr.md (100%) rename .opencode/{agent => }/glossary/ja.md (100%) rename .opencode/{agent => }/glossary/ko.md (100%) rename .opencode/{agent => }/glossary/no.md (100%) rename .opencode/{agent => }/glossary/pl.md (100%) rename .opencode/{agent => }/glossary/ru.md (100%) rename .opencode/{agent => }/glossary/th.md (100%) rename .opencode/{agent => }/glossary/zh-cn.md (100%) rename .opencode/{agent => }/glossary/zh-tw.md (100%) diff --git a/.github/workflows/docs-locale-sync.yml b/.github/workflows/docs-locale-sync.yml index 1aafc5d1e3b1..f62afae4b9f1 100644 --- a/.github/workflows/docs-locale-sync.yml +++ b/.github/workflows/docs-locale-sync.yml @@ -65,9 +65,9 @@ jobs: "packages/web/src/content/docs/*/*.mdx": "allow", ".opencode": "allow", ".opencode/agent": "allow", - ".opencode/agent/glossary": "allow", + ".opencode/glossary": "allow", ".opencode/agent/translator.md": "allow", - ".opencode/agent/glossary/*.md": "allow" + ".opencode/glossary/*.md": "allow" }, "edit": { "*": "deny", @@ -76,7 +76,7 @@ jobs: "glob": { "*": "deny", "packages/web/src/content/docs*": "allow", - ".opencode/agent/glossary*": "allow" + ".opencode/glossary*": "allow" }, "task": { "*": "deny", @@ -90,7 +90,7 @@ jobs: "read": { "*": "deny", ".opencode/agent/translator.md": "allow", - ".opencode/agent/glossary/*.md": "allow" + ".opencode/glossary/*.md": "allow" } } } diff --git a/.opencode/agent/translator.md b/.opencode/agent/translator.md index f0b3f8e9270b..6ef6d0847a37 100644 --- a/.opencode/agent/translator.md +++ b/.opencode/agent/translator.md @@ -13,7 +13,7 @@ Requirements: - Preserve meaning, intent, tone, and formatting (including Markdown/MDX structure). - Preserve all technical terms and artifacts exactly: product/company names, API names, identifiers, code, commands/flags, file paths, URLs, versions, error messages, config keys/values, and anything inside inline code or code blocks. - Also preserve every term listed in the Do-Not-Translate glossary below. -- Also apply locale-specific guidance from `.opencode/agent/glossary/.md` when available (for example, `zh-cn.md`). +- Also apply locale-specific guidance from `.opencode/glossary/.md` when available (for example, `zh-cn.md`). - Do not modify fenced code blocks. - Output ONLY the translation (no commentary). diff --git a/.opencode/agent/glossary/README.md b/.opencode/glossary/README.md similarity index 100% rename from .opencode/agent/glossary/README.md rename to .opencode/glossary/README.md diff --git a/.opencode/agent/glossary/ar.md b/.opencode/glossary/ar.md similarity index 100% rename from .opencode/agent/glossary/ar.md rename to .opencode/glossary/ar.md diff --git a/.opencode/agent/glossary/br.md b/.opencode/glossary/br.md similarity index 100% rename from .opencode/agent/glossary/br.md rename to .opencode/glossary/br.md diff --git a/.opencode/agent/glossary/bs.md b/.opencode/glossary/bs.md similarity index 100% rename from .opencode/agent/glossary/bs.md rename to .opencode/glossary/bs.md diff --git a/.opencode/agent/glossary/da.md b/.opencode/glossary/da.md similarity index 100% rename from .opencode/agent/glossary/da.md rename to .opencode/glossary/da.md diff --git a/.opencode/agent/glossary/de.md b/.opencode/glossary/de.md similarity index 100% rename from .opencode/agent/glossary/de.md rename to .opencode/glossary/de.md diff --git a/.opencode/agent/glossary/es.md b/.opencode/glossary/es.md similarity index 100% rename from .opencode/agent/glossary/es.md rename to .opencode/glossary/es.md diff --git a/.opencode/agent/glossary/fr.md b/.opencode/glossary/fr.md similarity index 100% rename from .opencode/agent/glossary/fr.md rename to .opencode/glossary/fr.md diff --git a/.opencode/agent/glossary/ja.md b/.opencode/glossary/ja.md similarity index 100% rename from .opencode/agent/glossary/ja.md rename to .opencode/glossary/ja.md diff --git a/.opencode/agent/glossary/ko.md b/.opencode/glossary/ko.md similarity index 100% rename from .opencode/agent/glossary/ko.md rename to .opencode/glossary/ko.md diff --git a/.opencode/agent/glossary/no.md b/.opencode/glossary/no.md similarity index 100% rename from .opencode/agent/glossary/no.md rename to .opencode/glossary/no.md diff --git a/.opencode/agent/glossary/pl.md b/.opencode/glossary/pl.md similarity index 100% rename from .opencode/agent/glossary/pl.md rename to .opencode/glossary/pl.md diff --git a/.opencode/agent/glossary/ru.md b/.opencode/glossary/ru.md similarity index 100% rename from .opencode/agent/glossary/ru.md rename to .opencode/glossary/ru.md diff --git a/.opencode/agent/glossary/th.md b/.opencode/glossary/th.md similarity index 100% rename from .opencode/agent/glossary/th.md rename to .opencode/glossary/th.md diff --git a/.opencode/agent/glossary/zh-cn.md b/.opencode/glossary/zh-cn.md similarity index 100% rename from .opencode/agent/glossary/zh-cn.md rename to .opencode/glossary/zh-cn.md diff --git a/.opencode/agent/glossary/zh-tw.md b/.opencode/glossary/zh-tw.md similarity index 100% rename from .opencode/agent/glossary/zh-tw.md rename to .opencode/glossary/zh-tw.md From 1172fa418e9aa5e0fcfccea326c6c9d35e1d57fd Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 25 Feb 2026 12:39:48 -0500 Subject: [PATCH 88/95] wip: zen go --- infra/console.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/console.ts b/infra/console.ts index 283fe2c37cad..de72cb072eed 100644 --- a/infra/console.ts +++ b/infra/console.ts @@ -101,7 +101,7 @@ export const stripeWebhook = new stripe.WebhookEndpoint("StripeWebhookEndpoint", }) const zenLiteProduct = new stripe.Product("ZenLite", { - name: "OpenCode Lite", + name: "OpenCode Go", }) const zenLitePrice = new stripe.Price("ZenLitePrice", { product: zenLiteProduct.id, From 9d29d692c6d93322f5894cca4232d80106e7c81a Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 25 Feb 2026 23:53:09 +0100 Subject: [PATCH 89/95] split tui/server config (#13968) --- packages/console/app/package.json | 2 +- packages/opencode/script/schema.ts | 90 ++-- packages/opencode/src/cli/cmd/tui/app.tsx | 63 ++- packages/opencode/src/cli/cmd/tui/attach.ts | 8 + .../cli/cmd/tui/component/dialog-command.tsx | 5 +- .../src/cli/cmd/tui/component/tips.tsx | 8 +- .../src/cli/cmd/tui/context/keybind.tsx | 16 +- .../src/cli/cmd/tui/context/theme.tsx | 8 +- .../src/cli/cmd/tui/context/tui-config.tsx | 9 + .../src/cli/cmd/tui/routes/session/index.tsx | 10 +- .../cli/cmd/tui/routes/session/permission.tsx | 5 +- packages/opencode/src/cli/cmd/tui/thread.ts | 8 + packages/opencode/src/config/config.ts | 182 ++----- .../opencode/src/config/migrate-tui-config.ts | 155 ++++++ packages/opencode/src/config/paths.ts | 174 ++++++ packages/opencode/src/config/tui-schema.ts | 34 ++ packages/opencode/src/config/tui.ts | 118 ++++ packages/opencode/src/flag/flag.ts | 12 + packages/opencode/test/config/config.test.ts | 54 +- packages/opencode/test/config/tui.test.ts | 510 ++++++++++++++++++ packages/sdk/js/src/v2/gen/types.gen.ts | 409 -------------- packages/web/astro.config.mjs | 2 +- packages/web/src/content/docs/cli.mdx | 1 + packages/web/src/content/docs/config.mdx | 57 +- packages/web/src/content/docs/keybinds.mdx | 12 +- packages/web/src/content/docs/themes.mdx | 6 +- packages/web/src/content/docs/tui.mdx | 32 +- 27 files changed, 1284 insertions(+), 706 deletions(-) create mode 100644 packages/opencode/src/cli/cmd/tui/context/tui-config.tsx create mode 100644 packages/opencode/src/config/migrate-tui-config.ts create mode 100644 packages/opencode/src/config/paths.ts create mode 100644 packages/opencode/src/config/tui-schema.ts create mode 100644 packages/opencode/src/config/tui.ts create mode 100644 packages/opencode/test/config/tui.test.ts diff --git a/packages/console/app/package.json b/packages/console/app/package.json index adf2d2d28dad..05d2309a423d 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -7,7 +7,7 @@ "typecheck": "tsgo --noEmit", "dev": "vite dev --host 0.0.0.0", "dev:remote": "VITE_AUTH_URL=https://auth.dev.opencode.ai VITE_STRIPE_PUBLISHABLE_KEY=pk_test_51RtuLNE7fOCwHSD4mewwzFejyytjdGoSDK7CAvhbffwaZnPbNb2rwJICw6LTOXCmWO320fSNXvb5NzI08RZVkAxd00syfqrW7t bun sst shell --stage=dev bun dev", - "build": "bun ./script/generate-sitemap.ts && vite build && bun ../../opencode/script/schema.ts ./.output/public/config.json", + "build": "bun ./script/generate-sitemap.ts && vite build && bun ../../opencode/script/schema.ts ./.output/public/config.json ./.output/public/tui.json", "start": "vite start" }, "dependencies": { diff --git a/packages/opencode/script/schema.ts b/packages/opencode/script/schema.ts index 585701c95184..61d11ea7c93c 100755 --- a/packages/opencode/script/schema.ts +++ b/packages/opencode/script/schema.ts @@ -2,46 +2,62 @@ import { z } from "zod" import { Config } from "../src/config/config" +import { TuiConfig } from "../src/config/tui" + +function generate(schema: z.ZodType) { + const result = z.toJSONSchema(schema, { + io: "input", // Generate input shape (treats optional().default() as not required) + /** + * We'll use the `default` values of the field as the only value in `examples`. + * This will ensure no docs are needed to be read, as the configuration is + * self-documenting. + * + * See https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.9.5 + */ + override(ctx) { + const schema = ctx.jsonSchema + + // Preserve strictness: set additionalProperties: false for objects + if ( + schema && + typeof schema === "object" && + schema.type === "object" && + schema.additionalProperties === undefined + ) { + schema.additionalProperties = false + } + + // Add examples and default descriptions for string fields with defaults + if (schema && typeof schema === "object" && "type" in schema && schema.type === "string" && schema?.default) { + if (!schema.examples) { + schema.examples = [schema.default] + } -const file = process.argv[2] -console.log(file) - -const result = z.toJSONSchema(Config.Info, { - io: "input", // Generate input shape (treats optional().default() as not required) - /** - * We'll use the `default` values of the field as the only value in `examples`. - * This will ensure no docs are needed to be read, as the configuration is - * self-documenting. - * - * See https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.9.5 - */ - override(ctx) { - const schema = ctx.jsonSchema - - // Preserve strictness: set additionalProperties: false for objects - if (schema && typeof schema === "object" && schema.type === "object" && schema.additionalProperties === undefined) { - schema.additionalProperties = false - } - - // Add examples and default descriptions for string fields with defaults - if (schema && typeof schema === "object" && "type" in schema && schema.type === "string" && schema?.default) { - if (!schema.examples) { - schema.examples = [schema.default] + schema.description = [schema.description || "", `default: \`${schema.default}\``] + .filter(Boolean) + .join("\n\n") + .trim() } + }, + }) as Record & { + allowComments?: boolean + allowTrailingCommas?: boolean + } + + // used for json lsps since config supports jsonc + result.allowComments = true + result.allowTrailingCommas = true - schema.description = [schema.description || "", `default: \`${schema.default}\``] - .filter(Boolean) - .join("\n\n") - .trim() - } - }, -}) as Record & { - allowComments?: boolean - allowTrailingCommas?: boolean + return result } -// used for json lsps since config supports jsonc -result.allowComments = true -result.allowTrailingCommas = true +const configFile = process.argv[2] +const tuiFile = process.argv[3] -await Bun.write(file, JSON.stringify(result, null, 2)) +console.log(configFile) +await Bun.write(configFile, JSON.stringify(generate(Config.Info), null, 2)) + +if (tuiFile) { + console.log(tuiFile) + await Bun.write(tuiFile, JSON.stringify(generate(TuiConfig.Info), null, 2)) +} diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index ab3d09689252..97c910a47d4b 100644 --- a/packages/opencode/src/cli/cmd/tui/app.tsx +++ b/packages/opencode/src/cli/cmd/tui/app.tsx @@ -38,6 +38,8 @@ import { ArgsProvider, useArgs, type Args } from "./context/args" import open from "open" import { writeHeapSnapshot } from "v8" import { PromptRefProvider, usePromptRef } from "./context/prompt" +import { TuiConfigProvider } from "./context/tui-config" +import { TuiConfig } from "@/config/tui" async function getTerminalBackgroundColor(): Promise<"dark" | "light"> { // can't set raw mode if not a TTY @@ -104,6 +106,7 @@ import type { EventSource } from "./context/sdk" export function tui(input: { url: string args: Args + config: TuiConfig.Info directory?: string fetch?: typeof fetch headers?: RequestInit["headers"] @@ -138,35 +141,37 @@ export function tui(input: { - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/opencode/src/cli/cmd/tui/attach.ts b/packages/opencode/src/cli/cmd/tui/attach.ts index a2559cfce679..e892f9922d1b 100644 --- a/packages/opencode/src/cli/cmd/tui/attach.ts +++ b/packages/opencode/src/cli/cmd/tui/attach.ts @@ -2,6 +2,9 @@ import { cmd } from "../cmd" import { UI } from "@/cli/ui" import { tui } from "./app" import { win32DisableProcessedInput, win32InstallCtrlCGuard } from "./win32" +import { TuiConfig } from "@/config/tui" +import { Instance } from "@/project/instance" +import { existsSync } from "fs" export const AttachCommand = cmd({ command: "attach ", @@ -63,8 +66,13 @@ export const AttachCommand = cmd({ const auth = `Basic ${Buffer.from(`opencode:${password}`).toString("base64")}` return { Authorization: auth } })() + const config = await Instance.provide({ + directory: directory && existsSync(directory) ? directory : process.cwd(), + fn: () => TuiConfig.get(), + }) await tui({ url: args.url, + config, args: { continue: args.continue, sessionID: args.session, diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx index 38dc402758b2..be031296e905 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx @@ -10,8 +10,7 @@ import { type ParentProps, } from "solid-js" import { useKeyboard } from "@opentui/solid" -import { useKeybind } from "@tui/context/keybind" -import type { KeybindsConfig } from "@opencode-ai/sdk/v2" +import { type KeybindKey, useKeybind } from "@tui/context/keybind" type Context = ReturnType const ctx = createContext() @@ -22,7 +21,7 @@ export type Slash = { } export type CommandOption = DialogSelectOption & { - keybind?: keyof KeybindsConfig + keybind?: KeybindKey suggested?: boolean slash?: Slash hidden?: boolean diff --git a/packages/opencode/src/cli/cmd/tui/component/tips.tsx b/packages/opencode/src/cli/cmd/tui/component/tips.tsx index d0a7e5b44eca..73d82248adb4 100644 --- a/packages/opencode/src/cli/cmd/tui/component/tips.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/tips.tsx @@ -80,11 +80,11 @@ const TIPS = [ "Switch to {highlight}Plan{/highlight} agent to get suggestions without making actual changes", "Use {highlight}@agent-name{/highlight} in prompts to invoke specialized subagents", "Press {highlight}Ctrl+X Right/Left{/highlight} to cycle through parent and child sessions", - "Create {highlight}opencode.json{/highlight} in project root for project-specific settings", - "Place settings in {highlight}~/.config/opencode/opencode.json{/highlight} for global config", + "Create {highlight}opencode.json{/highlight} for server settings and {highlight}tui.json{/highlight} for TUI settings", + "Place TUI settings in {highlight}~/.config/opencode/tui.json{/highlight} for global config", "Add {highlight}$schema{/highlight} to your config for autocomplete in your editor", "Configure {highlight}model{/highlight} in config to set your default model", - "Override any keybind in config via the {highlight}keybinds{/highlight} section", + "Override any keybind in {highlight}tui.json{/highlight} via the {highlight}keybinds{/highlight} section", "Set any keybind to {highlight}none{/highlight} to disable it completely", "Configure local or remote MCP servers in the {highlight}mcp{/highlight} config section", "OpenCode auto-handles OAuth for remote MCP servers requiring auth", @@ -140,7 +140,7 @@ const TIPS = [ "Press {highlight}Ctrl+X G{/highlight} or {highlight}/timeline{/highlight} to jump to specific messages", "Press {highlight}Ctrl+X H{/highlight} to toggle code block visibility in messages", "Press {highlight}Ctrl+X S{/highlight} or {highlight}/status{/highlight} to see system status info", - "Enable {highlight}tui.scroll_acceleration{/highlight} for smooth macOS-style scrolling", + "Enable {highlight}scroll_acceleration{/highlight} in {highlight}tui.json{/highlight} for smooth macOS-style scrolling", "Toggle username display in chat via command palette ({highlight}Ctrl+P{/highlight})", "Run {highlight}docker run -it --rm ghcr.io/anomalyco/opencode{/highlight} for containerized use", "Use {highlight}/connect{/highlight} with OpenCode Zen for curated, tested models", diff --git a/packages/opencode/src/cli/cmd/tui/context/keybind.tsx b/packages/opencode/src/cli/cmd/tui/context/keybind.tsx index 0dbbbc6f9ee1..566d66ade508 100644 --- a/packages/opencode/src/cli/cmd/tui/context/keybind.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/keybind.tsx @@ -1,20 +1,22 @@ import { createMemo } from "solid-js" -import { useSync } from "@tui/context/sync" import { Keybind } from "@/util/keybind" import { pipe, mapValues } from "remeda" -import type { KeybindsConfig } from "@opencode-ai/sdk/v2" +import type { TuiConfig } from "@/config/tui" import type { ParsedKey, Renderable } from "@opentui/core" import { createStore } from "solid-js/store" import { useKeyboard, useRenderer } from "@opentui/solid" import { createSimpleContext } from "./helper" +import { useTuiConfig } from "./tui-config" + +export type KeybindKey = keyof NonNullable & string export const { use: useKeybind, provider: KeybindProvider } = createSimpleContext({ name: "Keybind", init: () => { - const sync = useSync() - const keybinds = createMemo(() => { + const config = useTuiConfig() + const keybinds = createMemo>(() => { return pipe( - sync.data.config.keybinds ?? {}, + (config.keybinds ?? {}) as Record, mapValues((value) => Keybind.parse(value)), ) }) @@ -78,7 +80,7 @@ export const { use: useKeybind, provider: KeybindProvider } = createSimpleContex } return Keybind.fromParsedKey(evt, store.leader) }, - match(key: keyof KeybindsConfig, evt: ParsedKey) { + match(key: KeybindKey, evt: ParsedKey) { const keybind = keybinds()[key] if (!keybind) return false const parsed: Keybind.Info = result.parse(evt) @@ -88,7 +90,7 @@ export const { use: useKeybind, provider: KeybindProvider } = createSimpleContex } } }, - print(key: keyof KeybindsConfig) { + print(key: KeybindKey) { const first = keybinds()[key]?.at(0) if (!first) return "" const result = Keybind.toString(first) diff --git a/packages/opencode/src/cli/cmd/tui/context/theme.tsx b/packages/opencode/src/cli/cmd/tui/context/theme.tsx index 465ed805ea17..2320c08ccc6e 100644 --- a/packages/opencode/src/cli/cmd/tui/context/theme.tsx +++ b/packages/opencode/src/cli/cmd/tui/context/theme.tsx @@ -1,7 +1,6 @@ import { SyntaxStyle, RGBA, type TerminalColors } from "@opentui/core" import path from "path" import { createEffect, createMemo, onMount } from "solid-js" -import { useSync } from "@tui/context/sync" import { createSimpleContext } from "./helper" import { Glob } from "../../../../util/glob" import aura from "./theme/aura.json" with { type: "json" } @@ -42,6 +41,7 @@ import { useRenderer } from "@opentui/solid" import { createStore, produce } from "solid-js/store" import { Global } from "@/global" import { Filesystem } from "@/util/filesystem" +import { useTuiConfig } from "./tui-config" type ThemeColors = { primary: RGBA @@ -280,17 +280,17 @@ function ansiToRgba(code: number): RGBA { export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({ name: "Theme", init: (props: { mode: "dark" | "light" }) => { - const sync = useSync() + const config = useTuiConfig() const kv = useKV() const [store, setStore] = createStore({ themes: DEFAULT_THEMES, mode: kv.get("theme_mode", props.mode), - active: (sync.data.config.theme ?? kv.get("theme", "opencode")) as string, + active: (config.theme ?? kv.get("theme", "opencode")) as string, ready: false, }) createEffect(() => { - const theme = sync.data.config.theme + const theme = config.theme if (theme) setStore("active", theme) }) diff --git a/packages/opencode/src/cli/cmd/tui/context/tui-config.tsx b/packages/opencode/src/cli/cmd/tui/context/tui-config.tsx new file mode 100644 index 000000000000..62dbf1ebd1b9 --- /dev/null +++ b/packages/opencode/src/cli/cmd/tui/context/tui-config.tsx @@ -0,0 +1,9 @@ +import { TuiConfig } from "@/config/tui" +import { createSimpleContext } from "./helper" + +export const { use: useTuiConfig, provider: TuiConfigProvider } = createSimpleContext({ + name: "TuiConfig", + init: (props: { config: TuiConfig.Info }) => { + return props.config + }, +}) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index 365eb3314726..f20267e0820e 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -78,6 +78,7 @@ import { QuestionPrompt } from "./question" import { DialogExportOptions } from "../../ui/dialog-export-options" import { formatTranscript } from "../../util/transcript" import { UI } from "@/cli/ui.ts" +import { useTuiConfig } from "../../context/tui-config" addDefaultParsers(parsers.parsers) @@ -101,6 +102,7 @@ const context = createContext<{ showGenericToolOutput: () => boolean diffWrapMode: () => "word" | "none" sync: ReturnType + tui: ReturnType }>() function use() { @@ -113,6 +115,7 @@ export function Session() { const route = useRouteData("session") const { navigate } = useRoute() const sync = useSync() + const tuiConfig = useTuiConfig() const kv = useKV() const { theme } = useTheme() const promptRef = usePromptRef() @@ -166,7 +169,7 @@ export function Session() { const contentWidth = createMemo(() => dimensions().width - (sidebarVisible() ? 42 : 0) - 4) const scrollAcceleration = createMemo(() => { - const tui = sync.data.config.tui + const tui = tuiConfig if (tui?.scroll_acceleration?.enabled) { return new MacOSScrollAccel() } @@ -988,6 +991,7 @@ export function Session() { showGenericToolOutput, diffWrapMode, sync, + tui: tuiConfig, }} > @@ -1949,7 +1953,7 @@ function Edit(props: ToolProps) { const { theme, syntax } = useTheme() const view = createMemo(() => { - const diffStyle = ctx.sync.data.config.tui?.diff_style + const diffStyle = ctx.tui.diff_style if (diffStyle === "stacked") return "unified" // Default to "auto" behavior return ctx.width > 120 ? "split" : "unified" @@ -2003,7 +2007,7 @@ function ApplyPatch(props: ToolProps) { const files = createMemo(() => props.metadata.files ?? []) const view = createMemo(() => { - const diffStyle = ctx.sync.data.config.tui?.diff_style + const diffStyle = ctx.tui.diff_style if (diffStyle === "stacked") return "unified" return ctx.width > 120 ? "split" : "unified" }) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx index 389fc2418cc6..a50cd96fc843 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx @@ -15,6 +15,7 @@ import { Keybind } from "@/util/keybind" import { Locale } from "@/util/locale" import { Global } from "@/global" import { useDialog } from "../../ui/dialog" +import { useTuiConfig } from "../../context/tui-config" type PermissionStage = "permission" | "always" | "reject" @@ -48,14 +49,14 @@ function EditBody(props: { request: PermissionRequest }) { const themeState = useTheme() const theme = themeState.theme const syntax = themeState.syntax - const sync = useSync() + const config = useTuiConfig() const dimensions = useTerminalDimensions() const filepath = createMemo(() => (props.request.metadata?.filepath as string) ?? "") const diff = createMemo(() => (props.request.metadata?.diff as string) ?? "") const view = createMemo(() => { - const diffStyle = sync.data.config.tui?.diff_style + const diffStyle = config.diff_style if (diffStyle === "stacked") return "unified" return dimensions().width > 120 ? "split" : "unified" }) diff --git a/packages/opencode/src/cli/cmd/tui/thread.ts b/packages/opencode/src/cli/cmd/tui/thread.ts index 50f63c3dfbd1..750347d9d636 100644 --- a/packages/opencode/src/cli/cmd/tui/thread.ts +++ b/packages/opencode/src/cli/cmd/tui/thread.ts @@ -12,6 +12,8 @@ import { Filesystem } from "@/util/filesystem" import type { Event } from "@opencode-ai/sdk/v2" import type { EventSource } from "./context/sdk" import { win32DisableProcessedInput, win32InstallCtrlCGuard } from "./win32" +import { TuiConfig } from "@/config/tui" +import { Instance } from "@/project/instance" declare global { const OPENCODE_WORKER_PATH: string @@ -135,6 +137,10 @@ export const TuiThreadCommand = cmd({ if (!args.prompt) return piped return piped ? piped + "\n" + args.prompt : args.prompt }) + const config = await Instance.provide({ + directory: cwd, + fn: () => TuiConfig.get(), + }) // Check if server should be started (port or hostname explicitly set in CLI or config) const networkOpts = await resolveNetworkOptions(args) @@ -163,6 +169,8 @@ export const TuiThreadCommand = cmd({ const tuiPromise = tui({ url, + config, + directory: cwd, fetch: customFetch, events, args: { diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index 761ce23f3d6c..28aea4d67772 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -4,7 +4,6 @@ import { pathToFileURL, fileURLToPath } from "url" import { createRequire } from "module" import os from "os" import z from "zod" -import { Filesystem } from "../util/filesystem" import { ModelsDev } from "../provider/models" import { mergeDeep, pipe, unique } from "remeda" import { Global } from "../global" @@ -34,6 +33,8 @@ import { PackageRegistry } from "@/bun/registry" import { proxied } from "@/util/proxied" import { iife } from "@/util/iife" import { Control } from "@/control" +import { ConfigPaths } from "./paths" +import { Filesystem } from "@/util/filesystem" export namespace Config { const ModelId = z.string().meta({ $ref: "https://models.dev/model-schema.json#/$defs/Model" }) @@ -42,7 +43,7 @@ export namespace Config { // Managed settings directory for enterprise deployments (highest priority, admin-controlled) // These settings override all user and project settings - function getManagedConfigDir(): string { + function systemManagedConfigDir(): string { switch (process.platform) { case "darwin": return "/Library/Application Support/opencode" @@ -53,10 +54,14 @@ export namespace Config { } } - const managedConfigDir = process.env.OPENCODE_TEST_MANAGED_CONFIG_DIR || getManagedConfigDir() + export function managedConfigDir() { + return process.env.OPENCODE_TEST_MANAGED_CONFIG_DIR || systemManagedConfigDir() + } + + const managedDir = managedConfigDir() // Custom merge function that concatenates array fields instead of replacing them - function merge(target: Info, source: Info): Info { + function mergeConfigConcatArrays(target: Info, source: Info): Info { const merged = mergeDeep(target, source) if (target.plugin && source.plugin) { merged.plugin = Array.from(new Set([...target.plugin, ...source.plugin])) @@ -91,7 +96,7 @@ export namespace Config { const remoteConfig = wellknown.config ?? {} // Add $schema to prevent load() from trying to write back to a non-existent file if (!remoteConfig.$schema) remoteConfig.$schema = "https://opencode.ai/config.json" - result = merge( + result = mergeConfigConcatArrays( result, await load(JSON.stringify(remoteConfig), { dir: path.dirname(`${key}/.well-known/opencode`), @@ -107,21 +112,18 @@ export namespace Config { } // Global user config overrides remote config. - result = merge(result, await global()) + result = mergeConfigConcatArrays(result, await global()) // Custom config path overrides global config. if (Flag.OPENCODE_CONFIG) { - result = merge(result, await loadFile(Flag.OPENCODE_CONFIG)) + result = mergeConfigConcatArrays(result, await loadFile(Flag.OPENCODE_CONFIG)) log.debug("loaded custom config", { path: Flag.OPENCODE_CONFIG }) } // Project config overrides global and remote config. if (!Flag.OPENCODE_DISABLE_PROJECT_CONFIG) { - for (const file of ["opencode.jsonc", "opencode.json"]) { - const found = await Filesystem.findUp(file, Instance.directory, Instance.worktree) - for (const resolved of found.toReversed()) { - result = merge(result, await loadFile(resolved)) - } + for (const file of await ConfigPaths.projectFiles("opencode", Instance.directory, Instance.worktree)) { + result = mergeConfigConcatArrays(result, await loadFile(file)) } } @@ -129,31 +131,10 @@ export namespace Config { result.mode = result.mode || {} result.plugin = result.plugin || [] - const directories = [ - Global.Path.config, - // Only scan project .opencode/ directories when project discovery is enabled - ...(!Flag.OPENCODE_DISABLE_PROJECT_CONFIG - ? await Array.fromAsync( - Filesystem.up({ - targets: [".opencode"], - start: Instance.directory, - stop: Instance.worktree, - }), - ) - : []), - // Always scan ~/.opencode/ (user home directory) - ...(await Array.fromAsync( - Filesystem.up({ - targets: [".opencode"], - start: Global.Path.home, - stop: Global.Path.home, - }), - )), - ] + const directories = await ConfigPaths.directories(Instance.directory, Instance.worktree) // .opencode directory config overrides (project and global) config sources. if (Flag.OPENCODE_CONFIG_DIR) { - directories.push(Flag.OPENCODE_CONFIG_DIR) log.debug("loading config from OPENCODE_CONFIG_DIR", { path: Flag.OPENCODE_CONFIG_DIR }) } @@ -163,7 +144,7 @@ export namespace Config { if (dir.endsWith(".opencode") || dir === Flag.OPENCODE_CONFIG_DIR) { for (const file of ["opencode.jsonc", "opencode.json"]) { log.debug(`loading config from ${path.join(dir, file)}`) - result = merge(result, await loadFile(path.join(dir, file))) + result = mergeConfigConcatArrays(result, await loadFile(path.join(dir, file))) // to satisfy the type checker result.agent ??= {} result.mode ??= {} @@ -186,7 +167,7 @@ export namespace Config { // Inline config content overrides all non-managed config sources. if (process.env.OPENCODE_CONFIG_CONTENT) { - result = merge( + result = mergeConfigConcatArrays( result, await load(process.env.OPENCODE_CONFIG_CONTENT, { dir: Instance.directory, @@ -200,9 +181,9 @@ export namespace Config { // Kept separate from directories array to avoid write operations when installing plugins // which would fail on system directories requiring elevated permissions // This way it only loads config file and not skills/plugins/commands - if (existsSync(managedConfigDir)) { + if (existsSync(managedDir)) { for (const file of ["opencode.jsonc", "opencode.json"]) { - result = merge(result, await loadFile(path.join(managedConfigDir, file))) + result = mergeConfigConcatArrays(result, await loadFile(path.join(managedDir, file))) } } @@ -241,8 +222,6 @@ export namespace Config { result.share = "auto" } - if (!result.keybinds) result.keybinds = Info.shape.keybinds.parse({}) - // Apply flag overrides for compaction settings if (Flag.OPENCODE_DISABLE_AUTOCOMPACT) { result.compaction = { ...result.compaction, auto: false } @@ -306,7 +285,7 @@ export namespace Config { } } - async function needsInstall(dir: string) { + export async function needsInstall(dir: string) { // Some config dirs may be read-only. // Installing deps there will fail; skip installation in that case. const writable = await isWritable(dir) @@ -930,20 +909,6 @@ export namespace Config { ref: "KeybindsConfig", }) - export const TUI = z.object({ - scroll_speed: z.number().min(0.001).optional().describe("TUI scroll speed"), - scroll_acceleration: z - .object({ - enabled: z.boolean().describe("Enable scroll acceleration"), - }) - .optional() - .describe("Scroll acceleration settings"), - diff_style: z - .enum(["auto", "stacked"]) - .optional() - .describe("Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column"), - }) - export const Server = z .object({ port: z.number().int().positive().optional().describe("Port to listen on"), @@ -1018,10 +983,7 @@ export namespace Config { export const Info = z .object({ $schema: z.string().optional().describe("JSON schema reference for configuration validation"), - theme: z.string().optional().describe("Theme name to use for the interface"), - keybinds: Keybinds.optional().describe("Custom keybind configurations"), logLevel: Log.Level.optional().describe("Log level"), - tui: TUI.optional().describe("TUI specific settings"), server: Server.optional().describe("Server configuration for opencode serve and web commands"), command: z .record(z.string(), Command) @@ -1241,86 +1203,37 @@ export namespace Config { return result }) + export const { readFile } = ConfigPaths + async function loadFile(filepath: string): Promise { log.info("loading", { path: filepath }) - let text = await Filesystem.readText(filepath).catch((err: any) => { - if (err.code === "ENOENT") return - throw new JsonError({ path: filepath }, { cause: err }) - }) + const text = await readFile(filepath) if (!text) return {} return load(text, { path: filepath }) } async function load(text: string, options: { path: string } | { dir: string; source: string }) { const original = text - const configDir = "path" in options ? path.dirname(options.path) : options.dir const source = "path" in options ? options.path : options.source const isFile = "path" in options + const data = await ConfigPaths.parseText( + text, + "path" in options ? options.path : { source: options.source, dir: options.dir }, + ) - text = text.replace(/\{env:([^}]+)\}/g, (_, varName) => { - return process.env[varName] || "" - }) - - const fileMatches = text.match(/\{file:[^}]+\}/g) - if (fileMatches) { - const lines = text.split("\n") - - for (const match of fileMatches) { - const lineIndex = lines.findIndex((line) => line.includes(match)) - if (lineIndex !== -1 && lines[lineIndex].trim().startsWith("//")) { - continue - } - let filePath = match.replace(/^\{file:/, "").replace(/\}$/, "") - if (filePath.startsWith("~/")) { - filePath = path.join(os.homedir(), filePath.slice(2)) - } - const resolvedPath = path.isAbsolute(filePath) ? filePath : path.resolve(configDir, filePath) - const fileContent = ( - await Bun.file(resolvedPath) - .text() - .catch((error) => { - const errMsg = `bad file reference: "${match}"` - if (error.code === "ENOENT") { - throw new InvalidError( - { - path: source, - message: errMsg + ` ${resolvedPath} does not exist`, - }, - { cause: error }, - ) - } - throw new InvalidError({ path: source, message: errMsg }, { cause: error }) - }) - ).trim() - text = text.replace(match, () => JSON.stringify(fileContent).slice(1, -1)) - } - } - - const errors: JsoncParseError[] = [] - const data = parseJsonc(text, errors, { allowTrailingComma: true }) - if (errors.length) { - const lines = text.split("\n") - const errorDetails = errors - .map((e) => { - const beforeOffset = text.substring(0, e.offset).split("\n") - const line = beforeOffset.length - const column = beforeOffset[beforeOffset.length - 1].length + 1 - const problemLine = lines[line - 1] - - const error = `${printParseErrorCode(e.error)} at line ${line}, column ${column}` - if (!problemLine) return error - - return `${error}\n Line ${line}: ${problemLine}\n${"".padStart(column + 9)}^` - }) - .join("\n") - - throw new JsonError({ - path: source, - message: `\n--- JSONC Input ---\n${text}\n--- Errors ---\n${errorDetails}\n--- End ---`, - }) - } + const normalized = (() => { + if (!data || typeof data !== "object" || Array.isArray(data)) return data + const copy = { ...(data as Record) } + const hadLegacy = "theme" in copy || "keybinds" in copy || "tui" in copy + if (!hadLegacy) return copy + delete copy.theme + delete copy.keybinds + delete copy.tui + log.warn("tui keys in opencode config are deprecated; move them to tui.json", { path: source }) + return copy + })() - const parsed = Info.safeParse(data) + const parsed = Info.safeParse(normalized) if (parsed.success) { if (!parsed.data.$schema && isFile) { parsed.data.$schema = "https://opencode.ai/config.json" @@ -1353,13 +1266,7 @@ export namespace Config { issues: parsed.error.issues, }) } - export const JsonError = NamedError.create( - "ConfigJsonError", - z.object({ - path: z.string(), - message: z.string().optional(), - }), - ) + export const { JsonError, InvalidError } = ConfigPaths export const ConfigDirectoryTypoError = NamedError.create( "ConfigDirectoryTypoError", @@ -1370,15 +1277,6 @@ export namespace Config { }), ) - export const InvalidError = NamedError.create( - "ConfigInvalidError", - z.object({ - path: z.string(), - issues: z.custom().optional(), - message: z.string().optional(), - }), - ) - export async function get() { return state().then((x) => x.config) } diff --git a/packages/opencode/src/config/migrate-tui-config.ts b/packages/opencode/src/config/migrate-tui-config.ts new file mode 100644 index 000000000000..b426e4fbd106 --- /dev/null +++ b/packages/opencode/src/config/migrate-tui-config.ts @@ -0,0 +1,155 @@ +import path from "path" +import { type ParseError as JsoncParseError, applyEdits, modify, parse as parseJsonc } from "jsonc-parser" +import { unique } from "remeda" +import z from "zod" +import { ConfigPaths } from "./paths" +import { TuiInfo, TuiOptions } from "./tui-schema" +import { Instance } from "@/project/instance" +import { Flag } from "@/flag/flag" +import { Log } from "@/util/log" +import { Filesystem } from "@/util/filesystem" +import { Global } from "@/global" + +const log = Log.create({ service: "tui.migrate" }) + +const TUI_SCHEMA_URL = "https://opencode.ai/tui.json" + +const LegacyTheme = TuiInfo.shape.theme.optional() +const LegacyRecord = z.record(z.string(), z.unknown()).optional() + +const TuiLegacy = z + .object({ + scroll_speed: TuiOptions.shape.scroll_speed.catch(undefined), + scroll_acceleration: TuiOptions.shape.scroll_acceleration.catch(undefined), + diff_style: TuiOptions.shape.diff_style.catch(undefined), + }) + .strip() + +interface MigrateInput { + directories: string[] + custom?: string + managed: string +} + +/** + * Migrates tui-specific keys (theme, keybinds, tui) from opencode.json files + * into dedicated tui.json files. Migration is performed per-directory and + * skips only locations where a tui.json already exists. + */ +export async function migrateTuiConfig(input: MigrateInput) { + const opencode = await opencodeFiles(input) + for (const file of opencode) { + const source = await Filesystem.readText(file).catch((error) => { + log.warn("failed to read config for tui migration", { path: file, error }) + return undefined + }) + if (!source) continue + const errors: JsoncParseError[] = [] + const data = parseJsonc(source, errors, { allowTrailingComma: true }) + if (errors.length || !data || typeof data !== "object" || Array.isArray(data)) continue + + const theme = LegacyTheme.safeParse("theme" in data ? data.theme : undefined) + const keybinds = LegacyRecord.safeParse("keybinds" in data ? data.keybinds : undefined) + const legacyTui = LegacyRecord.safeParse("tui" in data ? data.tui : undefined) + const extracted = { + theme: theme.success ? theme.data : undefined, + keybinds: keybinds.success ? keybinds.data : undefined, + tui: legacyTui.success ? legacyTui.data : undefined, + } + const tui = extracted.tui ? normalizeTui(extracted.tui) : undefined + if (extracted.theme === undefined && extracted.keybinds === undefined && !tui) continue + + const target = path.join(path.dirname(file), "tui.json") + const targetExists = await Filesystem.exists(target) + if (targetExists) continue + + const payload: Record = { + $schema: TUI_SCHEMA_URL, + } + if (extracted.theme !== undefined) payload.theme = extracted.theme + if (extracted.keybinds !== undefined) payload.keybinds = extracted.keybinds + if (tui) Object.assign(payload, tui) + + const wrote = await Bun.write(target, JSON.stringify(payload, null, 2)) + .then(() => true) + .catch((error) => { + log.warn("failed to write tui migration target", { from: file, to: target, error }) + return false + }) + if (!wrote) continue + + const stripped = await backupAndStripLegacy(file, source) + if (!stripped) { + log.warn("tui config migrated but source file was not stripped", { from: file, to: target }) + continue + } + log.info("migrated tui config", { from: file, to: target }) + } +} + +function normalizeTui(data: Record) { + const parsed = TuiLegacy.parse(data) + if ( + parsed.scroll_speed === undefined && + parsed.diff_style === undefined && + parsed.scroll_acceleration === undefined + ) { + return + } + return parsed +} + +async function backupAndStripLegacy(file: string, source: string) { + const backup = file + ".tui-migration.bak" + const hasBackup = await Filesystem.exists(backup) + const backed = hasBackup + ? true + : await Bun.write(backup, source) + .then(() => true) + .catch((error) => { + log.warn("failed to backup source config during tui migration", { path: file, backup, error }) + return false + }) + if (!backed) return false + + const text = ["theme", "keybinds", "tui"].reduce((acc, key) => { + const edits = modify(acc, [key], undefined, { + formattingOptions: { + insertSpaces: true, + tabSize: 2, + }, + }) + if (!edits.length) return acc + return applyEdits(acc, edits) + }, source) + + return Bun.write(file, text) + .then(() => { + log.info("stripped tui keys from server config", { path: file, backup }) + return true + }) + .catch((error) => { + log.warn("failed to strip legacy tui keys from server config", { path: file, backup, error }) + return false + }) +} + +async function opencodeFiles(input: { directories: string[]; managed: string }) { + const project = Flag.OPENCODE_DISABLE_PROJECT_CONFIG + ? [] + : await ConfigPaths.projectFiles("opencode", Instance.directory, Instance.worktree) + const files = [...project, ...ConfigPaths.fileInDirectory(Global.Path.config, "opencode")] + for (const dir of unique(input.directories)) { + files.push(...ConfigPaths.fileInDirectory(dir, "opencode")) + } + if (Flag.OPENCODE_CONFIG) files.push(Flag.OPENCODE_CONFIG) + files.push(...ConfigPaths.fileInDirectory(input.managed, "opencode")) + + const existing = await Promise.all( + unique(files).map(async (file) => { + const ok = await Filesystem.exists(file) + return ok ? file : undefined + }), + ) + return existing.filter((file): file is string => !!file) +} diff --git a/packages/opencode/src/config/paths.ts b/packages/opencode/src/config/paths.ts new file mode 100644 index 000000000000..396417e9a5bf --- /dev/null +++ b/packages/opencode/src/config/paths.ts @@ -0,0 +1,174 @@ +import path from "path" +import os from "os" +import z from "zod" +import { type ParseError as JsoncParseError, parse as parseJsonc, printParseErrorCode } from "jsonc-parser" +import { NamedError } from "@opencode-ai/util/error" +import { Filesystem } from "@/util/filesystem" +import { Flag } from "@/flag/flag" +import { Global } from "@/global" + +export namespace ConfigPaths { + export async function projectFiles(name: string, directory: string, worktree: string) { + const files: string[] = [] + for (const file of [`${name}.jsonc`, `${name}.json`]) { + const found = await Filesystem.findUp(file, directory, worktree) + for (const resolved of found.toReversed()) { + files.push(resolved) + } + } + return files + } + + export async function directories(directory: string, worktree: string) { + return [ + Global.Path.config, + ...(!Flag.OPENCODE_DISABLE_PROJECT_CONFIG + ? await Array.fromAsync( + Filesystem.up({ + targets: [".opencode"], + start: directory, + stop: worktree, + }), + ) + : []), + ...(await Array.fromAsync( + Filesystem.up({ + targets: [".opencode"], + start: Global.Path.home, + stop: Global.Path.home, + }), + )), + ...(Flag.OPENCODE_CONFIG_DIR ? [Flag.OPENCODE_CONFIG_DIR] : []), + ] + } + + export function fileInDirectory(dir: string, name: string) { + return [path.join(dir, `${name}.jsonc`), path.join(dir, `${name}.json`)] + } + + export const JsonError = NamedError.create( + "ConfigJsonError", + z.object({ + path: z.string(), + message: z.string().optional(), + }), + ) + + export const InvalidError = NamedError.create( + "ConfigInvalidError", + z.object({ + path: z.string(), + issues: z.custom().optional(), + message: z.string().optional(), + }), + ) + + /** Read a config file, returning undefined for missing files and throwing JsonError for other failures. */ + export async function readFile(filepath: string) { + return Filesystem.readText(filepath).catch((err: NodeJS.ErrnoException) => { + if (err.code === "ENOENT") return + throw new JsonError({ path: filepath }, { cause: err }) + }) + } + + type ParseSource = string | { source: string; dir: string } + + function source(input: ParseSource) { + return typeof input === "string" ? input : input.source + } + + function dir(input: ParseSource) { + return typeof input === "string" ? path.dirname(input) : input.dir + } + + /** Apply {env:VAR} and {file:path} substitutions to config text. */ + async function substitute(text: string, input: ParseSource, missing: "error" | "empty" = "error") { + text = text.replace(/\{env:([^}]+)\}/g, (_, varName) => { + return process.env[varName] || "" + }) + + const fileMatches = Array.from(text.matchAll(/\{file:[^}]+\}/g)) + if (!fileMatches.length) return text + + const configDir = dir(input) + const configSource = source(input) + let out = "" + let cursor = 0 + + for (const match of fileMatches) { + const token = match[0] + const index = match.index! + out += text.slice(cursor, index) + + const lineStart = text.lastIndexOf("\n", index - 1) + 1 + const prefix = text.slice(lineStart, index).trimStart() + if (prefix.startsWith("//")) { + out += token + cursor = index + token.length + continue + } + + let filePath = token.replace(/^\{file:/, "").replace(/\}$/, "") + if (filePath.startsWith("~/")) { + filePath = path.join(os.homedir(), filePath.slice(2)) + } + + const resolvedPath = path.isAbsolute(filePath) ? filePath : path.resolve(configDir, filePath) + const fileContent = ( + await Filesystem.readText(resolvedPath).catch((error: NodeJS.ErrnoException) => { + if (missing === "empty") return "" + + const errMsg = `bad file reference: "${token}"` + if (error.code === "ENOENT") { + throw new InvalidError( + { + path: configSource, + message: errMsg + ` ${resolvedPath} does not exist`, + }, + { cause: error }, + ) + } + throw new InvalidError({ path: configSource, message: errMsg }, { cause: error }) + }) + ).trim() + + out += JSON.stringify(fileContent).slice(1, -1) + cursor = index + token.length + } + + out += text.slice(cursor) + return out + } + + /** Substitute and parse JSONC text, throwing JsonError on syntax errors. */ + export async function parseText(text: string, input: ParseSource, missing: "error" | "empty" = "error") { + const configSource = source(input) + text = await substitute(text, input, missing) + + const errors: JsoncParseError[] = [] + const data = parseJsonc(text, errors, { allowTrailingComma: true }) + if (errors.length) { + const lines = text.split("\n") + const errorDetails = errors + .map((e) => { + const beforeOffset = text.substring(0, e.offset).split("\n") + const line = beforeOffset.length + const column = beforeOffset[beforeOffset.length - 1].length + 1 + const problemLine = lines[line - 1] + + const error = `${printParseErrorCode(e.error)} at line ${line}, column ${column}` + if (!problemLine) return error + + return `${error}\n Line ${line}: ${problemLine}\n${"".padStart(column + 9)}^` + }) + .join("\n") + + throw new JsonError({ + path: configSource, + message: `\n--- JSONC Input ---\n${text}\n--- Errors ---\n${errorDetails}\n--- End ---`, + }) + } + + return data + } +} diff --git a/packages/opencode/src/config/tui-schema.ts b/packages/opencode/src/config/tui-schema.ts new file mode 100644 index 000000000000..f9068e3f01d3 --- /dev/null +++ b/packages/opencode/src/config/tui-schema.ts @@ -0,0 +1,34 @@ +import z from "zod" +import { Config } from "./config" + +const KeybindOverride = z + .object( + Object.fromEntries(Object.keys(Config.Keybinds.shape).map((key) => [key, z.string().optional()])) as Record< + string, + z.ZodOptional + >, + ) + .strict() + +export const TuiOptions = z.object({ + scroll_speed: z.number().min(0.001).optional().describe("TUI scroll speed"), + scroll_acceleration: z + .object({ + enabled: z.boolean().describe("Enable scroll acceleration"), + }) + .optional() + .describe("Scroll acceleration settings"), + diff_style: z + .enum(["auto", "stacked"]) + .optional() + .describe("Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column"), +}) + +export const TuiInfo = z + .object({ + $schema: z.string().optional(), + theme: z.string().optional(), + keybinds: KeybindOverride.optional(), + }) + .extend(TuiOptions.shape) + .strict() diff --git a/packages/opencode/src/config/tui.ts b/packages/opencode/src/config/tui.ts new file mode 100644 index 000000000000..f0964f63b35f --- /dev/null +++ b/packages/opencode/src/config/tui.ts @@ -0,0 +1,118 @@ +import { existsSync } from "fs" +import z from "zod" +import { mergeDeep, unique } from "remeda" +import { Config } from "./config" +import { ConfigPaths } from "./paths" +import { migrateTuiConfig } from "./migrate-tui-config" +import { TuiInfo } from "./tui-schema" +import { Instance } from "@/project/instance" +import { Flag } from "@/flag/flag" +import { Log } from "@/util/log" +import { Global } from "@/global" + +export namespace TuiConfig { + const log = Log.create({ service: "tui.config" }) + + export const Info = TuiInfo + + export type Info = z.output + + function mergeInfo(target: Info, source: Info): Info { + return mergeDeep(target, source) + } + + function customPath() { + return Flag.OPENCODE_TUI_CONFIG + } + + const state = Instance.state(async () => { + let projectFiles = Flag.OPENCODE_DISABLE_PROJECT_CONFIG + ? [] + : await ConfigPaths.projectFiles("tui", Instance.directory, Instance.worktree) + const directories = await ConfigPaths.directories(Instance.directory, Instance.worktree) + const custom = customPath() + const managed = Config.managedConfigDir() + await migrateTuiConfig({ directories, custom, managed }) + // Re-compute after migration since migrateTuiConfig may have created new tui.json files + projectFiles = Flag.OPENCODE_DISABLE_PROJECT_CONFIG + ? [] + : await ConfigPaths.projectFiles("tui", Instance.directory, Instance.worktree) + + let result: Info = {} + + for (const file of ConfigPaths.fileInDirectory(Global.Path.config, "tui")) { + result = mergeInfo(result, await loadFile(file)) + } + + if (custom) { + result = mergeInfo(result, await loadFile(custom)) + log.debug("loaded custom tui config", { path: custom }) + } + + for (const file of projectFiles) { + result = mergeInfo(result, await loadFile(file)) + } + + for (const dir of unique(directories)) { + if (!dir.endsWith(".opencode") && dir !== Flag.OPENCODE_CONFIG_DIR) continue + for (const file of ConfigPaths.fileInDirectory(dir, "tui")) { + result = mergeInfo(result, await loadFile(file)) + } + } + + if (existsSync(managed)) { + for (const file of ConfigPaths.fileInDirectory(managed, "tui")) { + result = mergeInfo(result, await loadFile(file)) + } + } + + result.keybinds = Config.Keybinds.parse(result.keybinds ?? {}) + + return { + config: result, + } + }) + + export async function get() { + return state().then((x) => x.config) + } + + async function loadFile(filepath: string): Promise { + const text = await ConfigPaths.readFile(filepath) + if (!text) return {} + return load(text, filepath).catch((error) => { + log.warn("failed to load tui config", { path: filepath, error }) + return {} + }) + } + + async function load(text: string, configFilepath: string): Promise { + const data = await ConfigPaths.parseText(text, configFilepath, "empty") + if (!data || typeof data !== "object" || Array.isArray(data)) return {} + + // Flatten a nested "tui" key so users who wrote `{ "tui": { ... } }` inside tui.json + // (mirroring the old opencode.json shape) still get their settings applied. + const normalized = (() => { + const copy = { ...(data as Record) } + if (!("tui" in copy)) return copy + if (!copy.tui || typeof copy.tui !== "object" || Array.isArray(copy.tui)) { + delete copy.tui + return copy + } + const tui = copy.tui as Record + delete copy.tui + return { + ...tui, + ...copy, + } + })() + + const parsed = Info.safeParse(normalized) + if (!parsed.success) { + log.warn("invalid tui config", { path: configFilepath, issues: parsed.error.issues }) + return {} + } + + return parsed.data + } +} diff --git a/packages/opencode/src/flag/flag.ts b/packages/opencode/src/flag/flag.ts index 0049d716d095..e02f191c709b 100644 --- a/packages/opencode/src/flag/flag.ts +++ b/packages/opencode/src/flag/flag.ts @@ -7,6 +7,7 @@ export namespace Flag { export const OPENCODE_AUTO_SHARE = truthy("OPENCODE_AUTO_SHARE") export const OPENCODE_GIT_BASH_PATH = process.env["OPENCODE_GIT_BASH_PATH"] export const OPENCODE_CONFIG = process.env["OPENCODE_CONFIG"] + export declare const OPENCODE_TUI_CONFIG: string | undefined export declare const OPENCODE_CONFIG_DIR: string | undefined export const OPENCODE_CONFIG_CONTENT = process.env["OPENCODE_CONFIG_CONTENT"] export const OPENCODE_DISABLE_AUTOUPDATE = truthy("OPENCODE_DISABLE_AUTOUPDATE") @@ -74,6 +75,17 @@ Object.defineProperty(Flag, "OPENCODE_DISABLE_PROJECT_CONFIG", { configurable: false, }) +// Dynamic getter for OPENCODE_TUI_CONFIG +// This must be evaluated at access time, not module load time, +// because tests and external tooling may set this env var at runtime +Object.defineProperty(Flag, "OPENCODE_TUI_CONFIG", { + get() { + return process.env["OPENCODE_TUI_CONFIG"] + }, + enumerable: true, + configurable: false, +}) + // Dynamic getter for OPENCODE_CONFIG_DIR // This must be evaluated at access time, not module load time, // because external tooling may set this env var at runtime diff --git a/packages/opencode/test/config/config.test.ts b/packages/opencode/test/config/config.test.ts index 2b1ba816ea3b..f245dc3493d2 100644 --- a/packages/opencode/test/config/config.test.ts +++ b/packages/opencode/test/config/config.test.ts @@ -56,6 +56,28 @@ test("loads JSON config file", async () => { }) }) +test("ignores legacy tui keys in opencode config", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await writeConfig(dir, { + $schema: "https://opencode.ai/config.json", + model: "test/model", + theme: "legacy", + tui: { scroll_speed: 4 }, + }) + }, + }) + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await Config.get() + expect(config.model).toBe("test/model") + expect((config as Record).theme).toBeUndefined() + expect((config as Record).tui).toBeUndefined() + }, + }) +}) + test("loads JSONC config file", async () => { await using tmp = await tmpdir({ init: async (dir) => { @@ -110,14 +132,14 @@ test("merges multiple config files with correct precedence", async () => { test("handles environment variable substitution", async () => { const originalEnv = process.env["TEST_VAR"] - process.env["TEST_VAR"] = "test_theme" + process.env["TEST_VAR"] = "test-user" try { await using tmp = await tmpdir({ init: async (dir) => { await writeConfig(dir, { $schema: "https://opencode.ai/config.json", - theme: "{env:TEST_VAR}", + username: "{env:TEST_VAR}", }) }, }) @@ -125,7 +147,7 @@ test("handles environment variable substitution", async () => { directory: tmp.path, fn: async () => { const config = await Config.get() - expect(config.theme).toBe("test_theme") + expect(config.username).toBe("test-user") }, }) } finally { @@ -148,7 +170,7 @@ test("preserves env variables when adding $schema to config", async () => { await Filesystem.write( path.join(dir, "opencode.json"), JSON.stringify({ - theme: "{env:PRESERVE_VAR}", + username: "{env:PRESERVE_VAR}", }), ) }, @@ -157,7 +179,7 @@ test("preserves env variables when adding $schema to config", async () => { directory: tmp.path, fn: async () => { const config = await Config.get() - expect(config.theme).toBe("secret_value") + expect(config.username).toBe("secret_value") // Read the file to verify the env variable was preserved const content = await Filesystem.readText(path.join(tmp.path, "opencode.json")) @@ -178,10 +200,10 @@ test("preserves env variables when adding $schema to config", async () => { test("handles file inclusion substitution", async () => { await using tmp = await tmpdir({ init: async (dir) => { - await Filesystem.write(path.join(dir, "included.txt"), "test_theme") + await Filesystem.write(path.join(dir, "included.txt"), "test-user") await writeConfig(dir, { $schema: "https://opencode.ai/config.json", - theme: "{file:included.txt}", + username: "{file:included.txt}", }) }, }) @@ -189,7 +211,7 @@ test("handles file inclusion substitution", async () => { directory: tmp.path, fn: async () => { const config = await Config.get() - expect(config.theme).toBe("test_theme") + expect(config.username).toBe("test-user") }, }) }) @@ -200,7 +222,7 @@ test("handles file inclusion with replacement tokens", async () => { await Filesystem.write(path.join(dir, "included.md"), "const out = await Bun.$`echo hi`") await writeConfig(dir, { $schema: "https://opencode.ai/config.json", - theme: "{file:included.md}", + username: "{file:included.md}", }) }, }) @@ -208,7 +230,7 @@ test("handles file inclusion with replacement tokens", async () => { directory: tmp.path, fn: async () => { const config = await Config.get() - expect(config.theme).toBe("const out = await Bun.$`echo hi`") + expect(config.username).toBe("const out = await Bun.$`echo hi`") }, }) }) @@ -1043,7 +1065,6 @@ test("managed settings override project settings", async () => { $schema: "https://opencode.ai/config.json", autoupdate: true, disabled_providers: [], - theme: "dark", }) }, }) @@ -1060,7 +1081,6 @@ test("managed settings override project settings", async () => { const config = await Config.get() expect(config.autoupdate).toBe(false) expect(config.disabled_providers).toEqual(["openai"]) - expect(config.theme).toBe("dark") }, }) }) @@ -1809,7 +1829,7 @@ describe("OPENCODE_CONFIG_CONTENT token substitution", () => { process.env["TEST_CONFIG_VAR"] = "test_api_key_12345" process.env["OPENCODE_CONFIG_CONTENT"] = JSON.stringify({ $schema: "https://opencode.ai/config.json", - theme: "{env:TEST_CONFIG_VAR}", + username: "{env:TEST_CONFIG_VAR}", }) try { @@ -1818,7 +1838,7 @@ describe("OPENCODE_CONFIG_CONTENT token substitution", () => { directory: tmp.path, fn: async () => { const config = await Config.get() - expect(config.theme).toBe("test_api_key_12345") + expect(config.username).toBe("test_api_key_12345") }, }) } finally { @@ -1841,10 +1861,10 @@ describe("OPENCODE_CONFIG_CONTENT token substitution", () => { try { await using tmp = await tmpdir({ init: async (dir) => { - await Bun.write(path.join(dir, "api_key.txt"), "secret_key_from_file") + await Filesystem.write(path.join(dir, "api_key.txt"), "secret_key_from_file") process.env["OPENCODE_CONFIG_CONTENT"] = JSON.stringify({ $schema: "https://opencode.ai/config.json", - theme: "{file:./api_key.txt}", + username: "{file:./api_key.txt}", }) }, }) @@ -1852,7 +1872,7 @@ describe("OPENCODE_CONFIG_CONTENT token substitution", () => { directory: tmp.path, fn: async () => { const config = await Config.get() - expect(config.theme).toBe("secret_key_from_file") + expect(config.username).toBe("secret_key_from_file") }, }) } finally { diff --git a/packages/opencode/test/config/tui.test.ts b/packages/opencode/test/config/tui.test.ts new file mode 100644 index 000000000000..f9de5b041b48 --- /dev/null +++ b/packages/opencode/test/config/tui.test.ts @@ -0,0 +1,510 @@ +import { afterEach, expect, test } from "bun:test" +import path from "path" +import fs from "fs/promises" +import { tmpdir } from "../fixture/fixture" +import { Instance } from "../../src/project/instance" +import { TuiConfig } from "../../src/config/tui" +import { Global } from "../../src/global" +import { Filesystem } from "../../src/util/filesystem" + +const managedConfigDir = process.env.OPENCODE_TEST_MANAGED_CONFIG_DIR! + +afterEach(async () => { + delete process.env.OPENCODE_CONFIG + delete process.env.OPENCODE_TUI_CONFIG + await fs.rm(path.join(Global.Path.config, "tui.json"), { force: true }).catch(() => {}) + await fs.rm(path.join(Global.Path.config, "tui.jsonc"), { force: true }).catch(() => {}) + await fs.rm(managedConfigDir, { force: true, recursive: true }).catch(() => {}) +}) + +test("loads tui config with the same precedence order as server config paths", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(Global.Path.config, "tui.json"), JSON.stringify({ theme: "global" }, null, 2)) + await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ theme: "project" }, null, 2)) + await fs.mkdir(path.join(dir, ".opencode"), { recursive: true }) + await Bun.write( + path.join(dir, ".opencode", "tui.json"), + JSON.stringify({ theme: "local", diff_style: "stacked" }, null, 2), + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("local") + expect(config.diff_style).toBe("stacked") + }, + }) +}) + +test("migrates tui-specific keys from opencode.json when tui.json does not exist", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify( + { + theme: "migrated-theme", + tui: { scroll_speed: 5 }, + keybinds: { app_exit: "ctrl+q" }, + }, + null, + 2, + ), + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("migrated-theme") + expect(config.scroll_speed).toBe(5) + expect(config.keybinds?.app_exit).toBe("ctrl+q") + const text = await Filesystem.readText(path.join(tmp.path, "tui.json")) + expect(JSON.parse(text)).toMatchObject({ + theme: "migrated-theme", + scroll_speed: 5, + }) + const server = JSON.parse(await Filesystem.readText(path.join(tmp.path, "opencode.json"))) + expect(server.theme).toBeUndefined() + expect(server.keybinds).toBeUndefined() + expect(server.tui).toBeUndefined() + expect(await Filesystem.exists(path.join(tmp.path, "opencode.json.tui-migration.bak"))).toBe(true) + expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(true) + }, + }) +}) + +test("migrates project legacy tui keys even when global tui.json already exists", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(Global.Path.config, "tui.json"), JSON.stringify({ theme: "global" }, null, 2)) + await Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify( + { + theme: "project-migrated", + tui: { scroll_speed: 2 }, + }, + null, + 2, + ), + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("project-migrated") + expect(config.scroll_speed).toBe(2) + expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(true) + + const server = JSON.parse(await Filesystem.readText(path.join(tmp.path, "opencode.json"))) + expect(server.theme).toBeUndefined() + expect(server.tui).toBeUndefined() + }, + }) +}) + +test("drops unknown legacy tui keys during migration", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.json"), + JSON.stringify( + { + theme: "migrated-theme", + tui: { scroll_speed: 2, foo: 1 }, + }, + null, + 2, + ), + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("migrated-theme") + expect(config.scroll_speed).toBe(2) + + const text = await Filesystem.readText(path.join(tmp.path, "tui.json")) + const migrated = JSON.parse(text) + expect(migrated.scroll_speed).toBe(2) + expect(migrated.foo).toBeUndefined() + }, + }) +}) + +test("skips migration when opencode.jsonc is syntactically invalid", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.jsonc"), + `{ + "theme": "broken-theme", + "tui": { "scroll_speed": 2 } + "username": "still-broken" +}`, + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBeUndefined() + expect(config.scroll_speed).toBeUndefined() + expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(false) + expect(await Filesystem.exists(path.join(tmp.path, "opencode.jsonc.tui-migration.bak"))).toBe(false) + const source = await Filesystem.readText(path.join(tmp.path, "opencode.jsonc")) + expect(source).toContain('"theme": "broken-theme"') + expect(source).toContain('"tui": { "scroll_speed": 2 }') + }, + }) +}) + +test("skips migration when tui.json already exists", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(dir, "opencode.json"), JSON.stringify({ theme: "legacy" }, null, 2)) + await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ diff_style: "stacked" }, null, 2)) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.diff_style).toBe("stacked") + expect(config.theme).toBeUndefined() + + const server = JSON.parse(await Filesystem.readText(path.join(tmp.path, "opencode.json"))) + expect(server.theme).toBe("legacy") + expect(await Filesystem.exists(path.join(tmp.path, "opencode.json.tui-migration.bak"))).toBe(false) + }, + }) +}) + +test("continues loading tui config when legacy source cannot be stripped", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(dir, "opencode.json"), JSON.stringify({ theme: "readonly-theme" }, null, 2)) + }, + }) + + const source = path.join(tmp.path, "opencode.json") + await fs.chmod(source, 0o444) + + try { + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("readonly-theme") + expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(true) + + const server = JSON.parse(await Filesystem.readText(source)) + expect(server.theme).toBe("readonly-theme") + }, + }) + } finally { + await fs.chmod(source, 0o644) + } +}) + +test("migration backup preserves JSONC comments", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "opencode.jsonc"), + `{ + // top-level comment + "theme": "jsonc-theme", + "tui": { + // nested comment + "scroll_speed": 1.5 + } +}`, + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + await TuiConfig.get() + const backup = await Filesystem.readText(path.join(tmp.path, "opencode.jsonc.tui-migration.bak")) + expect(backup).toContain("// top-level comment") + expect(backup).toContain("// nested comment") + expect(backup).toContain('"theme": "jsonc-theme"') + expect(backup).toContain('"scroll_speed": 1.5') + }, + }) +}) + +test("migrates legacy tui keys across multiple opencode.json levels", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + const nested = path.join(dir, "apps", "client") + await fs.mkdir(nested, { recursive: true }) + await Bun.write(path.join(dir, "opencode.json"), JSON.stringify({ theme: "root-theme" }, null, 2)) + await Bun.write(path.join(nested, "opencode.json"), JSON.stringify({ theme: "nested-theme" }, null, 2)) + }, + }) + + await Instance.provide({ + directory: path.join(tmp.path, "apps", "client"), + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("nested-theme") + expect(await Filesystem.exists(path.join(tmp.path, "tui.json"))).toBe(true) + expect(await Filesystem.exists(path.join(tmp.path, "apps", "client", "tui.json"))).toBe(true) + }, + }) +}) + +test("flattens nested tui key inside tui.json", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "tui.json"), + JSON.stringify({ + theme: "outer", + tui: { scroll_speed: 3, diff_style: "stacked" }, + }), + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.scroll_speed).toBe(3) + expect(config.diff_style).toBe("stacked") + // top-level keys take precedence over nested tui keys + expect(config.theme).toBe("outer") + }, + }) +}) + +test("top-level keys in tui.json take precedence over nested tui key", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write( + path.join(dir, "tui.json"), + JSON.stringify({ + diff_style: "auto", + tui: { diff_style: "stacked", scroll_speed: 2 }, + }), + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.diff_style).toBe("auto") + expect(config.scroll_speed).toBe(2) + }, + }) +}) + +test("project config takes precedence over OPENCODE_TUI_CONFIG (matches OPENCODE_CONFIG)", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ theme: "project", diff_style: "auto" })) + const custom = path.join(dir, "custom-tui.json") + await Bun.write(custom, JSON.stringify({ theme: "custom", diff_style: "stacked" })) + process.env.OPENCODE_TUI_CONFIG = custom + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + // project tui.json overrides the custom path, same as server config precedence + expect(config.theme).toBe("project") + // project also set diff_style, so that wins + expect(config.diff_style).toBe("auto") + }, + }) +}) + +test("merges keybind overrides across precedence layers", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(Global.Path.config, "tui.json"), JSON.stringify({ keybinds: { app_exit: "ctrl+q" } })) + await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ keybinds: { theme_list: "ctrl+k" } })) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.keybinds?.app_exit).toBe("ctrl+q") + expect(config.keybinds?.theme_list).toBe("ctrl+k") + }, + }) +}) + +test("OPENCODE_TUI_CONFIG provides settings when no project config exists", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + const custom = path.join(dir, "custom-tui.json") + await Bun.write(custom, JSON.stringify({ theme: "from-env", diff_style: "stacked" })) + process.env.OPENCODE_TUI_CONFIG = custom + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("from-env") + expect(config.diff_style).toBe("stacked") + }, + }) +}) + +test("does not derive tui path from OPENCODE_CONFIG", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + const customDir = path.join(dir, "custom") + await fs.mkdir(customDir, { recursive: true }) + await Bun.write(path.join(customDir, "opencode.json"), JSON.stringify({ model: "test/model" })) + await Bun.write(path.join(customDir, "tui.json"), JSON.stringify({ theme: "should-not-load" })) + process.env.OPENCODE_CONFIG = path.join(customDir, "opencode.json") + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBeUndefined() + }, + }) +}) + +test("applies env and file substitutions in tui.json", async () => { + const original = process.env.TUI_THEME_TEST + process.env.TUI_THEME_TEST = "env-theme" + try { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(dir, "keybind.txt"), "ctrl+q") + await Bun.write( + path.join(dir, "tui.json"), + JSON.stringify({ + theme: "{env:TUI_THEME_TEST}", + keybinds: { app_exit: "{file:keybind.txt}" }, + }), + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("env-theme") + expect(config.keybinds?.app_exit).toBe("ctrl+q") + }, + }) + } finally { + if (original === undefined) delete process.env.TUI_THEME_TEST + else process.env.TUI_THEME_TEST = original + } +}) + +test("applies file substitutions when first identical token is in a commented line", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(dir, "theme.txt"), "resolved-theme") + await Bun.write( + path.join(dir, "tui.jsonc"), + `{ + // "theme": "{file:theme.txt}", + "theme": "{file:theme.txt}" +}`, + ) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("resolved-theme") + }, + }) +}) + +test("loads managed tui config and gives it highest precedence", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(dir, "tui.json"), JSON.stringify({ theme: "project-theme" }, null, 2)) + await fs.mkdir(managedConfigDir, { recursive: true }) + await Bun.write(path.join(managedConfigDir, "tui.json"), JSON.stringify({ theme: "managed-theme" }, null, 2)) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("managed-theme") + }, + }) +}) + +test("loads .opencode/tui.json", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await fs.mkdir(path.join(dir, ".opencode"), { recursive: true }) + await Bun.write(path.join(dir, ".opencode", "tui.json"), JSON.stringify({ diff_style: "stacked" }, null, 2)) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.diff_style).toBe("stacked") + }, + }) +}) + +test("gracefully falls back when tui.json has invalid JSON", async () => { + await using tmp = await tmpdir({ + init: async (dir) => { + await Bun.write(path.join(dir, "tui.json"), "{ invalid json }") + await fs.mkdir(managedConfigDir, { recursive: true }) + await Bun.write(path.join(managedConfigDir, "tui.json"), JSON.stringify({ theme: "managed-fallback" }, null, 2)) + }, + }) + + await Instance.provide({ + directory: tmp.path, + fn: async () => { + const config = await TuiConfig.get() + expect(config.theme).toBe("managed-fallback") + expect(config.keybinds).toBeDefined() + }, + }) +}) diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index 28d5caa02bba..be6c00cf4457 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -991,388 +991,6 @@ export type GlobalEvent = { payload: Event } -/** - * Custom keybind configurations - */ -export type KeybindsConfig = { - /** - * Leader key for keybind combinations - */ - leader?: string - /** - * Exit the application - */ - app_exit?: string - /** - * Open external editor - */ - editor_open?: string - /** - * List available themes - */ - theme_list?: string - /** - * Toggle sidebar - */ - sidebar_toggle?: string - /** - * Toggle session scrollbar - */ - scrollbar_toggle?: string - /** - * Toggle username visibility - */ - username_toggle?: string - /** - * View status - */ - status_view?: string - /** - * Export session to editor - */ - session_export?: string - /** - * Create a new session - */ - session_new?: string - /** - * List all sessions - */ - session_list?: string - /** - * Show session timeline - */ - session_timeline?: string - /** - * Fork session from message - */ - session_fork?: string - /** - * Rename session - */ - session_rename?: string - /** - * Delete session - */ - session_delete?: string - /** - * Delete stash entry - */ - stash_delete?: string - /** - * Open provider list from model dialog - */ - model_provider_list?: string - /** - * Toggle model favorite status - */ - model_favorite_toggle?: string - /** - * Share current session - */ - session_share?: string - /** - * Unshare current session - */ - session_unshare?: string - /** - * Interrupt current session - */ - session_interrupt?: string - /** - * Compact the session - */ - session_compact?: string - /** - * Scroll messages up by one page - */ - messages_page_up?: string - /** - * Scroll messages down by one page - */ - messages_page_down?: string - /** - * Scroll messages up by one line - */ - messages_line_up?: string - /** - * Scroll messages down by one line - */ - messages_line_down?: string - /** - * Scroll messages up by half page - */ - messages_half_page_up?: string - /** - * Scroll messages down by half page - */ - messages_half_page_down?: string - /** - * Navigate to first message - */ - messages_first?: string - /** - * Navigate to last message - */ - messages_last?: string - /** - * Navigate to next message - */ - messages_next?: string - /** - * Navigate to previous message - */ - messages_previous?: string - /** - * Navigate to last user message - */ - messages_last_user?: string - /** - * Copy message - */ - messages_copy?: string - /** - * Undo message - */ - messages_undo?: string - /** - * Redo message - */ - messages_redo?: string - /** - * Toggle code block concealment in messages - */ - messages_toggle_conceal?: string - /** - * Toggle tool details visibility - */ - tool_details?: string - /** - * List available models - */ - model_list?: string - /** - * Next recently used model - */ - model_cycle_recent?: string - /** - * Previous recently used model - */ - model_cycle_recent_reverse?: string - /** - * Next favorite model - */ - model_cycle_favorite?: string - /** - * Previous favorite model - */ - model_cycle_favorite_reverse?: string - /** - * List available commands - */ - command_list?: string - /** - * List agents - */ - agent_list?: string - /** - * Next agent - */ - agent_cycle?: string - /** - * Previous agent - */ - agent_cycle_reverse?: string - /** - * Cycle model variants - */ - variant_cycle?: string - /** - * Clear input field - */ - input_clear?: string - /** - * Paste from clipboard - */ - input_paste?: string - /** - * Submit input - */ - input_submit?: string - /** - * Insert newline in input - */ - input_newline?: string - /** - * Move cursor left in input - */ - input_move_left?: string - /** - * Move cursor right in input - */ - input_move_right?: string - /** - * Move cursor up in input - */ - input_move_up?: string - /** - * Move cursor down in input - */ - input_move_down?: string - /** - * Select left in input - */ - input_select_left?: string - /** - * Select right in input - */ - input_select_right?: string - /** - * Select up in input - */ - input_select_up?: string - /** - * Select down in input - */ - input_select_down?: string - /** - * Move to start of line in input - */ - input_line_home?: string - /** - * Move to end of line in input - */ - input_line_end?: string - /** - * Select to start of line in input - */ - input_select_line_home?: string - /** - * Select to end of line in input - */ - input_select_line_end?: string - /** - * Move to start of visual line in input - */ - input_visual_line_home?: string - /** - * Move to end of visual line in input - */ - input_visual_line_end?: string - /** - * Select to start of visual line in input - */ - input_select_visual_line_home?: string - /** - * Select to end of visual line in input - */ - input_select_visual_line_end?: string - /** - * Move to start of buffer in input - */ - input_buffer_home?: string - /** - * Move to end of buffer in input - */ - input_buffer_end?: string - /** - * Select to start of buffer in input - */ - input_select_buffer_home?: string - /** - * Select to end of buffer in input - */ - input_select_buffer_end?: string - /** - * Delete line in input - */ - input_delete_line?: string - /** - * Delete to end of line in input - */ - input_delete_to_line_end?: string - /** - * Delete to start of line in input - */ - input_delete_to_line_start?: string - /** - * Backspace in input - */ - input_backspace?: string - /** - * Delete character in input - */ - input_delete?: string - /** - * Undo in input - */ - input_undo?: string - /** - * Redo in input - */ - input_redo?: string - /** - * Move word forward in input - */ - input_word_forward?: string - /** - * Move word backward in input - */ - input_word_backward?: string - /** - * Select word forward in input - */ - input_select_word_forward?: string - /** - * Select word backward in input - */ - input_select_word_backward?: string - /** - * Delete word forward in input - */ - input_delete_word_forward?: string - /** - * Delete word backward in input - */ - input_delete_word_backward?: string - /** - * Previous history item - */ - history_previous?: string - /** - * Next history item - */ - history_next?: string - /** - * Next child session - */ - session_child_cycle?: string - /** - * Previous child session - */ - session_child_cycle_reverse?: string - /** - * Go to parent session - */ - session_parent?: string - /** - * Suspend terminal - */ - terminal_suspend?: string - /** - * Toggle terminal title - */ - terminal_title_toggle?: string - /** - * Toggle tips on home screen - */ - tips_toggle?: string - /** - * Toggle thinking blocks visibility - */ - display_thinking?: string -} - /** * Log level */ @@ -1672,34 +1290,7 @@ export type Config = { * JSON schema reference for configuration validation */ $schema?: string - /** - * Theme name to use for the interface - */ - theme?: string - keybinds?: KeybindsConfig logLevel?: LogLevel - /** - * TUI specific settings - */ - tui?: { - /** - * TUI scroll speed - */ - scroll_speed?: number - /** - * Scroll acceleration settings - */ - scroll_acceleration?: { - /** - * Enable scroll acceleration - */ - enabled: boolean - } - /** - * Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column - */ - diff_style?: "auto" | "stacked" - } server?: ServerConfig /** * Command configuration, see https://opencode.ai/docs/commands diff --git a/packages/web/astro.config.mjs b/packages/web/astro.config.mjs index b14a7ccb8f8e..612d4fb8cdd9 100644 --- a/packages/web/astro.config.mjs +++ b/packages/web/astro.config.mjs @@ -314,7 +314,7 @@ function configSchema() { hooks: { "astro:build:done": async () => { console.log("generating config schema") - spawnSync("../opencode/script/schema.ts", ["./dist/config.json"]) + spawnSync("../opencode/script/schema.ts", ["./dist/config.json", "./dist/tui.json"]) }, }, } diff --git a/packages/web/src/content/docs/cli.mdx b/packages/web/src/content/docs/cli.mdx index c504f734fa5d..6b1c3dee57e2 100644 --- a/packages/web/src/content/docs/cli.mdx +++ b/packages/web/src/content/docs/cli.mdx @@ -558,6 +558,7 @@ OpenCode can be configured using environment variables. | `OPENCODE_AUTO_SHARE` | boolean | Automatically share sessions | | `OPENCODE_GIT_BASH_PATH` | string | Path to Git Bash executable on Windows | | `OPENCODE_CONFIG` | string | Path to config file | +| `OPENCODE_TUI_CONFIG` | string | Path to TUI config file | | `OPENCODE_CONFIG_DIR` | string | Path to config directory | | `OPENCODE_CONFIG_CONTENT` | string | Inline json config content | | `OPENCODE_DISABLE_AUTOUPDATE` | boolean | Disable automatic update checks | diff --git a/packages/web/src/content/docs/config.mdx b/packages/web/src/content/docs/config.mdx index eeccde2f7913..038f253274e9 100644 --- a/packages/web/src/content/docs/config.mdx +++ b/packages/web/src/content/docs/config.mdx @@ -14,10 +14,11 @@ OpenCode supports both **JSON** and **JSONC** (JSON with Comments) formats. ```jsonc title="opencode.jsonc" { "$schema": "https://opencode.ai/config.json", - // Theme configuration - "theme": "opencode", "model": "anthropic/claude-sonnet-4-5", "autoupdate": true, + "server": { + "port": 4096, + }, } ``` @@ -34,7 +35,7 @@ Configuration files are **merged together**, not replaced. Configuration files are merged together, not replaced. Settings from the following config locations are combined. Later configs override earlier ones only for conflicting keys. Non-conflicting settings from all configs are preserved. -For example, if your global config sets `theme: "opencode"` and `autoupdate: true`, and your project config sets `model: "anthropic/claude-sonnet-4-5"`, the final configuration will include all three settings. +For example, if your global config sets `autoupdate: true` and your project config sets `model: "anthropic/claude-sonnet-4-5"`, the final configuration will include both settings. --- @@ -95,7 +96,9 @@ You can enable specific servers in your local config: ### Global -Place your global OpenCode config in `~/.config/opencode/opencode.json`. Use global config for user-wide preferences like themes, providers, or keybinds. +Place your global OpenCode config in `~/.config/opencode/opencode.json`. Use global config for user-wide server/runtime preferences like providers, models, and permissions. + +For TUI-specific settings, use `~/.config/opencode/tui.json`. Global config overrides remote organizational defaults. @@ -105,6 +108,8 @@ Global config overrides remote organizational defaults. Add `opencode.json` in your project root. Project config has the highest precedence among standard config files - it overrides both global and remote configs. +For project-specific TUI settings, add `tui.json` alongside it. + :::tip Place project specific config in the root of your project. ::: @@ -146,7 +151,9 @@ The custom directory is loaded after the global config and `.opencode` directori ## Schema -The config file has a schema that's defined in [**`opencode.ai/config.json`**](https://opencode.ai/config.json). +The server/runtime config schema is defined in [**`opencode.ai/config.json`**](https://opencode.ai/config.json). + +TUI config uses [**`opencode.ai/tui.json`**](https://opencode.ai/tui.json). Your editor should be able to validate and autocomplete based on the schema. @@ -154,28 +161,24 @@ Your editor should be able to validate and autocomplete based on the schema. ### TUI -You can configure TUI-specific settings through the `tui` option. +Use a dedicated `tui.json` (or `tui.jsonc`) file for TUI-specific settings. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - }, - "diff_style": "auto" - } + "$schema": "https://opencode.ai/tui.json", + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` -Available options: +Use `OPENCODE_TUI_CONFIG` to point to a custom TUI config file. -- `scroll_acceleration.enabled` - Enable macOS-style scroll acceleration. **Takes precedence over `scroll_speed`.** -- `scroll_speed` - Custom scroll speed multiplier (default: `3`, minimum: `1`). Ignored if `scroll_acceleration.enabled` is `true`. -- `diff_style` - Control diff rendering. `"auto"` adapts to terminal width, `"stacked"` always shows single column. +Legacy `theme`, `keybinds`, and `tui` keys in `opencode.json` are deprecated and automatically migrated when possible. -[Learn more about using the TUI here](/docs/tui). +[Learn more about TUI configuration here](/docs/tui#configure). --- @@ -301,12 +304,12 @@ Bearer tokens (`AWS_BEARER_TOKEN_BEDROCK` or `/connect`) take precedence over pr ### Themes -You can configure the theme you want to use in your OpenCode config through the `theme` option. +Set your UI theme in `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "theme": "" + "$schema": "https://opencode.ai/tui.json", + "theme": "tokyonight" } ``` @@ -406,11 +409,11 @@ You can also define commands using markdown files in `~/.config/opencode/command ### Keybinds -You can customize your keybinds through the `keybinds` option. +Customize keybinds in `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": {} } ``` diff --git a/packages/web/src/content/docs/keybinds.mdx b/packages/web/src/content/docs/keybinds.mdx index 25fe2a1d9100..95b3d496391d 100644 --- a/packages/web/src/content/docs/keybinds.mdx +++ b/packages/web/src/content/docs/keybinds.mdx @@ -3,11 +3,11 @@ title: Keybinds description: Customize your keybinds. --- -OpenCode has a list of keybinds that you can customize through the OpenCode config. +OpenCode has a list of keybinds that you can customize through `tui.json`. -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d,q", @@ -117,11 +117,11 @@ You don't need to use a leader key for your keybinds but we recommend doing so. ## Disable keybind -You can disable a keybind by adding the key to your config with a value of "none". +You can disable a keybind by adding the key to `tui.json` with a value of "none". -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "keybinds": { "session_compact": "none" } diff --git a/packages/web/src/content/docs/themes.mdx b/packages/web/src/content/docs/themes.mdx index d37ce3135569..8a7c6a46ac8a 100644 --- a/packages/web/src/content/docs/themes.mdx +++ b/packages/web/src/content/docs/themes.mdx @@ -61,11 +61,11 @@ The system theme is for users who: ## Using a theme -You can select a theme by bringing up the theme select with the `/theme` command. Or you can specify it in your [config](/docs/config). +You can select a theme by bringing up the theme select with the `/theme` command. Or you can specify it in `tui.json`. -```json title="opencode.json" {3} +```json title="tui.json" {3} { - "$schema": "https://opencode.ai/config.json", + "$schema": "https://opencode.ai/tui.json", "theme": "tokyonight" } ``` diff --git a/packages/web/src/content/docs/tui.mdx b/packages/web/src/content/docs/tui.mdx index 1e48d42ccb1e..010e8328f419 100644 --- a/packages/web/src/content/docs/tui.mdx +++ b/packages/web/src/content/docs/tui.mdx @@ -355,24 +355,34 @@ Some editors need command-line arguments to run in blocking mode. The `--wait` f ## Configure -You can customize TUI behavior through your OpenCode config file. +You can customize TUI behavior through `tui.json` (or `tui.jsonc`). -```json title="opencode.json" +```json title="tui.json" { - "$schema": "https://opencode.ai/config.json", - "tui": { - "scroll_speed": 3, - "scroll_acceleration": { - "enabled": true - } - } + "$schema": "https://opencode.ai/tui.json", + "theme": "opencode", + "keybinds": { + "leader": "ctrl+x" + }, + "scroll_speed": 3, + "scroll_acceleration": { + "enabled": true + }, + "diff_style": "auto" } ``` +This is separate from `opencode.json`, which configures server/runtime behavior. + ### Options -- `scroll_acceleration` - Enable macOS-style scroll acceleration for smooth, natural scrolling. When enabled, scroll speed increases with rapid scrolling gestures and stays precise for slower movements. **This setting takes precedence over `scroll_speed` and overrides it when enabled.** -- `scroll_speed` - Controls how fast the TUI scrolls when using scroll commands (minimum: `1`). Defaults to `3`. **Note: This is ignored if `scroll_acceleration.enabled` is set to `true`.** +- `theme` - Sets your UI theme. [Learn more](/docs/themes). +- `keybinds` - Customizes keyboard shortcuts. [Learn more](/docs/keybinds). +- `scroll_acceleration.enabled` - Enable macOS-style scroll acceleration for smooth, natural scrolling. When enabled, scroll speed increases with rapid scrolling gestures and stays precise for slower movements. **This setting takes precedence over `scroll_speed` and overrides it when enabled.** +- `scroll_speed` - Controls how fast the TUI scrolls when using scroll commands (minimum: `0.001`, supports decimal values). Defaults to `3`. **Note: This is ignored if `scroll_acceleration.enabled` is set to `true`.** +- `diff_style` - Controls diff rendering. `"auto"` adapts to terminal width, `"stacked"` always shows a single-column layout. + +Use `OPENCODE_TUI_CONFIG` to load a custom TUI config path. --- From 4551282a4b95cd3f7e6ea4b6ba6a83dd747bb3a0 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Wed, 25 Feb 2026 22:55:09 +0000 Subject: [PATCH 90/95] chore: generate --- packages/sdk/openapi.json | 511 -------------------------------------- 1 file changed, 511 deletions(-) diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json index 80a4a8d72ae0..0f9c6f0203c2 100644 --- a/packages/sdk/openapi.json +++ b/packages/sdk/openapi.json @@ -8721,483 +8721,6 @@ }, "required": ["directory", "payload"] }, - "KeybindsConfig": { - "description": "Custom keybind configurations", - "type": "object", - "properties": { - "leader": { - "description": "Leader key for keybind combinations", - "default": "ctrl+x", - "type": "string" - }, - "app_exit": { - "description": "Exit the application", - "default": "ctrl+c,ctrl+d,q", - "type": "string" - }, - "editor_open": { - "description": "Open external editor", - "default": "e", - "type": "string" - }, - "theme_list": { - "description": "List available themes", - "default": "t", - "type": "string" - }, - "sidebar_toggle": { - "description": "Toggle sidebar", - "default": "b", - "type": "string" - }, - "scrollbar_toggle": { - "description": "Toggle session scrollbar", - "default": "none", - "type": "string" - }, - "username_toggle": { - "description": "Toggle username visibility", - "default": "none", - "type": "string" - }, - "status_view": { - "description": "View status", - "default": "s", - "type": "string" - }, - "session_export": { - "description": "Export session to editor", - "default": "x", - "type": "string" - }, - "session_new": { - "description": "Create a new session", - "default": "n", - "type": "string" - }, - "session_list": { - "description": "List all sessions", - "default": "l", - "type": "string" - }, - "session_timeline": { - "description": "Show session timeline", - "default": "g", - "type": "string" - }, - "session_fork": { - "description": "Fork session from message", - "default": "none", - "type": "string" - }, - "session_rename": { - "description": "Rename session", - "default": "ctrl+r", - "type": "string" - }, - "session_delete": { - "description": "Delete session", - "default": "ctrl+d", - "type": "string" - }, - "stash_delete": { - "description": "Delete stash entry", - "default": "ctrl+d", - "type": "string" - }, - "model_provider_list": { - "description": "Open provider list from model dialog", - "default": "ctrl+a", - "type": "string" - }, - "model_favorite_toggle": { - "description": "Toggle model favorite status", - "default": "ctrl+f", - "type": "string" - }, - "session_share": { - "description": "Share current session", - "default": "none", - "type": "string" - }, - "session_unshare": { - "description": "Unshare current session", - "default": "none", - "type": "string" - }, - "session_interrupt": { - "description": "Interrupt current session", - "default": "escape", - "type": "string" - }, - "session_compact": { - "description": "Compact the session", - "default": "c", - "type": "string" - }, - "messages_page_up": { - "description": "Scroll messages up by one page", - "default": "pageup,ctrl+alt+b", - "type": "string" - }, - "messages_page_down": { - "description": "Scroll messages down by one page", - "default": "pagedown,ctrl+alt+f", - "type": "string" - }, - "messages_line_up": { - "description": "Scroll messages up by one line", - "default": "ctrl+alt+y", - "type": "string" - }, - "messages_line_down": { - "description": "Scroll messages down by one line", - "default": "ctrl+alt+e", - "type": "string" - }, - "messages_half_page_up": { - "description": "Scroll messages up by half page", - "default": "ctrl+alt+u", - "type": "string" - }, - "messages_half_page_down": { - "description": "Scroll messages down by half page", - "default": "ctrl+alt+d", - "type": "string" - }, - "messages_first": { - "description": "Navigate to first message", - "default": "ctrl+g,home", - "type": "string" - }, - "messages_last": { - "description": "Navigate to last message", - "default": "ctrl+alt+g,end", - "type": "string" - }, - "messages_next": { - "description": "Navigate to next message", - "default": "none", - "type": "string" - }, - "messages_previous": { - "description": "Navigate to previous message", - "default": "none", - "type": "string" - }, - "messages_last_user": { - "description": "Navigate to last user message", - "default": "none", - "type": "string" - }, - "messages_copy": { - "description": "Copy message", - "default": "y", - "type": "string" - }, - "messages_undo": { - "description": "Undo message", - "default": "u", - "type": "string" - }, - "messages_redo": { - "description": "Redo message", - "default": "r", - "type": "string" - }, - "messages_toggle_conceal": { - "description": "Toggle code block concealment in messages", - "default": "h", - "type": "string" - }, - "tool_details": { - "description": "Toggle tool details visibility", - "default": "none", - "type": "string" - }, - "model_list": { - "description": "List available models", - "default": "m", - "type": "string" - }, - "model_cycle_recent": { - "description": "Next recently used model", - "default": "f2", - "type": "string" - }, - "model_cycle_recent_reverse": { - "description": "Previous recently used model", - "default": "shift+f2", - "type": "string" - }, - "model_cycle_favorite": { - "description": "Next favorite model", - "default": "none", - "type": "string" - }, - "model_cycle_favorite_reverse": { - "description": "Previous favorite model", - "default": "none", - "type": "string" - }, - "command_list": { - "description": "List available commands", - "default": "ctrl+p", - "type": "string" - }, - "agent_list": { - "description": "List agents", - "default": "a", - "type": "string" - }, - "agent_cycle": { - "description": "Next agent", - "default": "tab", - "type": "string" - }, - "agent_cycle_reverse": { - "description": "Previous agent", - "default": "shift+tab", - "type": "string" - }, - "variant_cycle": { - "description": "Cycle model variants", - "default": "ctrl+t", - "type": "string" - }, - "input_clear": { - "description": "Clear input field", - "default": "ctrl+c", - "type": "string" - }, - "input_paste": { - "description": "Paste from clipboard", - "default": "ctrl+v", - "type": "string" - }, - "input_submit": { - "description": "Submit input", - "default": "return", - "type": "string" - }, - "input_newline": { - "description": "Insert newline in input", - "default": "shift+return,ctrl+return,alt+return,ctrl+j", - "type": "string" - }, - "input_move_left": { - "description": "Move cursor left in input", - "default": "left,ctrl+b", - "type": "string" - }, - "input_move_right": { - "description": "Move cursor right in input", - "default": "right,ctrl+f", - "type": "string" - }, - "input_move_up": { - "description": "Move cursor up in input", - "default": "up", - "type": "string" - }, - "input_move_down": { - "description": "Move cursor down in input", - "default": "down", - "type": "string" - }, - "input_select_left": { - "description": "Select left in input", - "default": "shift+left", - "type": "string" - }, - "input_select_right": { - "description": "Select right in input", - "default": "shift+right", - "type": "string" - }, - "input_select_up": { - "description": "Select up in input", - "default": "shift+up", - "type": "string" - }, - "input_select_down": { - "description": "Select down in input", - "default": "shift+down", - "type": "string" - }, - "input_line_home": { - "description": "Move to start of line in input", - "default": "ctrl+a", - "type": "string" - }, - "input_line_end": { - "description": "Move to end of line in input", - "default": "ctrl+e", - "type": "string" - }, - "input_select_line_home": { - "description": "Select to start of line in input", - "default": "ctrl+shift+a", - "type": "string" - }, - "input_select_line_end": { - "description": "Select to end of line in input", - "default": "ctrl+shift+e", - "type": "string" - }, - "input_visual_line_home": { - "description": "Move to start of visual line in input", - "default": "alt+a", - "type": "string" - }, - "input_visual_line_end": { - "description": "Move to end of visual line in input", - "default": "alt+e", - "type": "string" - }, - "input_select_visual_line_home": { - "description": "Select to start of visual line in input", - "default": "alt+shift+a", - "type": "string" - }, - "input_select_visual_line_end": { - "description": "Select to end of visual line in input", - "default": "alt+shift+e", - "type": "string" - }, - "input_buffer_home": { - "description": "Move to start of buffer in input", - "default": "home", - "type": "string" - }, - "input_buffer_end": { - "description": "Move to end of buffer in input", - "default": "end", - "type": "string" - }, - "input_select_buffer_home": { - "description": "Select to start of buffer in input", - "default": "shift+home", - "type": "string" - }, - "input_select_buffer_end": { - "description": "Select to end of buffer in input", - "default": "shift+end", - "type": "string" - }, - "input_delete_line": { - "description": "Delete line in input", - "default": "ctrl+shift+d", - "type": "string" - }, - "input_delete_to_line_end": { - "description": "Delete to end of line in input", - "default": "ctrl+k", - "type": "string" - }, - "input_delete_to_line_start": { - "description": "Delete to start of line in input", - "default": "ctrl+u", - "type": "string" - }, - "input_backspace": { - "description": "Backspace in input", - "default": "backspace,shift+backspace", - "type": "string" - }, - "input_delete": { - "description": "Delete character in input", - "default": "ctrl+d,delete,shift+delete", - "type": "string" - }, - "input_undo": { - "description": "Undo in input", - "default": "ctrl+-,super+z", - "type": "string" - }, - "input_redo": { - "description": "Redo in input", - "default": "ctrl+.,super+shift+z", - "type": "string" - }, - "input_word_forward": { - "description": "Move word forward in input", - "default": "alt+f,alt+right,ctrl+right", - "type": "string" - }, - "input_word_backward": { - "description": "Move word backward in input", - "default": "alt+b,alt+left,ctrl+left", - "type": "string" - }, - "input_select_word_forward": { - "description": "Select word forward in input", - "default": "alt+shift+f,alt+shift+right", - "type": "string" - }, - "input_select_word_backward": { - "description": "Select word backward in input", - "default": "alt+shift+b,alt+shift+left", - "type": "string" - }, - "input_delete_word_forward": { - "description": "Delete word forward in input", - "default": "alt+d,alt+delete,ctrl+delete", - "type": "string" - }, - "input_delete_word_backward": { - "description": "Delete word backward in input", - "default": "ctrl+w,ctrl+backspace,alt+backspace", - "type": "string" - }, - "history_previous": { - "description": "Previous history item", - "default": "up", - "type": "string" - }, - "history_next": { - "description": "Next history item", - "default": "down", - "type": "string" - }, - "session_child_cycle": { - "description": "Next child session", - "default": "right", - "type": "string" - }, - "session_child_cycle_reverse": { - "description": "Previous child session", - "default": "left", - "type": "string" - }, - "session_parent": { - "description": "Go to parent session", - "default": "up", - "type": "string" - }, - "terminal_suspend": { - "description": "Suspend terminal", - "default": "ctrl+z", - "type": "string" - }, - "terminal_title_toggle": { - "description": "Toggle terminal title", - "default": "none", - "type": "string" - }, - "tips_toggle": { - "description": "Toggle tips on home screen", - "default": "h", - "type": "string" - }, - "display_thinking": { - "description": "Toggle thinking blocks visibility", - "default": "none", - "type": "string" - } - }, - "additionalProperties": false - }, "LogLevel": { "description": "Log level", "type": "string", @@ -9777,43 +9300,9 @@ "description": "JSON schema reference for configuration validation", "type": "string" }, - "theme": { - "description": "Theme name to use for the interface", - "type": "string" - }, - "keybinds": { - "$ref": "#/components/schemas/KeybindsConfig" - }, "logLevel": { "$ref": "#/components/schemas/LogLevel" }, - "tui": { - "description": "TUI specific settings", - "type": "object", - "properties": { - "scroll_speed": { - "description": "TUI scroll speed", - "type": "number", - "minimum": 0.001 - }, - "scroll_acceleration": { - "description": "Scroll acceleration settings", - "type": "object", - "properties": { - "enabled": { - "description": "Enable scroll acceleration", - "type": "boolean" - } - }, - "required": ["enabled"] - }, - "diff_style": { - "description": "Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column", - "type": "string", - "enum": ["auto", "stacked"] - } - } - }, "server": { "$ref": "#/components/schemas/ServerConfig" }, From 444178e079fb41ba2149a1cdfdd3040593715d70 Mon Sep 17 00:00:00 2001 From: OpeOginni <107570612+OpeOginni@users.noreply.github.com> Date: Thu, 26 Feb 2026 00:16:39 +0100 Subject: [PATCH 91/95] fix(docs): update schema URL in share configuration examples across multiple languages (#15114) --- packages/web/src/content/docs/ar/share.mdx | 6 +++--- packages/web/src/content/docs/bs/share.mdx | 6 +++--- packages/web/src/content/docs/da/share.mdx | 6 +++--- packages/web/src/content/docs/de/share.mdx | 6 +++--- packages/web/src/content/docs/es/share.mdx | 6 +++--- packages/web/src/content/docs/fr/share.mdx | 6 +++--- packages/web/src/content/docs/it/share.mdx | 6 +++--- packages/web/src/content/docs/ja/share.mdx | 6 +++--- packages/web/src/content/docs/ko/share.mdx | 6 +++--- packages/web/src/content/docs/nb/share.mdx | 6 +++--- packages/web/src/content/docs/pl/share.mdx | 6 +++--- packages/web/src/content/docs/pt-br/share.mdx | 6 +++--- packages/web/src/content/docs/ru/share.mdx | 6 +++--- packages/web/src/content/docs/share.mdx | 6 +++--- packages/web/src/content/docs/th/share.mdx | 6 +++--- packages/web/src/content/docs/tr/share.mdx | 6 +++--- packages/web/src/content/docs/zh-cn/share.mdx | 6 +++--- packages/web/src/content/docs/zh-tw/share.mdx | 6 +++--- 18 files changed, 54 insertions(+), 54 deletions(-) diff --git a/packages/web/src/content/docs/ar/share.mdx b/packages/web/src/content/docs/ar/share.mdx index 535d44dadf83..6d13410458cd 100644 --- a/packages/web/src/content/docs/ar/share.mdx +++ b/packages/web/src/content/docs/ar/share.mdx @@ -41,7 +41,7 @@ description: شارك محادثات OpenCode الخاصة بك. ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ description: شارك محادثات OpenCode الخاصة بك. ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ description: شارك محادثات OpenCode الخاصة بك. ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/bs/share.mdx b/packages/web/src/content/docs/bs/share.mdx index a15e15074349..b0760ee0c138 100644 --- a/packages/web/src/content/docs/bs/share.mdx +++ b/packages/web/src/content/docs/bs/share.mdx @@ -41,7 +41,7 @@ Da eksplicitno postavite rucni nacin u [config datoteci](/docs/config): ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ Mozete ukljuciti automatsko dijeljenje za sve nove razgovore tako sto `share` po ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ Dijeljenje mozete potpuno iskljuciti tako sto `share` postavite na `"disabled"` ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/da/share.mdx b/packages/web/src/content/docs/da/share.mdx index 1ac2094ca700..80b9f0959e2c 100644 --- a/packages/web/src/content/docs/da/share.mdx +++ b/packages/web/src/content/docs/da/share.mdx @@ -41,7 +41,7 @@ For at eksplisitt angi manuell modus i [konfigurasjonsfilen](/docs/config): ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ Du kan aktivere automatisk deling for alle nye samtaler ved at sette alternative ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ Du kan deaktivere deling helt ved at sette alternativet `share` til `"disabled"` ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/de/share.mdx b/packages/web/src/content/docs/de/share.mdx index 99fad21099b0..9b7e9284c7ac 100644 --- a/packages/web/src/content/docs/de/share.mdx +++ b/packages/web/src/content/docs/de/share.mdx @@ -43,7 +43,7 @@ Um den manuellen Modus explizit in der [Konfiguration](/docs/config) zu setzen: ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -56,7 +56,7 @@ Du kannst automatisches Teilen fuer neue Unterhaltungen aktivieren, indem du in ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -71,7 +71,7 @@ Du kannst Teilen komplett deaktivieren, indem du in der [Konfiguration](/docs/co ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/es/share.mdx b/packages/web/src/content/docs/es/share.mdx index e1c62a031c04..3bb376f38625 100644 --- a/packages/web/src/content/docs/es/share.mdx +++ b/packages/web/src/content/docs/es/share.mdx @@ -41,7 +41,7 @@ Para configurar explícitamente el modo manual en su [archivo de configuración] ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ Puede habilitar el uso compartido automático para todas las conversaciones nuev ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ Puede desactivar el uso compartido por completo configurando la opción `share` ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/fr/share.mdx b/packages/web/src/content/docs/fr/share.mdx index acc7c03f83e9..e6b067a8c82a 100644 --- a/packages/web/src/content/docs/fr/share.mdx +++ b/packages/web/src/content/docs/fr/share.mdx @@ -41,7 +41,7 @@ Pour définir explicitement le mode manuel dans votre [fichier de configuration] ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ Vous pouvez activer le partage automatique pour toutes les nouvelles conversatio ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ Vous pouvez désactiver entièrement le partage en définissant l'option `share` ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/it/share.mdx b/packages/web/src/content/docs/it/share.mdx index f9eff6ca9bd5..9b410a6b8654 100644 --- a/packages/web/src/content/docs/it/share.mdx +++ b/packages/web/src/content/docs/it/share.mdx @@ -41,7 +41,7 @@ Per impostare esplicitamente la modalita manuale nel tuo [file di config](/docs/ ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ Puoi abilitare la condivisione automatica per tutte le nuove conversazioni impos ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ Puoi disabilitare completamente la condivisione impostando l'opzione `share` su ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/ja/share.mdx b/packages/web/src/content/docs/ja/share.mdx index 7995ba9a075e..606e807dc8aa 100644 --- a/packages/web/src/content/docs/ja/share.mdx +++ b/packages/web/src/content/docs/ja/share.mdx @@ -41,7 +41,7 @@ OpenCode は、会話の共有方法を制御する 3 つの共有モードを ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ OpenCode は、会話の共有方法を制御する 3 つの共有モードを ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ OpenCode は、会話の共有方法を制御する 3 つの共有モードを ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/ko/share.mdx b/packages/web/src/content/docs/ko/share.mdx index 55cf6a2c3e39..9e5c6388243e 100644 --- a/packages/web/src/content/docs/ko/share.mdx +++ b/packages/web/src/content/docs/ko/share.mdx @@ -41,7 +41,7 @@ opencode는 대화가 공유되는 방법을 제어하는 세 가지 공유 모 ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ opencode는 대화가 공유되는 방법을 제어하는 세 가지 공유 모 ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ opencode는 대화가 공유되는 방법을 제어하는 세 가지 공유 모 ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/nb/share.mdx b/packages/web/src/content/docs/nb/share.mdx index 370477d1cfc5..ca0cb4829acb 100644 --- a/packages/web/src/content/docs/nb/share.mdx +++ b/packages/web/src/content/docs/nb/share.mdx @@ -41,7 +41,7 @@ For å eksplisitt angi manuell modus i [konfigurasjonsfilen](/docs/config): ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ Du kan aktivere automatisk deling for alle nye samtaler ved å sette alternative ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ Du kan deaktivere deling helt ved å sette alternativet `share` til `"disabled"` ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/pl/share.mdx b/packages/web/src/content/docs/pl/share.mdx index 463019295a3f..0389267b59ad 100644 --- a/packages/web/src/content/docs/pl/share.mdx +++ b/packages/web/src/content/docs/pl/share.mdx @@ -41,7 +41,7 @@ Aby jawnie ustawić tryb ręczny w [pliku konfiguracyjnym] (./config): ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ Możesz włączyć automatyczne udostępnianie dla wszystkich nowych rozmów, us ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ Możesz całkowicie wyłączyć udostępnianie, ustawiając opcję `share` na `" ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/pt-br/share.mdx b/packages/web/src/content/docs/pt-br/share.mdx index 5aa0439d068b..166226d6dc28 100644 --- a/packages/web/src/content/docs/pt-br/share.mdx +++ b/packages/web/src/content/docs/pt-br/share.mdx @@ -41,7 +41,7 @@ Para definir explicitamente o modo manual em seu [arquivo de configuração](/do ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ Você pode habilitar o compartilhamento automático para todas as novas conversa ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ Você pode desativar o compartilhamento completamente definindo a opção `share ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/ru/share.mdx b/packages/web/src/content/docs/ru/share.mdx index c4df3b6a7032..8982afb08dfb 100644 --- a/packages/web/src/content/docs/ru/share.mdx +++ b/packages/web/src/content/docs/ru/share.mdx @@ -41,7 +41,7 @@ opencode поддерживает три режима общего доступ ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ opencode поддерживает три режима общего доступ ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ opencode поддерживает три режима общего доступ ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/share.mdx b/packages/web/src/content/docs/share.mdx index 475ee08d041c..b2c79334097d 100644 --- a/packages/web/src/content/docs/share.mdx +++ b/packages/web/src/content/docs/share.mdx @@ -41,7 +41,7 @@ To explicitly set manual mode in your [config file](/docs/config): ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ You can enable automatic sharing for all new conversations by setting the `share ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ You can disable sharing entirely by setting the `share` option to `"disabled"` i ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/th/share.mdx b/packages/web/src/content/docs/th/share.mdx index 195d7696f9b1..91bfce44172c 100644 --- a/packages/web/src/content/docs/th/share.mdx +++ b/packages/web/src/content/docs/th/share.mdx @@ -41,7 +41,7 @@ OpenCode รองรับโหมดการแชร์สามโหม ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ OpenCode รองรับโหมดการแชร์สามโหม ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ OpenCode รองรับโหมดการแชร์สามโหม ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/tr/share.mdx b/packages/web/src/content/docs/tr/share.mdx index 1b7abfdb7ea0..a0544eb02aa8 100644 --- a/packages/web/src/content/docs/tr/share.mdx +++ b/packages/web/src/content/docs/tr/share.mdx @@ -41,7 +41,7 @@ Manuel modu acikca ayarlamak icin [config dosyaniza](/docs/config) sunu ekleyin: ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ Tum yeni konusmalar icin otomatik paylasimi acmak isterseniz, [config dosyanizda ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ Paylasimi tamamen kapatmak icin [config dosyanizda](/docs/config) `share` degeri ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/zh-cn/share.mdx b/packages/web/src/content/docs/zh-cn/share.mdx index 8a7be16dc91f..a2b34688e4dc 100644 --- a/packages/web/src/content/docs/zh-cn/share.mdx +++ b/packages/web/src/content/docs/zh-cn/share.mdx @@ -41,7 +41,7 @@ OpenCode 支持三种分享模式,用于控制对话的共享方式: ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ OpenCode 支持三种分享模式,用于控制对话的共享方式: ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ OpenCode 支持三种分享模式,用于控制对话的共享方式: ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` diff --git a/packages/web/src/content/docs/zh-tw/share.mdx b/packages/web/src/content/docs/zh-tw/share.mdx index 1512007bc356..58365035b640 100644 --- a/packages/web/src/content/docs/zh-tw/share.mdx +++ b/packages/web/src/content/docs/zh-tw/share.mdx @@ -41,7 +41,7 @@ OpenCode 支援三種分享模式,用於控制對話的共享方式: ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "manual" } ``` @@ -54,7 +54,7 @@ OpenCode 支援三種分享模式,用於控制對話的共享方式: ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "auto" } ``` @@ -69,7 +69,7 @@ OpenCode 支援三種分享模式,用於控制對話的共享方式: ```json title="opencode.json" { - "$schema": "https://opncd.ai/config.json", + "$schema": "https://opencode.ai/config.json", "share": "disabled" } ``` From b8337cddc4269ba6e72f74c1e1f39aae41f56af3 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Wed, 25 Feb 2026 19:05:08 -0600 Subject: [PATCH 92/95] fix(app): permissions and questions from child sessions (#15105) Co-authored-by: adamelmore <2363879+adamdottv@users.noreply.github.com> --- .../e2e/session/session-composer-dock.spec.ts | 298 +++++++++++++--- packages/app/src/pages/directory-layout.tsx | 11 +- .../composer/session-composer-state.test.ts | 83 +++++ .../composer/session-composer-state.ts | 22 +- .../session/composer/session-request-tree.ts | 45 +++ packages/ui/src/components/message-part.css | 101 +----- packages/ui/src/components/message-part.tsx | 325 +----------------- packages/ui/src/context/data.tsx | 34 +- 8 files changed, 393 insertions(+), 526 deletions(-) create mode 100644 packages/app/src/pages/session/composer/session-composer-state.test.ts create mode 100644 packages/app/src/pages/session/composer/session-request-tree.ts diff --git a/packages/app/e2e/session/session-composer-dock.spec.ts b/packages/app/e2e/session/session-composer-dock.spec.ts index 6bf7714a66d1..e9cfc03e4857 100644 --- a/packages/app/e2e/session/session-composer-dock.spec.ts +++ b/packages/app/e2e/session/session-composer-dock.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from "../fixtures" -import { clearSessionDockSeed, seedSessionPermission, seedSessionQuestion, seedSessionTodos } from "../actions" +import { clearSessionDockSeed, seedSessionQuestion, seedSessionTodos } from "../actions" import { permissionDockSelector, promptSelector, @@ -11,11 +11,23 @@ import { } from "../selectors" type Sdk = Parameters[0] - -async function withDockSession(sdk: Sdk, title: string, fn: (session: { id: string; title: string }) => Promise) { - const session = await sdk.session.create({ title }).then((r) => r.data) +type PermissionRule = { permission: string; pattern: string; action: "allow" | "deny" | "ask" } + +async function withDockSession( + sdk: Sdk, + title: string, + fn: (session: { id: string; title: string }) => Promise, + opts?: { permission?: PermissionRule[] }, +) { + const session = await sdk.session + .create(opts?.permission ? { title, permission: opts.permission } : { title }) + .then((r) => r.data) if (!session?.id) throw new Error("Session create did not return an id") - return fn(session) + try { + return await fn(session) + } finally { + await sdk.session.delete({ sessionID: session.id }).catch(() => undefined) + } } test.setTimeout(120_000) @@ -28,6 +40,85 @@ async function withDockSeed(sdk: Sdk, sessionID: string, fn: () => Promise } } +async function clearPermissionDock(page: any, label: RegExp) { + const dock = page.locator(permissionDockSelector) + for (let i = 0; i < 3; i++) { + const count = await dock.count() + if (count === 0) return + await dock.getByRole("button", { name: label }).click() + await page.waitForTimeout(150) + } +} + +async function withMockPermission( + page: any, + request: { + id: string + sessionID: string + permission: string + patterns: string[] + metadata?: Record + always?: string[] + }, + opts: { child?: any } | undefined, + fn: () => Promise, +) { + let pending = [ + { + ...request, + always: request.always ?? ["*"], + metadata: request.metadata ?? {}, + }, + ] + + const list = async (route: any) => { + await route.fulfill({ + status: 200, + contentType: "application/json", + body: JSON.stringify(pending), + }) + } + + const reply = async (route: any) => { + const url = new URL(route.request().url()) + const id = url.pathname.split("/").pop() + pending = pending.filter((item) => item.id !== id) + await route.fulfill({ + status: 200, + contentType: "application/json", + body: JSON.stringify(true), + }) + } + + await page.route("**/permission", list) + await page.route("**/session/*/permissions/*", reply) + + const sessionList = opts?.child + ? async (route: any) => { + const res = await route.fetch() + const json = await res.json() + const list = Array.isArray(json) ? json : Array.isArray(json?.data) ? json.data : undefined + if (Array.isArray(list) && !list.some((item) => item?.id === opts.child?.id)) list.push(opts.child) + await route.fulfill({ + status: res.status(), + headers: res.headers(), + contentType: "application/json", + body: JSON.stringify(json), + }) + } + : undefined + + if (sessionList) await page.route("**/session?*", sessionList) + + try { + return await fn() + } finally { + await page.unroute("**/permission", list) + await page.unroute("**/session/*/permissions/*", reply) + if (sessionList) await page.unroute("**/session?*", sessionList) + } +} + test("default dock shows prompt input", async ({ page, sdk, gotoSession }) => { await withDockSession(sdk, "e2e composer dock default", async (session) => { await gotoSession(session.id) @@ -76,72 +167,175 @@ test("blocked question flow unblocks after submit", async ({ page, sdk, gotoSess test("blocked permission flow supports allow once", async ({ page, sdk, gotoSession }) => { await withDockSession(sdk, "e2e composer dock permission once", async (session) => { - await withDockSeed(sdk, session.id, async () => { - await gotoSession(session.id) - - await seedSessionPermission(sdk, { + await gotoSession(session.id) + await withMockPermission( + page, + { + id: "per_e2e_once", sessionID: session.id, permission: "bash", - patterns: ["README.md"], - description: "Need permission for command", - }) - - await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(1) - await expect(page.locator(promptSelector)).toHaveCount(0) - - await page - .locator(permissionDockSelector) - .getByRole("button", { name: /allow once/i }) - .click() - await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0) - await expect(page.locator(promptSelector)).toBeVisible() - }) + patterns: ["/tmp/opencode-e2e-perm-once"], + metadata: { description: "Need permission for command" }, + }, + undefined, + async () => { + await page.goto(page.url()) + await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(1) + await expect(page.locator(promptSelector)).toHaveCount(0) + + await clearPermissionDock(page, /allow once/i) + await page.goto(page.url()) + await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0) + await expect(page.locator(promptSelector)).toBeVisible() + }, + ) }) }) test("blocked permission flow supports reject", async ({ page, sdk, gotoSession }) => { await withDockSession(sdk, "e2e composer dock permission reject", async (session) => { - await withDockSeed(sdk, session.id, async () => { - await gotoSession(session.id) - - await seedSessionPermission(sdk, { + await gotoSession(session.id) + await withMockPermission( + page, + { + id: "per_e2e_reject", sessionID: session.id, permission: "bash", - patterns: ["REJECT.md"], - }) - - await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(1) - await expect(page.locator(promptSelector)).toHaveCount(0) - - await page.locator(permissionDockSelector).getByRole("button", { name: /deny/i }).click() - await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0) - await expect(page.locator(promptSelector)).toBeVisible() - }) + patterns: ["/tmp/opencode-e2e-perm-reject"], + }, + undefined, + async () => { + await page.goto(page.url()) + await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(1) + await expect(page.locator(promptSelector)).toHaveCount(0) + + await clearPermissionDock(page, /deny/i) + await page.goto(page.url()) + await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0) + await expect(page.locator(promptSelector)).toBeVisible() + }, + ) }) }) test("blocked permission flow supports allow always", async ({ page, sdk, gotoSession }) => { await withDockSession(sdk, "e2e composer dock permission always", async (session) => { - await withDockSeed(sdk, session.id, async () => { - await gotoSession(session.id) - - await seedSessionPermission(sdk, { + await gotoSession(session.id) + await withMockPermission( + page, + { + id: "per_e2e_always", sessionID: session.id, permission: "bash", - patterns: ["README.md"], - description: "Need permission for command", + patterns: ["/tmp/opencode-e2e-perm-always"], + metadata: { description: "Need permission for command" }, + }, + undefined, + async () => { + await page.goto(page.url()) + await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(1) + await expect(page.locator(promptSelector)).toHaveCount(0) + + await clearPermissionDock(page, /allow always/i) + await page.goto(page.url()) + await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0) + await expect(page.locator(promptSelector)).toBeVisible() + }, + ) + }) +}) + +test("child session question request blocks parent dock and unblocks after submit", async ({ + page, + sdk, + gotoSession, +}) => { + await withDockSession(sdk, "e2e composer dock child question parent", async (session) => { + await gotoSession(session.id) + + const child = await sdk.session + .create({ + title: "e2e composer dock child question", + parentID: session.id, + }) + .then((r) => r.data) + if (!child?.id) throw new Error("Child session create did not return an id") + + try { + await withDockSeed(sdk, child.id, async () => { + await seedSessionQuestion(sdk, { + sessionID: child.id, + questions: [ + { + header: "Child input", + question: "Pick one child option", + options: [ + { label: "Continue", description: "Continue child" }, + { label: "Stop", description: "Stop child" }, + ], + }, + ], + }) + + const dock = page.locator(questionDockSelector) + await expect.poll(() => dock.count(), { timeout: 10_000 }).toBe(1) + await expect(page.locator(promptSelector)).toHaveCount(0) + + await dock.locator('[data-slot="question-option"]').first().click() + await dock.getByRole("button", { name: /submit/i }).click() + + await expect.poll(() => page.locator(questionDockSelector).count(), { timeout: 10_000 }).toBe(0) + await expect(page.locator(promptSelector)).toBeVisible() }) + } finally { + await sdk.session.delete({ sessionID: child.id }).catch(() => undefined) + } + }) +}) - await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(1) - await expect(page.locator(promptSelector)).toHaveCount(0) +test("child session permission request blocks parent dock and supports allow once", async ({ + page, + sdk, + gotoSession, +}) => { + await withDockSession(sdk, "e2e composer dock child permission parent", async (session) => { + await gotoSession(session.id) - await page - .locator(permissionDockSelector) - .getByRole("button", { name: /allow always/i }) - .click() - await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0) - await expect(page.locator(promptSelector)).toBeVisible() - }) + const child = await sdk.session + .create({ + title: "e2e composer dock child permission", + parentID: session.id, + }) + .then((r) => r.data) + if (!child?.id) throw new Error("Child session create did not return an id") + + try { + await withMockPermission( + page, + { + id: "per_e2e_child", + sessionID: child.id, + permission: "bash", + patterns: ["/tmp/opencode-e2e-perm-child"], + metadata: { description: "Need child permission" }, + }, + { child }, + async () => { + await page.goto(page.url()) + const dock = page.locator(permissionDockSelector) + await expect.poll(() => dock.count(), { timeout: 10_000 }).toBe(1) + await expect(page.locator(promptSelector)).toHaveCount(0) + + await clearPermissionDock(page, /allow once/i) + await page.goto(page.url()) + + await expect.poll(() => page.locator(permissionDockSelector).count(), { timeout: 10_000 }).toBe(0) + await expect(page.locator(promptSelector)).toBeVisible() + }, + ) + } finally { + await sdk.session.delete({ sessionID: child.id }).catch(() => undefined) + } }) }) diff --git a/packages/app/src/pages/directory-layout.tsx b/packages/app/src/pages/directory-layout.tsx index 4f1d93ab2829..71b52180f2e7 100644 --- a/packages/app/src/pages/directory-layout.tsx +++ b/packages/app/src/pages/directory-layout.tsx @@ -1,12 +1,11 @@ import { createEffect, createMemo, Show, type ParentProps } from "solid-js" import { createStore } from "solid-js/store" import { useNavigate, useParams } from "@solidjs/router" -import { SDKProvider, useSDK } from "@/context/sdk" +import { SDKProvider } from "@/context/sdk" import { SyncProvider, useSync } from "@/context/sync" import { LocalProvider } from "@/context/local" import { DataProvider } from "@opencode-ai/ui/context" -import type { QuestionAnswer } from "@opencode-ai/sdk/v2" import { decode64 } from "@/utils/base64" import { showToast } from "@opencode-ai/ui/toast" import { useLanguage } from "@/context/language" @@ -15,19 +14,11 @@ function DirectoryDataProvider(props: ParentProps<{ directory: string }>) { const params = useParams() const navigate = useNavigate() const sync = useSync() - const sdk = useSDK() return ( sdk.client.permission.respond(input)} - onQuestionReply={(input: { requestID: string; answers: QuestionAnswer[] }) => sdk.client.question.reply(input)} - onQuestionReject={(input: { requestID: string }) => sdk.client.question.reject(input)} onNavigateToSession={(sessionID: string) => navigate(`/${params.dir}/session/${sessionID}`)} onSessionHref={(sessionID: string) => `/${params.dir}/session/${sessionID}`} > diff --git a/packages/app/src/pages/session/composer/session-composer-state.test.ts b/packages/app/src/pages/session/composer/session-composer-state.test.ts new file mode 100644 index 000000000000..7b6029eb31b7 --- /dev/null +++ b/packages/app/src/pages/session/composer/session-composer-state.test.ts @@ -0,0 +1,83 @@ +import { describe, expect, test } from "bun:test" +import type { PermissionRequest, QuestionRequest, Session } from "@opencode-ai/sdk/v2/client" +import { sessionPermissionRequest, sessionQuestionRequest } from "./session-request-tree" + +const session = (input: { id: string; parentID?: string }) => + ({ + id: input.id, + parentID: input.parentID, + }) as Session + +const permission = (id: string, sessionID: string) => + ({ + id, + sessionID, + }) as PermissionRequest + +const question = (id: string, sessionID: string) => + ({ + id, + sessionID, + questions: [], + }) as QuestionRequest + +describe("sessionPermissionRequest", () => { + test("prefers the current session permission", () => { + const sessions = [session({ id: "root" }), session({ id: "child", parentID: "root" })] + const permissions = { + root: [permission("perm-root", "root")], + child: [permission("perm-child", "child")], + } + + expect(sessionPermissionRequest(sessions, permissions, "root")?.id).toBe("perm-root") + }) + + test("returns a nested child permission", () => { + const sessions = [ + session({ id: "root" }), + session({ id: "child", parentID: "root" }), + session({ id: "grand", parentID: "child" }), + session({ id: "other" }), + ] + const permissions = { + grand: [permission("perm-grand", "grand")], + other: [permission("perm-other", "other")], + } + + expect(sessionPermissionRequest(sessions, permissions, "root")?.id).toBe("perm-grand") + }) + + test("returns undefined without a matching tree permission", () => { + const sessions = [session({ id: "root" }), session({ id: "child", parentID: "root" })] + const permissions = { + other: [permission("perm-other", "other")], + } + + expect(sessionPermissionRequest(sessions, permissions, "root")).toBeUndefined() + }) +}) + +describe("sessionQuestionRequest", () => { + test("prefers the current session question", () => { + const sessions = [session({ id: "root" }), session({ id: "child", parentID: "root" })] + const questions = { + root: [question("q-root", "root")], + child: [question("q-child", "child")], + } + + expect(sessionQuestionRequest(sessions, questions, "root")?.id).toBe("q-root") + }) + + test("returns a nested child question", () => { + const sessions = [ + session({ id: "root" }), + session({ id: "child", parentID: "root" }), + session({ id: "grand", parentID: "child" }), + ] + const questions = { + grand: [question("q-grand", "grand")], + } + + expect(sessionQuestionRequest(sessions, questions, "root")?.id).toBe("q-grand") + }) +}) diff --git a/packages/app/src/pages/session/composer/session-composer-state.ts b/packages/app/src/pages/session/composer/session-composer-state.ts index 04c6f7e692a5..ed65867ef00e 100644 --- a/packages/app/src/pages/session/composer/session-composer-state.ts +++ b/packages/app/src/pages/session/composer/session-composer-state.ts @@ -7,14 +7,20 @@ import { useGlobalSync } from "@/context/global-sync" import { useLanguage } from "@/context/language" import { useSDK } from "@/context/sdk" import { useSync } from "@/context/sync" +import { sessionPermissionRequest, sessionQuestionRequest } from "./session-request-tree" export function createSessionComposerBlocked() { const params = useParams() const sync = useSync() + const permissionRequest = createMemo(() => + sessionPermissionRequest(sync.data.session, sync.data.permission, params.id), + ) + const questionRequest = createMemo(() => sessionQuestionRequest(sync.data.session, sync.data.question, params.id)) + return createMemo(() => { const id = params.id if (!id) return false - return !!sync.data.permission[id]?.[0] || !!sync.data.question[id]?.[0] + return !!permissionRequest() || !!questionRequest() }) } @@ -26,18 +32,18 @@ export function createSessionComposerState() { const language = useLanguage() const questionRequest = createMemo((): QuestionRequest | undefined => { - const id = params.id - if (!id) return - return sync.data.question[id]?.[0] + return sessionQuestionRequest(sync.data.session, sync.data.question, params.id) }) const permissionRequest = createMemo((): PermissionRequest | undefined => { - const id = params.id - if (!id) return - return sync.data.permission[id]?.[0] + return sessionPermissionRequest(sync.data.session, sync.data.permission, params.id) }) - const blocked = createSessionComposerBlocked() + const blocked = createMemo(() => { + const id = params.id + if (!id) return false + return !!permissionRequest() || !!questionRequest() + }) const todos = createMemo((): Todo[] => { const id = params.id diff --git a/packages/app/src/pages/session/composer/session-request-tree.ts b/packages/app/src/pages/session/composer/session-request-tree.ts new file mode 100644 index 000000000000..f9673e254944 --- /dev/null +++ b/packages/app/src/pages/session/composer/session-request-tree.ts @@ -0,0 +1,45 @@ +import type { PermissionRequest, QuestionRequest, Session } from "@opencode-ai/sdk/v2/client" + +function sessionTreeRequest(session: Session[], request: Record, sessionID?: string) { + if (!sessionID) return + + const map = session.reduce((acc, item) => { + if (!item.parentID) return acc + const list = acc.get(item.parentID) + if (list) list.push(item.id) + if (!list) acc.set(item.parentID, [item.id]) + return acc + }, new Map()) + + const seen = new Set([sessionID]) + const ids = [sessionID] + for (const id of ids) { + const list = map.get(id) + if (!list) continue + for (const child of list) { + if (seen.has(child)) continue + seen.add(child) + ids.push(child) + } + } + + const id = ids.find((id) => !!request[id]?.[0]) + if (!id) return + return request[id]?.[0] +} + +export function sessionPermissionRequest( + session: Session[], + request: Record, + sessionID?: string, +) { + return sessionTreeRequest(session, request, sessionID) +} + +export function sessionQuestionRequest( + session: Session[], + request: Record, + sessionID?: string, +) { + return sessionTreeRequest(session, request, sessionID) +} diff --git a/packages/ui/src/components/message-part.css b/packages/ui/src/components/message-part.css index f063076e079b..bea33ff54cf7 100644 --- a/packages/ui/src/components/message-part.css +++ b/packages/ui/src/components/message-part.css @@ -660,105 +660,6 @@ [data-component="tool-part-wrapper"] { width: 100%; - - &[data-permission="true"], - &[data-question="true"] { - position: sticky; - top: calc(2px + var(--sticky-header-height, 40px)); - bottom: 0px; - z-index: 20; - border-radius: 6px; - border: none; - box-shadow: var(--shadow-xs-border-base); - background-color: var(--surface-raised-base); - overflow: visible; - overflow-anchor: none; - - & > *:first-child { - border-top-left-radius: 6px; - border-top-right-radius: 6px; - overflow: hidden; - } - - & > *:last-child { - border-bottom-left-radius: 6px; - border-bottom-right-radius: 6px; - overflow: hidden; - } - - [data-component="collapsible"] { - border: none; - } - - [data-component="card"] { - border: none; - } - } - - &[data-permission="true"] { - &::before { - content: ""; - position: absolute; - inset: -1.5px; - top: -5px; - border-radius: 7.5px; - border: 1.5px solid transparent; - background: - linear-gradient(var(--background-base) 0 0) padding-box, - conic-gradient( - from var(--border-angle), - transparent 0deg, - transparent 0deg, - var(--border-warning-strong, var(--border-warning-selected)) 300deg, - var(--border-warning-base) 360deg - ) - border-box; - animation: chase-border 2.5s linear infinite; - pointer-events: none; - z-index: -1; - } - } - - &[data-question="true"] { - background: var(--background-base); - border: 1px solid var(--border-weak-base); - } -} - -@property --border-angle { - syntax: ""; - initial-value: 0deg; - inherits: false; -} - -@keyframes chase-border { - from { - --border-angle: 0deg; - } - - to { - --border-angle: 360deg; - } -} - -[data-component="permission-prompt"] { - display: flex; - flex-direction: column; - padding: 8px 12px; - background-color: var(--surface-raised-strong); - border-radius: 0 0 6px 6px; - - [data-slot="permission-actions"] { - display: flex; - align-items: center; - gap: 8px; - justify-content: flex-end; - - [data-component="button"] { - padding-left: 12px; - padding-right: 12px; - } - } } [data-component="dock-prompt"][data-kind="permission"] { @@ -873,7 +774,7 @@ } } -:is([data-component="question-prompt"], [data-component="dock-prompt"][data-kind="question"]) { +[data-component="dock-prompt"][data-kind="question"] { position: relative; display: flex; flex-direction: column; diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index adba42ce9306..8fbad45bd8a9 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -23,11 +23,9 @@ import { ToolPart, UserMessage, Todo, - QuestionRequest, QuestionAnswer, QuestionInfo, } from "@opencode-ai/sdk/v2" -import { createStore } from "solid-js/store" import { useData } from "../context" import { useDiffComponent } from "../context/diff" import { useCodeComponent } from "../context/code" @@ -37,7 +35,6 @@ import { BasicTool } from "./basic-tool" import { GenericTool } from "./basic-tool" import { Accordion } from "./accordion" import { StickyAccordionHeader } from "./sticky-accordion-header" -import { Button } from "./button" import { Card } from "./card" import { Collapsible } from "./collapsible" import { FileIcon } from "./file-icon" @@ -950,7 +947,6 @@ function ToolFileAccordion(props: { path: string; actions?: JSX.Element; childre } PART_MAPPING["tool"] = function ToolPartDisplay(props) { - const data = useData() const i18n = useI18n() const part = props.part as ToolPart if (part.tool === "todowrite" || part.tool === "todoread") return null @@ -959,75 +955,18 @@ PART_MAPPING["tool"] = function ToolPartDisplay(props) { () => part.tool === "question" && (part.state.status === "pending" || part.state.status === "running"), ) - const permission = createMemo(() => { - const next = data.store.permission?.[props.message.sessionID]?.[0] - if (!next || !next.tool) return undefined - if (next.tool!.callID !== part.callID) return undefined - return next - }) - - const questionRequest = createMemo(() => { - const next = data.store.question?.[props.message.sessionID]?.[0] - if (!next || !next.tool) return undefined - if (next.tool!.callID !== part.callID) return undefined - return next - }) - - const [showPermission, setShowPermission] = createSignal(false) - const [showQuestion, setShowQuestion] = createSignal(false) - - createEffect(() => { - const perm = permission() - if (perm) { - const timeout = setTimeout(() => setShowPermission(true), 50) - onCleanup(() => clearTimeout(timeout)) - } else { - setShowPermission(false) - } - }) - - createEffect(() => { - const question = questionRequest() - if (question) { - const timeout = setTimeout(() => setShowQuestion(true), 50) - onCleanup(() => clearTimeout(timeout)) - } else { - setShowQuestion(false) - } - }) - - const [forceOpen, setForceOpen] = createSignal(false) - createEffect(() => { - if (permission() || questionRequest()) setForceOpen(true) - }) - - const respond = (response: "once" | "always" | "reject") => { - const perm = permission() - if (!perm || !data.respondToPermission) return - data.respondToPermission({ - sessionID: perm.sessionID, - permissionID: perm.id, - response, - }) - } - const emptyInput: Record = {} const emptyMetadata: Record = {} const input = () => part.state?.input ?? emptyInput // @ts-expect-error const partMetadata = () => part.state?.metadata ?? emptyMetadata - const metadata = () => { - const perm = permission() - if (perm?.metadata) return { ...perm.metadata, ...partMetadata() } - return partMetadata() - } const render = ToolRegistry.render(part.tool) ?? GenericTool return ( -
+
{(error) => { @@ -1067,33 +1006,15 @@ PART_MAPPING["tool"] = function ToolPartDisplay(props) { component={render} input={input()} tool={part.tool} - metadata={metadata()} + metadata={partMetadata()} // @ts-expect-error output={part.state.output} status={part.state.status} hideDetails={props.hideDetails} - forceOpen={forceOpen()} - locked={showPermission() || showQuestion()} defaultOpen={props.defaultOpen} /> - -
-
- - - -
-
-
- {(request) => }
) @@ -1963,245 +1884,3 @@ ToolRegistry.register({ ) }, }) - -function QuestionPrompt(props: { request: QuestionRequest }) { - const data = useData() - const i18n = useI18n() - const questions = createMemo(() => props.request.questions) - const single = createMemo(() => questions().length === 1 && questions()[0]?.multiple !== true) - - const [store, setStore] = createStore({ - tab: 0, - answers: [] as QuestionAnswer[], - custom: [] as string[], - editing: false, - }) - - const question = createMemo(() => questions()[store.tab]) - const confirm = createMemo(() => !single() && store.tab === questions().length) - const options = createMemo(() => question()?.options ?? []) - const input = createMemo(() => store.custom[store.tab] ?? "") - const multi = createMemo(() => question()?.multiple === true) - const customPicked = createMemo(() => { - const value = input() - if (!value) return false - return store.answers[store.tab]?.includes(value) ?? false - }) - - function submit() { - const answers = questions().map((_, i) => store.answers[i] ?? []) - data.replyToQuestion?.({ - requestID: props.request.id, - answers, - }) - } - - function reject() { - data.rejectQuestion?.({ - requestID: props.request.id, - }) - } - - function pick(answer: string, custom: boolean = false) { - const answers = [...store.answers] - answers[store.tab] = [answer] - setStore("answers", answers) - if (custom) { - const inputs = [...store.custom] - inputs[store.tab] = answer - setStore("custom", inputs) - } - if (single()) { - data.replyToQuestion?.({ - requestID: props.request.id, - answers: [[answer]], - }) - return - } - setStore("tab", store.tab + 1) - } - - function toggle(answer: string) { - const existing = store.answers[store.tab] ?? [] - const next = [...existing] - const index = next.indexOf(answer) - if (index === -1) next.push(answer) - if (index !== -1) next.splice(index, 1) - const answers = [...store.answers] - answers[store.tab] = next - setStore("answers", answers) - } - - function selectTab(index: number) { - setStore("tab", index) - setStore("editing", false) - } - - function selectOption(optIndex: number) { - if (optIndex === options().length) { - setStore("editing", true) - return - } - const opt = options()[optIndex] - if (!opt) return - if (multi()) { - toggle(opt.label) - return - } - pick(opt.label) - } - - function handleCustomSubmit(e: Event) { - e.preventDefault() - const value = input().trim() - if (!value) { - setStore("editing", false) - return - } - if (multi()) { - const existing = store.answers[store.tab] ?? [] - const next = [...existing] - if (!next.includes(value)) next.push(value) - const answers = [...store.answers] - answers[store.tab] = next - setStore("answers", answers) - setStore("editing", false) - return - } - pick(value, true) - setStore("editing", false) - } - - return ( -
- -
- - {(q, index) => { - const active = () => index() === store.tab - const answered = () => (store.answers[index()]?.length ?? 0) > 0 - return ( - - ) - }} - - -
-
- - -
-
- {question()?.question} - {multi() ? " " + i18n.t("ui.question.multiHint") : ""} -
-
- - {(opt, i) => { - const picked = () => store.answers[store.tab]?.includes(opt.label) ?? false - return ( - - ) - }} - - - -
- setTimeout(() => el.focus(), 0)} - type="text" - data-slot="custom-input" - placeholder={i18n.t("ui.question.custom.placeholder")} - value={input()} - onInput={(e) => { - const inputs = [...store.custom] - inputs[store.tab] = e.currentTarget.value - setStore("custom", inputs) - }} - /> - - -
-
-
-
-
- - -
-
{i18n.t("ui.messagePart.review.title")}
- - {(q, index) => { - const value = () => store.answers[index()]?.join(", ") ?? "" - const answered = () => Boolean(value()) - return ( -
- {q.question} - - {answered() ? value() : i18n.t("ui.question.review.notAnswered")} - -
- ) - }} -
-
-
- -
- - - - - - - - - -
-
- ) -} diff --git a/packages/ui/src/context/data.tsx b/packages/ui/src/context/data.tsx index 2c44763f5368..e116199eb233 100644 --- a/packages/ui/src/context/data.tsx +++ b/packages/ui/src/context/data.tsx @@ -1,14 +1,4 @@ -import type { - Message, - Session, - Part, - FileDiff, - SessionStatus, - PermissionRequest, - QuestionRequest, - QuestionAnswer, - ProviderListResponse, -} from "@opencode-ai/sdk/v2" +import type { Message, Session, Part, FileDiff, SessionStatus, ProviderListResponse } from "@opencode-ai/sdk/v2" import { createSimpleContext } from "./helper" import { PreloadMultiFileDiffResult } from "@pierre/diffs/ssr" @@ -24,12 +14,6 @@ type Data = { session_diff_preload?: { [sessionID: string]: PreloadMultiFileDiffResult[] } - permission?: { - [sessionID: string]: PermissionRequest[] - } - question?: { - [sessionID: string]: QuestionRequest[] - } message: { [sessionID: string]: Message[] } @@ -38,16 +22,6 @@ type Data = { } } -export type PermissionRespondFn = (input: { - sessionID: string - permissionID: string - response: "once" | "always" | "reject" -}) => void - -export type QuestionReplyFn = (input: { requestID: string; answers: QuestionAnswer[] }) => void - -export type QuestionRejectFn = (input: { requestID: string }) => void - export type NavigateToSessionFn = (sessionID: string) => void export type SessionHrefFn = (sessionID: string) => string @@ -57,9 +31,6 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ init: (props: { data: Data directory: string - onPermissionRespond?: PermissionRespondFn - onQuestionReply?: QuestionReplyFn - onQuestionReject?: QuestionRejectFn onNavigateToSession?: NavigateToSessionFn onSessionHref?: SessionHrefFn }) => { @@ -70,9 +41,6 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ get directory() { return props.directory }, - respondToPermission: props.onPermissionRespond, - replyToQuestion: props.onQuestionReply, - rejectQuestion: props.onQuestionReject, navigateToSession: props.onNavigateToSession, sessionHref: props.onSessionHref, } From c4ea11fef3dc3ac6bd2e3c55d1c8179457eace5d Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 25 Feb 2026 23:06:16 -0500 Subject: [PATCH 93/95] wip: zen --- packages/console/app/src/routes/black/index.tsx | 13 +++++++++---- .../black/{_subscribe => subscribe}/[plan].tsx | 11 +++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) rename packages/console/app/src/routes/black/{_subscribe => subscribe}/[plan].tsx (98%) diff --git a/packages/console/app/src/routes/black/index.tsx b/packages/console/app/src/routes/black/index.tsx index 382832e8faf2..8bce3cd464f7 100644 --- a/packages/console/app/src/routes/black/index.tsx +++ b/packages/console/app/src/routes/black/index.tsx @@ -1,16 +1,21 @@ -import { A, useSearchParams } from "@solidjs/router" +import { A, createAsync, query, useSearchParams } from "@solidjs/router" import { Title } from "@solidjs/meta" import { createMemo, createSignal, For, Match, onMount, Show, Switch } from "solid-js" import { PlanIcon, plans } from "./common" import { useI18n } from "~/context/i18n" import { useLanguage } from "~/context/language" +import { Resource } from "@opencode-ai/console-resource" -const paused = true +const getPaused = query(async () => { + "use server" + return Resource.App.stage === "production" +}, "black.paused") export default function Black() { const [params] = useSearchParams() const i18n = useI18n() const language = useLanguage() + const paused = createAsync(() => getPaused()) const [selected, setSelected] = createSignal((params.plan as string) || null) const [mounted, setMounted] = createSignal(false) const selectedPlan = createMemo(() => plans.find((p) => p.id === selected())) @@ -44,7 +49,7 @@ export default function Black() { <> {i18n.t("black.title")}
- {i18n.t("black.paused")}

}> + {i18n.t("black.paused")}

}>
@@ -108,7 +113,7 @@ export default function Black() { - +

{i18n.t("black.finePrint.beforeTerms")} ·{" "} {i18n.t("black.finePrint.terms")} diff --git a/packages/console/app/src/routes/black/_subscribe/[plan].tsx b/packages/console/app/src/routes/black/subscribe/[plan].tsx similarity index 98% rename from packages/console/app/src/routes/black/_subscribe/[plan].tsx rename to packages/console/app/src/routes/black/subscribe/[plan].tsx index 644d87d9b325..19b56eabe678 100644 --- a/packages/console/app/src/routes/black/_subscribe/[plan].tsx +++ b/packages/console/app/src/routes/black/subscribe/[plan].tsx @@ -17,6 +17,12 @@ import { Billing } from "@opencode-ai/console-core/billing.js" import { useI18n } from "~/context/i18n" import { useLanguage } from "~/context/language" import { formError } from "~/lib/form-error" +import { Resource } from "@opencode-ai/console-resource" + +const getEnabled = query(async () => { + "use server" + return Resource.App.stage !== "production" +}, "black.subscribe.enabled") const plansMap = Object.fromEntries(plans.map((p) => [p.id, p])) as Record const stripePromise = loadStripe(import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY!) @@ -269,6 +275,7 @@ export default function BlackSubscribe() { const params = useParams() const i18n = useI18n() const language = useLanguage() + const enabled = createAsync(() => getEnabled()) const planData = plansMap[(params.plan as PlanID) ?? "20"] ?? plansMap["20"] const plan = planData.id @@ -359,7 +366,7 @@ export default function BlackSubscribe() { } return ( - <> + {i18n.t("black.subscribe.title")}

@@ -472,6 +479,6 @@ export default function BlackSubscribe() { {i18n.t("black.finePrint.terms")}

- +
) } From 392a6d993f5cbb233bc0eeab297919cb21099f2c Mon Sep 17 00:00:00 2001 From: kil-penguin Date: Thu, 26 Feb 2026 15:02:40 +0900 Subject: [PATCH 94/95] fix(desktop): remove interactive shell flag from sidecar spawn to prevent hang on macOS (#15136) Co-authored-by: kil-penguin --- packages/desktop/src-tauri/src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/desktop/src-tauri/src/cli.rs b/packages/desktop/src-tauri/src/cli.rs index 0c5dfebaf5e5..af1a45cf3a38 100644 --- a/packages/desktop/src-tauri/src/cli.rs +++ b/packages/desktop/src-tauri/src/cli.rs @@ -320,7 +320,7 @@ pub fn spawn_command( }; let mut cmd = Command::new(shell); - cmd.args(["-il", "-c", &line]); + cmd.args(["-l", "-c", &line]); for (key, value) in envs { cmd.env(key, value); From 3a4d5e5d81eff27e6254af83921571c444fede27 Mon Sep 17 00:00:00 2001 From: leoncheng57 Date: Thu, 26 Feb 2026 00:20:53 -0500 Subject: [PATCH 95/95] feat: implement copy command with options This commit includes: - Add selective copy dialog for User msgs and AI responses - Expand copy dialog to support both user and assistant messages - Fix scrolling issues and improve type safety --- .../src/cli/cmd/tui/routes/session/index.tsx | 47 ++ .../cli/cmd/tui/ui/dialog-copy-messages.tsx | 247 +++++++ .../src/cli/cmd/tui/util/transcript.ts | 15 +- .../test/cli/tui/dialog-copy-messages.test.ts | 133 ++++ .../cli/tui/session-copy-with-options.test.ts | 617 ++++++++++++++++++ .../opencode/test/cli/tui/transcript.test.ts | 8 +- 6 files changed, 1058 insertions(+), 9 deletions(-) create mode 100644 packages/opencode/src/cli/cmd/tui/ui/dialog-copy-messages.tsx create mode 100644 packages/opencode/test/cli/tui/dialog-copy-messages.test.ts create mode 100644 packages/opencode/test/cli/tui/session-copy-with-options.test.ts diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index f20267e0820e..34704537684f 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -76,6 +76,7 @@ import { Global } from "@/global" import { PermissionPrompt } from "./permission" import { QuestionPrompt } from "./question" import { DialogExportOptions } from "../../ui/dialog-export-options" +import { DialogCopyMessages } from "../../ui/dialog-copy-messages" import { formatTranscript } from "../../util/transcript" import { UI } from "@/cli/ui.ts" import { useTuiConfig } from "../../context/tui-config" @@ -812,6 +813,7 @@ export function Session() { thinking: showThinking(), toolDetails: showDetails(), assistantMetadata: showAssistantMetadata(), + includeMetadata: true, }, ) await Clipboard.copy(transcript) @@ -822,6 +824,50 @@ export function Session() { dialog.clear() }, }, + { + title: "Copy selective session messages with options", + value: "session.copyWithOptions", + category: "Session", + slash: { + name: "copy-with-options", + }, + onSelect: async (dialog) => { + try { + const sessionData = session() + if (!sessionData) return + const sessionMessages = messages() + + const allMessages = sessionMessages.map((msg) => ({ + info: msg as AssistantMessage | UserMessage, + parts: sync.data.part[msg.id] ?? [], + })) + + if (allMessages.length === 0) { + toast.show({ message: "No messages to copy", variant: "info" }) + dialog.clear() + return + } + + const selectedMessages = await DialogCopyMessages.show(dialog, allMessages) + if (!selectedMessages || selectedMessages.length === 0) { + dialog.clear() + return + } + + const transcript = formatTranscript(sessionData, selectedMessages, { + thinking: true, + toolDetails: true, + assistantMetadata: true, + includeMetadata: false, + }) + await Clipboard.copy(transcript) + toast.show({ message: `${selectedMessages.length} message(s) copied to clipboard!`, variant: "success" }) + } catch (error) { + toast.show({ message: "Failed to copy messages", variant: "error" }) + } + dialog.clear() + }, + }, { title: "Export session transcript", value: "session.export", @@ -856,6 +902,7 @@ export function Session() { thinking: options.thinking, toolDetails: options.toolDetails, assistantMetadata: options.assistantMetadata, + includeMetadata: true, }, ) diff --git a/packages/opencode/src/cli/cmd/tui/ui/dialog-copy-messages.tsx b/packages/opencode/src/cli/cmd/tui/ui/dialog-copy-messages.tsx new file mode 100644 index 000000000000..f3fe6fa8766f --- /dev/null +++ b/packages/opencode/src/cli/cmd/tui/ui/dialog-copy-messages.tsx @@ -0,0 +1,247 @@ +import { TextAttributes, ScrollBoxRenderable } from "@opentui/core" +import { useDialog, type DialogContext } from "./dialog" +import { createStore } from "solid-js/store" +import { For, createMemo, onMount, Show } from "solid-js" +import { useTheme } from "../context/theme" +import { useKeyboard } from "@opentui/solid" +import { Locale } from "@/util/locale" +import type { AssistantMessage, UserMessage, Part, TextPart } from "@opencode-ai/sdk/v2" + +// Internal representation of a single message with its metadata and content parts +type Message = { + info: AssistantMessage | UserMessage + parts: (Part | TextPart)[] +} + +// Display option for each message in the checklist +type Option = { + id: string + title: string + footerNode: any +} + +export type DialogCopyMessagesProps = { + messages: Message[] + onConfirm: (selected: Message[]) => void + onCancel?: () => void +} + +export function DialogCopyMessages(props: DialogCopyMessagesProps) { + const dialog = useDialog() + const { theme } = useTheme() + const [store, setStore] = createStore({ + selected: new Set(), // Set of currently selected message IDs + scrollIndex: 0, // Index of currently highlighted item in the list + warningNoMessagesSelected: false, // Show warning when confirm is pressed with no selection + }) + + let scroll: ScrollBoxRenderable | undefined + + // Set dialog to large size + onMount(() => { + dialog.setSize("large") + }) + + // Transform raw messages into display-friendly options + const options = createMemo(() => + props.messages.map((msg, i) => { + // Extract text content: filter out synthetic parts, and limit to first 60 chars + const textContent = msg.parts + .filter((p): p is TextPart => p.type === "text" && !p.synthetic) + .map((p) => p.text) + .join("") + .slice(0, 60) + + const isAssistant = msg.info.role === "assistant" + + // Get source identifier with color (model name for assistant, "user" for user messages) + const modelName = isAssistant ? (msg.info as AssistantMessage).modelID : "user" + const modelColor = isAssistant ? theme.primary : theme.secondary + + // Calculate execution duration for assistant messages + const duration = isAssistant + ? Locale.duration( + (msg.info as AssistantMessage).time.completed + ? (msg.info as AssistantMessage).time.completed! - (msg.info as AssistantMessage).time.created + : 0, + ) + : "" + + // Show absolute timestamp for user messages + const userTimestamp = !isAssistant ? new Date(msg.info.time.created).toLocaleTimeString() : "" + + return { + id: msg.info.id, + title: textContent || "(empty)", + footerNode: ( + + {modelName} + {duration && {` · ${duration}`}} + {userTimestamp && {` · ${userTimestamp}`}} + + ), + } + }), + ) + + // Flat list of all options (no grouping) + const flatOptions = createMemo((): Option[] => options()) + + // Toggle selection state for a message + function toggle(id: string) { + const newSelected = new Set(store.selected) + if (newSelected.has(id)) { + newSelected.delete(id) + } else { + newSelected.add(id) + } + setStore("selected", newSelected) + } + + // Navigate through list with wrapping (loops to end when at start and vice versa) + function move(offset: number) { + const opts = flatOptions() + let next = store.scrollIndex + offset + if (next < 0) next = opts.length - 1 // Wrap to end + if (next >= opts.length) next = 0 // Wrap to start + setStore("scrollIndex", next) + scrollToActive() + } + + // Scroll to keep active item visible + function scrollToActive() { + if (!scroll) return + const children = scroll.getChildren() + if (children.length === 0) return + const target = children[store.scrollIndex] + if (!target) return + const y = target.y - scroll.y + // Keep item visible: scroll down if item is below viewport, up if above + if (y >= scroll.height) { + scroll.scrollBy(y - scroll.height + 1) + } else if (y < 0) { + scroll.scrollBy(y) + } + } + + // Confirm selection: filter messages by selected IDs and invoke callback + function confirm() { + const selected = props.messages.filter((m) => store.selected.has(m.info.id)) + props.onConfirm(selected) + } + + // Show warning and auto-dismiss after 2 seconds + function showwarningNoMessagesSelected() { + setStore("warningNoMessagesSelected", true) + setTimeout(() => setStore("warningNoMessagesSelected", false), 2000) + } + + // Handle keyboard input for navigation and actions + useKeyboard((evt) => { + if (evt.name === "up") move(-1) // Navigate up + if (evt.name === "down") move(1) // Navigate down + if (evt.name === "space") { + // Toggle selection of currently highlighted item + const opt = flatOptions()[store.scrollIndex] + if (opt) toggle(opt.id) + evt.preventDefault() + } + if (evt.name === "return") { + // Confirm and copy selected messages (only if at least one is selected) + if (store.selected.size > 0) confirm() + else showwarningNoMessagesSelected() + } + if (evt.name === "a" && evt.ctrl) { + // Select all messages (Ctrl+A) + const allIds = new Set(flatOptions().map((o) => o.id)) + setStore("selected", allIds) + } + }) + + return ( + + {/* Header with title and close hint */} + + + Copy Messages + + dialog.clear()}> + esc + + + + {/* Status line showing selection count or warning message */} + Please select at least one message} + > + Select messages to copy ({store.selected.size} selected) + + + {/* Scrollable list of messages */} + (scroll = r)}> + + {(opt, i) => { + const msgIndex = createMemo(() => props.messages.findIndex((m) => m.info.id === opt.id)) + const isSelected = createMemo(() => store.selected.has(opt.id)) + const isActive = createMemo(() => msgIndex() === store.scrollIndex) + + return ( + toggle(opt.id)} + // Hover to change active item + onMouseOver={() => setStore("scrollIndex", msgIndex())} + > + {/* Checkbox indicator */} + {isSelected() ? "[x]" : "[ ]"} + {/* Message preview (title) */} + + {opt.title} + + {/* Model/duration info */} + {opt.footerNode} + + ) + }} + + + + {/* Keyboard shortcuts legend */} + + + space toggle + + + ctrl+a all + + + return copy + + + + ) +} + +// Static helper method to show this dialog and get selected messages +// Returns: Promise resolving to selected messages array or null if cancelled +DialogCopyMessages.show = (dialog: DialogContext, messages: Message[]): Promise => { + return new Promise((resolve) => { + dialog.replace( + () => ( + resolve(selected)} // Resolve with selected messages + onCancel={() => resolve(null)} // Resolve with null on cancel + /> + ), + () => resolve(null), // Close callback: resolve with null + ) + }) +} diff --git a/packages/opencode/src/cli/cmd/tui/util/transcript.ts b/packages/opencode/src/cli/cmd/tui/util/transcript.ts index 420c9dde1bf6..af0560e4c34a 100644 --- a/packages/opencode/src/cli/cmd/tui/util/transcript.ts +++ b/packages/opencode/src/cli/cmd/tui/util/transcript.ts @@ -2,6 +2,7 @@ import type { AssistantMessage, Part, UserMessage } from "@opencode-ai/sdk/v2" import { Locale } from "@/util/locale" export type TranscriptOptions = { + includeMetadata: boolean thinking: boolean toolDetails: boolean assistantMetadata: boolean @@ -26,11 +27,15 @@ export function formatTranscript( messages: MessageWithParts[], options: TranscriptOptions, ): string { - let transcript = `# ${session.title}\n\n` - transcript += `**Session ID:** ${session.id}\n` - transcript += `**Created:** ${new Date(session.time.created).toLocaleString()}\n` - transcript += `**Updated:** ${new Date(session.time.updated).toLocaleString()}\n\n` - transcript += `---\n\n` + let transcript = `` + + if (options.includeMetadata) { + transcript += `# ${session.title}\n\n` + transcript += `**Session ID:** ${session.id}\n` + transcript += `**Created:** ${new Date(session.time.created).toLocaleString()}\n` + transcript += `**Updated:** ${new Date(session.time.updated).toLocaleString()}\n\n` + transcript += `---\n\n` + } for (const msg of messages) { transcript += formatMessage(msg.info, msg.parts, options) diff --git a/packages/opencode/test/cli/tui/dialog-copy-messages.test.ts b/packages/opencode/test/cli/tui/dialog-copy-messages.test.ts new file mode 100644 index 000000000000..501ec2c2ef11 --- /dev/null +++ b/packages/opencode/test/cli/tui/dialog-copy-messages.test.ts @@ -0,0 +1,133 @@ +import { describe, expect, test } from "bun:test" +import type { AssistantMessage, UserMessage, Part, TextPart } from "@opencode-ai/sdk/v2" + +type Message = { info: AssistantMessage | UserMessage; parts: Part[] } + +describe("DialogCopyMessages", () => { + describe("selection state management", () => { + test("should toggle and manage message selection with Set", () => { + const selected = new Set() + + selected.add("msg_1") + expect(selected.has("msg_1")).toBe(true) + expect(selected.size).toBe(1) + + selected.add("msg_2") + expect(selected.has("msg_1")).toBe(true) + expect(selected.has("msg_2")).toBe(true) + expect(selected.size).toBe(2) + + selected.delete("msg_1") + expect(selected.has("msg_1")).toBe(false) + expect(selected.has("msg_2")).toBe(true) + expect(selected.size).toBe(1) + }) + + test("should support select-all pattern", () => { + const messageIds = ["msg_1", "msg_2", "msg_3", "msg_4"] + const selected = new Set(messageIds) + + expect(selected.size).toBe(4) + messageIds.forEach((id) => expect(selected.has(id)).toBe(true)) + }) + + test("should start empty", () => { + const selected = new Set() + expect(selected.size).toBe(0) + }) + }) + + describe("part filtering logic", () => { + test("should filter synthetic parts from text content", () => { + const parts: Part[] = [ + { id: "p1", type: "text", text: "Real content", synthetic: false } as any, + { id: "p2", type: "text", text: "Synthetic", synthetic: true } as any, + ] + + const realText = parts + .filter((p): p is TextPart => p.type === "text" && !p.synthetic) + .map((p) => p.text) + .join("") + + expect(realText).toBe("Real content") + }) + + test("should handle mixed part types (text and tool)", () => { + const parts: Part[] = [ + { id: "p1", type: "text", text: "Output" } as any, + { id: "p2", type: "tool", tool: "bash" } as any, + ] + + const textParts = parts.filter((p) => p.type === "text") + const toolParts = parts.filter((p) => p.type === "tool") + + expect(textParts).toHaveLength(1) + expect(toolParts).toHaveLength(1) + }) + }) + + describe("navigation wrapping", () => { + test("should wrap forward and backward through list", () => { + const listSize = 3 + let index = 0 + + const moveForward = () => { + index = (index + 1) % listSize + } + + const moveBackward = () => { + index = (index - 1 + listSize) % listSize + } + + // Forward navigation + moveForward() + expect(index).toBe(1) + moveForward() + expect(index).toBe(2) + moveForward() + expect(index).toBe(0) + + // Backward navigation + moveBackward() + expect(index).toBe(2) + moveBackward() + expect(index).toBe(1) + }) + }) + + describe("message filtering and ordering", () => { + test("should filter selected messages while preserving order", () => { + const messages = [ + { info: { id: "msg_1", role: "user" as const } }, + { info: { id: "msg_2", role: "assistant" as const } }, + { info: { id: "msg_3", role: "user" as const } }, + { info: { id: "msg_4", role: "assistant" as const } }, + ] as Message[] + + const selected = new Set(["msg_1", "msg_3", "msg_4"]) + const filtered = messages.filter((m) => selected.has(m.info.id)) + + expect(filtered).toHaveLength(3) + expect(filtered.map((m) => m.info.id)).toEqual(["msg_1", "msg_3", "msg_4"]) + }) + + test("should handle empty selection returning no messages", () => { + const messages = [{ info: { id: "msg_1" } }, { info: { id: "msg_2" } }] as Message[] + + const selected = new Set() + const filtered = messages.filter((m) => selected.has(m.info.id)) + + expect(filtered).toHaveLength(0) + }) + + test("should require non-empty selection to confirm", () => { + const selected = new Set() + const canConfirm = selected.size > 0 + + expect(canConfirm).toBe(false) + + selected.add("msg_1") + expect(selected.size > 0).toBe(true) + }) + }) +}) diff --git a/packages/opencode/test/cli/tui/session-copy-with-options.test.ts b/packages/opencode/test/cli/tui/session-copy-with-options.test.ts new file mode 100644 index 000000000000..1b6545b15191 --- /dev/null +++ b/packages/opencode/test/cli/tui/session-copy-with-options.test.ts @@ -0,0 +1,617 @@ +import { describe, expect, test, beforeEach, mock } from "bun:test" +import type { AssistantMessage, UserMessage, Part } from "@opencode-ai/sdk/v2" + +// Mock types and interfaces +type Message = { + info: AssistantMessage | UserMessage + parts: Part[] +} + +type SessionData = { + id: string + title: string +} + +type ToastOptions = { + message: string + variant: "success" | "error" | "info" | "warning" +} + +describe("session.copyWithOptions command", () => { + let dialog: any + let toast: any + let session: () => SessionData | undefined + let messages: () => (AssistantMessage | UserMessage)[] + let sync: any + let clipboard: any + let formatTranscript: any + let dialogCopyMessages: any + + beforeEach(() => { + dialog = { clear: mock(() => {}) } + toast = { show: mock((options: ToastOptions) => {}) } + clipboard = { copy: mock(async (text: string) => {}) } + formatTranscript = mock((data, msgs, opts) => "formatted transcript") + dialogCopyMessages = { + show: mock(async (d, msgs) => msgs.slice(0, 1)), + } + }) + + describe("initial validation", () => { + test("should handle missing session data gracefully", async () => { + session = () => undefined + messages = () => [] + sync = { data: { part: {} } } + + // Simulate command onSelect + const sessionData = session() + if (!sessionData) { + expect(sessionData).toBeUndefined() + } + }) + + test("should show info toast when no messages available", async () => { + session = () => ({ id: "ses_123", title: "Test" }) + messages = () => [] + sync = { data: { part: {} } } + + const sessionData = session() + const sessionMessages = messages() + const allMessages = sessionMessages.map((msg) => ({ + info: msg, + parts: sync.data.part[(msg as any).id] ?? [], + })) + + if (allMessages.length === 0) { + toast.show({ message: "No messages to copy", variant: "info" }) + } + + expect(toast.show).toHaveBeenCalledWith( + expect.objectContaining({ + message: "No messages to copy", + variant: "info", + }), + ) + }) + + test("should clear dialog when no messages available", async () => { + session = () => ({ id: "ses_123", title: "Test" }) + messages = () => [] + sync = { data: { part: {} } } + + const sessionData = session() + const sessionMessages = messages() + + if (sessionMessages.length === 0) { + dialog.clear() + } + + expect(dialog.clear).toHaveBeenCalled() + }) + }) + + describe("message collection", () => { + test("should collect all session messages with their parts", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + { + id: "msg_2", + sessionID: "ses_123", + role: "assistant", + agent: "build", + modelID: "claude-sonnet", + providerID: "anthropic", + mode: "", + parentID: "msg_1", + path: { cwd: "/test", root: "/test" }, + cost: 0.001, + tokens: { input: 100, output: 50, reasoning: 0, cache: { read: 0, write: 0 } }, + time: { created: 1000000, completed: 1005400 }, + } as AssistantMessage, + ] + + session = () => ({ id: "ses_123", title: "Test" }) + messages = () => msgs + sync = { + data: { + part: { + msg_1: [{ id: "p1", type: "text", text: "User input" }], + msg_2: [{ id: "p2", type: "text", text: "Assistant response" }], + }, + }, + } + + const sessionData = session() + const sessionMessages = messages() + const allMessages = sessionMessages.map((msg) => ({ + info: msg, + parts: sync.data.part[msg.id] ?? [], + })) + + expect(allMessages).toHaveLength(2) + expect(allMessages[0].parts).toHaveLength(1) + expect(allMessages[1].parts).toHaveLength(1) + }) + + test("should handle messages without parts", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + ] + + session = () => ({ id: "ses_123", title: "Test" }) + messages = () => msgs + sync = { data: { part: {} } } + + const sessionData = session() + const sessionMessages = messages() + const allMessages = sessionMessages.map((msg) => ({ + info: msg, + parts: sync.data.part[msg.id] ?? [], + })) + + expect(allMessages[0].parts).toEqual([]) + }) + }) + + describe("dialog interaction", () => { + test("should show dialog and wait for message selection", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + ] + + session = () => ({ id: "ses_123", title: "Test" }) + messages = () => msgs + sync = { data: { part: { msg_1: [] } } } + + const sessionData = session() + const sessionMessages = messages() + const allMessages = sessionMessages.map((msg) => ({ + info: msg, + parts: sync.data.part[msg.id] ?? [], + })) + + const selectedMessages = await dialogCopyMessages.show(dialog, allMessages) + + expect(dialogCopyMessages.show).toHaveBeenCalledWith(dialog, expect.any(Array)) + expect(selectedMessages).toBeDefined() + }) + + test("should clear dialog when user cancels (no selection)", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + ] + + session = () => ({ id: "ses_123", title: "Test" }) + messages = () => msgs + sync = { data: { part: { msg_1: [] } } } + dialogCopyMessages.show = mock(async () => null) + + const sessionData = session() + const sessionMessages = messages() + const allMessages = sessionMessages.map((msg) => ({ + info: msg, + parts: sync.data.part[msg.id] ?? [], + })) + + const selectedMessages = await dialogCopyMessages.show(dialog, allMessages) + + if (!selectedMessages || selectedMessages.length === 0) { + dialog.clear() + } + + expect(dialog.clear).toHaveBeenCalled() + }) + + test("should clear dialog when selection is empty array", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + ] + + session = () => ({ id: "ses_123", title: "Test" }) + messages = () => msgs + sync = { data: { part: { msg_1: [] } } } + dialogCopyMessages.show = mock(async () => []) + + const sessionData = session() + const sessionMessages = messages() + const allMessages = sessionMessages.map((msg) => ({ + info: msg, + parts: sync.data.part[msg.id] ?? [], + })) + + const selectedMessages = await dialogCopyMessages.show(dialog, allMessages) + + if (!selectedMessages || selectedMessages.length === 0) { + dialog.clear() + } + + expect(dialog.clear).toHaveBeenCalled() + }) + }) + + describe("transcript formatting", () => { + test("should format transcript with correct options", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + ] + + const sessionData = { id: "ses_123", title: "Test" } + const selectedMessages = [{ info: msgs[0], parts: [] }] + + formatTranscript(sessionData, selectedMessages, { + thinking: true, + toolDetails: true, + assistantMetadata: true, + includeMetadata: false, + }) + + expect(formatTranscript).toHaveBeenCalledWith( + sessionData, + selectedMessages, + expect.objectContaining({ + thinking: true, + toolDetails: true, + assistantMetadata: true, + includeMetadata: false, + }), + ) + }) + + test("should use consistent formatting options across all calls", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + { + id: "msg_2", + sessionID: "ses_123", + role: "assistant", + agent: "build", + modelID: "claude-sonnet", + providerID: "anthropic", + mode: "", + parentID: "msg_1", + path: { cwd: "/test", root: "/test" }, + cost: 0.001, + tokens: { input: 100, output: 50, reasoning: 0, cache: { read: 0, write: 0 } }, + time: { created: 1000000, completed: 1005400 }, + } as AssistantMessage, + ] + + const sessionData = { id: "ses_123", title: "Test" } + const selectedMessages = [ + { info: msgs[0], parts: [] }, + { info: msgs[1], parts: [] }, + ] + + const transcript = formatTranscript(sessionData, selectedMessages, { + thinking: true, + toolDetails: true, + assistantMetadata: true, + includeMetadata: false, + }) + + expect(transcript).toBeDefined() + }) + }) + + describe("clipboard operations", () => { + test("should copy formatted transcript to clipboard", async () => { + const selectedMessages = [ + { + info: { + id: "msg_1", + role: "user", + } as UserMessage, + parts: [], + }, + ] + + const transcript = "formatted transcript" + await clipboard.copy(transcript) + + expect(clipboard.copy).toHaveBeenCalledWith(transcript) + }) + + test("should show success toast after copy", async () => { + const selectedMessages = [ + { + info: { + id: "msg_1", + role: "user", + } as UserMessage, + parts: [], + }, + ] + + const selectedCount = selectedMessages.length + await clipboard.copy("transcript") + toast.show({ message: `${selectedCount} message(s) copied to clipboard!`, variant: "success" }) + + expect(toast.show).toHaveBeenCalledWith( + expect.objectContaining({ + message: "1 message(s) copied to clipboard!", + variant: "success", + }), + ) + }) + + test("should include correct message count in success notification", async () => { + const selectedMessages = Array.from({ length: 5 }, (_, i) => ({ + info: { + id: `msg_${i}`, + role: "user", + } as UserMessage, + parts: [], + })) + + const selectedCount = selectedMessages.length + toast.show({ message: `${selectedCount} message(s) copied to clipboard!`, variant: "success" }) + + expect(toast.show).toHaveBeenCalledWith( + expect.objectContaining({ + message: "5 message(s) copied to clipboard!", + variant: "success", + }), + ) + }) + }) + + describe("error handling", () => { + test("should show error toast on copy failure", async () => { + const error = new Error("Copy failed") + + try { + throw error + } catch (err) { + toast.show({ message: "Failed to copy messages", variant: "error" }) + } + + expect(toast.show).toHaveBeenCalledWith( + expect.objectContaining({ + message: "Failed to copy messages", + variant: "error", + }), + ) + }) + + test("should clear dialog after error", async () => { + try { + throw new Error("Copy failed") + } catch (error) { + dialog.clear() + } + + expect(dialog.clear).toHaveBeenCalled() + }) + + test("should clear dialog on generic error", async () => { + const sessionData = { id: "ses_123", title: "Test" } + try { + throw new Error("Unexpected error") + } catch (error) { + toast.show({ message: "Failed to copy messages", variant: "error" }) + dialog.clear() + } + + expect(dialog.clear).toHaveBeenCalled() + expect(toast.show).toHaveBeenCalledWith( + expect.objectContaining({ + variant: "error", + }), + ) + }) + }) + + describe("workflow integration", () => { + test("should complete full copy workflow", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + { + id: "msg_2", + sessionID: "ses_123", + role: "assistant", + agent: "build", + modelID: "claude-sonnet", + providerID: "anthropic", + mode: "", + parentID: "msg_1", + path: { cwd: "/test", root: "/test" }, + cost: 0.001, + tokens: { input: 100, output: 50, reasoning: 0, cache: { read: 0, write: 0 } }, + time: { created: 1000000, completed: 1005400 }, + } as AssistantMessage, + ] + + session = () => ({ id: "ses_123", title: "Test" }) + messages = () => msgs + sync = { + data: { + part: { + msg_1: [{ id: "p1", type: "text", text: "Hello" }], + msg_2: [{ id: "p2", type: "text", text: "Hi there" }], + }, + }, + } + + // Simulate workflow + const sessionData = session() + const sessionMessages = messages() + const allMessages = sessionMessages.map((msg) => ({ + info: msg, + parts: sync.data.part[msg.id] ?? [], + })) + + const selectedMessages = await dialogCopyMessages.show(dialog, allMessages) + + if (selectedMessages && selectedMessages.length > 0) { + const transcript = formatTranscript(sessionData, selectedMessages, { + thinking: true, + toolDetails: true, + assistantMetadata: true, + includeMetadata: false, + }) + await clipboard.copy(transcript) + toast.show({ message: `${selectedMessages.length} message(s) copied to clipboard!`, variant: "success" }) + } + + dialog.clear() + + expect(dialogCopyMessages.show).toHaveBeenCalled() + expect(formatTranscript).toHaveBeenCalled() + expect(clipboard.copy).toHaveBeenCalled() + expect(toast.show).toHaveBeenCalledWith( + expect.objectContaining({ + variant: "success", + }), + ) + expect(dialog.clear).toHaveBeenCalled() + }) + + test("should handle mixed user and assistant message selection", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + { + id: "msg_2", + sessionID: "ses_123", + role: "assistant", + agent: "build", + modelID: "claude-sonnet", + providerID: "anthropic", + mode: "", + parentID: "msg_1", + path: { cwd: "/test", root: "/test" }, + cost: 0.001, + tokens: { input: 100, output: 50, reasoning: 0, cache: { read: 0, write: 0 } }, + time: { created: 1000000, completed: 1005400 }, + } as AssistantMessage, + { + id: "msg_3", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1010000 }, + } as UserMessage, + ] + + const sessionData = { id: "ses_123", title: "Test" } + const selectedMessages = [ + { info: msgs[0], parts: [] }, + { info: msgs[1], parts: [] }, + { info: msgs[2], parts: [] }, + ] + + const userMessages = selectedMessages.filter((m) => m.info.role === "user") + const assistantMessages = selectedMessages.filter((m) => m.info.role === "assistant") + + expect(userMessages).toHaveLength(2) + expect(assistantMessages).toHaveLength(1) + }) + + test("should always clear dialog at end of workflow", async () => { + const msgs: (AssistantMessage | UserMessage)[] = [ + { + id: "msg_1", + sessionID: "ses_123", + role: "user", + agent: "build", + model: { providerID: "anthropic", modelID: "claude-sonnet" }, + time: { created: 1000000 }, + } as UserMessage, + ] + + session = () => ({ id: "ses_123", title: "Test" }) + messages = () => msgs + sync = { data: { part: { msg_1: [] } } } + + try { + const sessionData = session() + const sessionMessages = messages() + const allMessages = sessionMessages.map((msg) => ({ + info: msg, + parts: sync.data.part[msg.id] ?? [], + })) + const selectedMessages = await dialogCopyMessages.show(dialog, allMessages) + + if (selectedMessages && selectedMessages.length > 0) { + const transcript = formatTranscript(sessionData, selectedMessages, { + thinking: true, + toolDetails: true, + assistantMetadata: true, + includeMetadata: false, + }) + await clipboard.copy(transcript) + toast.show({ message: `${selectedMessages.length} message(s) copied to clipboard!`, variant: "success" }) + } + } catch (error) { + toast.show({ message: "Failed to copy messages", variant: "error" }) + } + + dialog.clear() + + expect(dialog.clear).toHaveBeenCalled() + }) + }) +}) diff --git a/packages/opencode/test/cli/tui/transcript.test.ts b/packages/opencode/test/cli/tui/transcript.test.ts index 7a5fa6b8f1cf..57a24a1b8371 100644 --- a/packages/opencode/test/cli/tui/transcript.test.ts +++ b/packages/opencode/test/cli/tui/transcript.test.ts @@ -48,7 +48,7 @@ describe("transcript", () => { }) describe("formatPart", () => { - const options = { thinking: true, toolDetails: true, assistantMetadata: true } + const options = { includeMetadata: true, thinking: true, toolDetails: true, assistantMetadata: true } test("formats text part", () => { const part: Part = { @@ -196,7 +196,7 @@ describe("transcript", () => { }) describe("formatMessage", () => { - const options = { thinking: true, toolDetails: true, assistantMetadata: true } + const options = { includeMetadata: true, thinking: true, toolDetails: true, assistantMetadata: true } test("formats user message", () => { const msg: UserMessage = { @@ -272,7 +272,7 @@ describe("transcript", () => { parts: [{ id: "p2", sessionID: "ses_abc123", messageID: "msg_2", type: "text" as const, text: "Hi!" }], }, ] - const options = { thinking: false, toolDetails: false, assistantMetadata: true } + const options = { includeMetadata: true, thinking: false, toolDetails: false, assistantMetadata: true } const result = formatTranscript(session, messages, options) @@ -310,7 +310,7 @@ describe("transcript", () => { parts: [{ id: "p1", sessionID: "ses_abc123", messageID: "msg_1", type: "text" as const, text: "Response" }], }, ] - const options = { thinking: false, toolDetails: false, assistantMetadata: false } + const options = { includeMetadata: true, thinking: false, toolDetails: false, assistantMetadata: false } const result = formatTranscript(session, messages, options)