diff --git a/.github/VOUCHED.td b/.github/VOUCHED.td index 412716a18dd..28535b57799 100644 --- a/.github/VOUCHED.td +++ b/.github/VOUCHED.td @@ -8,7 +8,9 @@ # - Denounce with minus prefix: -username or -platform:username. # - Optional details after a space following the handle. adamdotdevin +-agusbasari29 AI PR slop ariane-emory +edemaine -florianleibert fwang iamdavidhill diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.yml index 20d53e81e8c..e7966cb48c7 100644 --- a/.github/actions/setup-bun/action.yml +++ b/.github/actions/setup-bun/action.yml @@ -1,5 +1,10 @@ name: "Setup Bun" description: "Setup Bun with caching and install dependencies" +inputs: + cross-compile: + description: "Pre-cache canary cross-compile binaries for all targets" + required: false + default: "false" runs: using: "composite" steps: @@ -11,10 +16,72 @@ runs: restore-keys: | ${{ runner.os }}-bun- + - name: Get baseline download URL + id: bun-url + shell: bash + run: | + if [ "$RUNNER_ARCH" = "X64" ]; then + case "$RUNNER_OS" in + macOS) OS=darwin ;; + Linux) OS=linux ;; + Windows) OS=windows ;; + esac + echo "url=https://github.com/oven-sh/bun/releases/download/canary/bun-${OS}-x64-baseline.zip" >> "$GITHUB_OUTPUT" + fi + - name: Setup Bun uses: oven-sh/setup-bun@v2 with: - bun-version-file: package.json + bun-version-file: ${{ !steps.bun-url.outputs.url && 'package.json' || '' }} + bun-download-url: ${{ steps.bun-url.outputs.url }} + + - name: Pre-cache canary cross-compile binaries + if: inputs.cross-compile == 'true' + shell: bash + run: | + BUN_VERSION=$(bun --revision) + if echo "$BUN_VERSION" | grep -q "canary"; then + SEMVER=$(echo "$BUN_VERSION" | sed 's/^\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/') + echo "Bun version: $BUN_VERSION (semver: $SEMVER)" + CACHE_DIR="$HOME/.bun/install/cache" + mkdir -p "$CACHE_DIR" + TMP_DIR=$(mktemp -d) + for TARGET in linux-aarch64 linux-x64 linux-x64-baseline linux-aarch64-musl linux-x64-musl linux-x64-musl-baseline darwin-aarch64 darwin-x64 windows-x64 windows-x64-baseline; do + DEST="$CACHE_DIR/bun-${TARGET}-v${SEMVER}" + if [ -f "$DEST" ]; then + echo "Already cached: $DEST" + continue + fi + URL="https://github.com/oven-sh/bun/releases/download/canary/bun-${TARGET}.zip" + echo "Downloading $TARGET from $URL" + if curl -sfL -o "$TMP_DIR/bun.zip" "$URL"; then + unzip -qo "$TMP_DIR/bun.zip" -d "$TMP_DIR" + if echo "$TARGET" | grep -q "windows"; then + BIN_NAME="bun.exe" + else + BIN_NAME="bun" + fi + mv "$TMP_DIR/bun-${TARGET}/$BIN_NAME" "$DEST" + chmod +x "$DEST" + rm -rf "$TMP_DIR/bun-${TARGET}" "$TMP_DIR/bun.zip" + echo "Cached: $DEST" + # baseline bun resolves "bun-darwin-x64" to the baseline cache key + # so copy the modern binary there too + if [ "$TARGET" = "darwin-x64" ]; then + BASELINE_DEST="$CACHE_DIR/bun-darwin-x64-baseline-v${SEMVER}" + if [ ! -f "$BASELINE_DEST" ]; then + cp "$DEST" "$BASELINE_DEST" + echo "Cached (baseline alias): $BASELINE_DEST" + fi + fi + else + echo "Skipped: $TARGET (not available)" + fi + done + rm -rf "$TMP_DIR" + else + echo "Not a canary build ($BUN_VERSION), skipping pre-cache" + fi - name: Install dependencies run: bun install diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 20d2bc18d82..a7106667b11 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/.github/workflows/compliance-close.yml b/.github/workflows/compliance-close.yml index 5b424d0adfa..c3bcf9f686f 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/docs-locale-sync.yml b/.github/workflows/docs-locale-sync.yml index 1aafc5d1e3b..f62afae4b9f 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/.github/workflows/pr-standards.yml b/.github/workflows/pr-standards.yml index 27581d06b76..1edbd5d061d 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); diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8d4c9038a7e..cca7df5c4ed 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -77,6 +77,8 @@ jobs: fetch-tags: true - uses: ./.github/actions/setup-bun + with: + cross-compile: "true" - name: Setup git committer id: committer @@ -88,7 +90,7 @@ jobs: - name: Build id: build run: | - ./packages/opencode/script/build.ts + ./packages/opencode/script/build.ts --all env: OPENCODE_VERSION: ${{ needs.version.outputs.version }} OPENCODE_RELEASE: ${{ needs.version.outputs.release }} diff --git a/.github/workflows/sign-cli.yml b/.github/workflows/sign-cli.yml index d9d61fd800e..89176223176 100644 --- a/.github/workflows/sign-cli.yml +++ b/.github/workflows/sign-cli.yml @@ -20,10 +20,12 @@ jobs: fetch-tags: true - uses: ./.github/actions/setup-bun + with: + cross-compile: "true" - name: Build run: | - ./packages/opencode/script/build.ts + ./packages/opencode/script/build.ts --all - name: Upload unsigned Windows CLI id: upload_unsigned_windows_cli diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 647b9e18869..f7b00516f8d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,8 +8,16 @@ on: workflow_dispatch: jobs: unit: - name: unit (linux) - runs-on: blacksmith-4vcpu-ubuntu-2404 + name: unit (${{ matrix.settings.name }}) + strategy: + fail-fast: false + matrix: + settings: + - name: linux + host: blacksmith-4vcpu-ubuntu-2404 + - name: windows + host: blacksmith-4vcpu-windows-2025 + runs-on: ${{ matrix.settings.host }} defaults: run: shell: bash diff --git a/.github/workflows/vouch-check-issue.yml b/.github/workflows/vouch-check-issue.yml index 94569f47312..4c2aa960b2a 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 470b8e0a5ad..51816dfb759 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 cf0524c21a8..9604bf87f37 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 }} diff --git a/.opencode/agent/translator.md b/.opencode/agent/translator.md index f0b3f8e9270..6ef6d0847a3 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 diff --git a/bun.lock b/bun.lock index 04da112cf79..2bdab5cb6af 100644 --- a/bun.lock +++ b/bun.lock @@ -25,7 +25,7 @@ }, "packages/app": { "name": "@opencode-ai/app", - "version": "1.2.10", + "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.10", + "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.10", + "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.10", + "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.10", + "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.10", + "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.10", + "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.10", + "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.10", + "version": "1.2.14", "bin": { "opencode": "./bin/opencode", }, @@ -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", @@ -376,7 +376,7 @@ }, "packages/plugin": { "name": "@opencode-ai/plugin", - "version": "1.2.10", + "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.10", + "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.10", + "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.10", + "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.10", + "version": "1.2.14", "dependencies": { "zod": "catalog:", }, @@ -473,7 +473,7 @@ }, "packages/web": { "name": "@opencode-ai/web", - "version": "1.2.10", + "version": "1.2.14", "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", @@ -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/infra/console.ts b/infra/console.ts index 3f3c2b8d935..de72cb072ee 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 Go", +}) +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/nix/hashes.json b/nix/hashes.json index d07b8f0f6b4..426f484f031 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=" } } diff --git a/packages/app/e2e/session/session-composer-dock.spec.ts b/packages/app/e2e/session/session-composer-dock.spec.ts index 6bf7714a66d..e9cfc03e485 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/e2e/utils.ts b/packages/app/e2e/utils.ts index ec6cdf83023..e015a1e9b96 100644 --- a/packages/app/e2e/utils.ts +++ b/packages/app/e2e/utils.ts @@ -1,7 +1,7 @@ import { createOpencodeClient } from "@opencode-ai/sdk/v2/client" import { base64Encode } from "@opencode-ai/util/encode" -export const serverHost = process.env.PLAYWRIGHT_SERVER_HOST ?? "localhost" +export const serverHost = process.env.PLAYWRIGHT_SERVER_HOST ?? "127.0.0.1" export const serverPort = process.env.PLAYWRIGHT_SERVER_PORT ?? "4096" export const serverUrl = `http://${serverHost}:${serverPort}` diff --git a/packages/app/package.json b/packages/app/package.json index b9397b0f40d..37d2801baf7 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.14", "description": "", "type": "module", "exports": { diff --git a/packages/app/playwright.config.ts b/packages/app/playwright.config.ts index ea85829e0bc..a97c8265144 100644 --- a/packages/app/playwright.config.ts +++ b/packages/app/playwright.config.ts @@ -1,8 +1,8 @@ import { defineConfig, devices } from "@playwright/test" const port = Number(process.env.PLAYWRIGHT_PORT ?? 3000) -const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? `http://localhost:${port}` -const serverHost = process.env.PLAYWRIGHT_SERVER_HOST ?? "localhost" +const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? `http://127.0.0.1:${port}` +const serverHost = process.env.PLAYWRIGHT_SERVER_HOST ?? "127.0.0.1" const serverPort = process.env.PLAYWRIGHT_SERVER_PORT ?? "4096" const command = `bun run dev -- --host 0.0.0.0 --port ${port}` const reuse = !process.env.CI diff --git a/packages/app/src/components/file-tree.tsx b/packages/app/src/components/file-tree.tsx index cec09435425..3840f18ed87 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)} + > +
+ + + + + + + + + - - - - - - - - - - - - + + + + ) diff --git a/packages/app/src/components/session/session-header.tsx b/packages/app/src/components/session/session-header.tsx index 825d1dab6cf..d531fa50ab6 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/app/src/components/settings-general.tsx b/packages/app/src/components/settings-general.tsx index cf993840dc8..42ee4092f68 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/file/path.test.ts b/packages/app/src/context/file/path.test.ts index f2a3c44b6c4..feef6d466ef 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 859fdc04062..53f072b6cb2 100644 --- a/packages/app/src/context/file/path.ts +++ b/packages/app/src/context/file/path.ts @@ -104,26 +104,29 @@ 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)) { + // 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[canonRoot.length] === "/") + ) { + // 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 } diff --git a/packages/app/src/context/global-sdk.tsx b/packages/app/src/context/global-sdk.tsx index 8c0035d555b..c1a87b95b89 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) diff --git a/packages/app/src/context/global-sync.tsx b/packages/app/src/context/global-sync.tsx index 7e242130f15..f87c3fb394e 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,12 +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() const platform = usePlatform() @@ -207,8 +202,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 6e771482890..b2610656103 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/context/settings.tsx b/packages/app/src/context/settings.tsx index d279a7f321b..b43469b5c37 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 e860a7e5d56..91a16b3b853 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 e96a0195df8..7682a12b697 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 1852afcd14c..cb0274042ed 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", @@ -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 c5d2dc25f1f..30cc555eb1a 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", @@ -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 34a80ee4c5f..3a7bbe92772 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 7ba82066c78..0b4388ceb19 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", @@ -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", @@ -600,6 +601,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 +614,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 28988bba1e1..3566226d7bf 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", @@ -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 643c5e82113..c961f060e1f 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 5f6e9240252..7a62c9de271 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 d5a0b090b93..8967c71cff7 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 10a8c1042fa..3fbe75716d0 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", @@ -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 9038fd1ad2f..d8ae150d7cb 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", @@ -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 69fee5c89a4..a7d328924a4 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": "Доступ ко всем поддерживаемым моделям через одного провайдера", @@ -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 d66c8f6075b..1e9773bf021 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": "เข้าถึงโมเดลที่รองรับทั้งหมดจากผู้ให้บริการเดียว", @@ -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 46daeb701ff..62c7bb9ff23 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 bbb00727b70..cb8f068f63b 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/directory-layout.tsx b/packages/app/src/pages/directory-layout.tsx index 4f1d93ab282..71b52180f2e 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.tsx b/packages/app/src/pages/session.tsx index a3f4b7164b4..2e440a6b036 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 } @@ -274,6 +275,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 +537,7 @@ export default function Page() { ) : (
-
{language.t("session.review.empty")}
+
{language.t(reviewEmptyKey())}
) } 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 00000000000..7b6029eb31b --- /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 04c6f7e692a..ed65867ef00 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 00000000000..f9673e25494 --- /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/app/src/pages/session/composer/session-todo-dock.tsx b/packages/app/src/pages/session/composer/session-todo-dock.tsx index ca7a5abd155..27998276023 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() diff --git a/packages/app/src/pages/session/file-tabs.tsx b/packages/app/src/pages/session/file-tabs.tsx index 032756cabd8..4b30915d865 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) }} diff --git a/packages/app/src/pages/session/helpers.test.ts b/packages/app/src/pages/session/helpers.test.ts index 7d357e6572c..aaa5b932fe9 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"]) }) }) diff --git a/packages/app/src/pages/session/helpers.ts b/packages/app/src/pages/session/helpers.ts index 995f6eb191d..20f1d99a8be 100644 --- a/packages/app/src/pages/session/helpers.ts +++ b/packages/app/src/pages/session/helpers.ts @@ -24,13 +24,15 @@ export const createOpenReviewFile = (input: { showAllFiles: () => void tabForPath: (path: string) => string openTab: (tab: string) => void - loadFile: (path: string) => void + loadFile: (path: string) => any | Promise }) => { return (path: string) => { batch(() => { input.showAllFiles() - input.openTab(input.tabForPath(path)) - input.loadFile(path) + const maybePromise = input.loadFile(path) + const openTab = () => input.openTab(input.tabForPath(path)) + if (maybePromise instanceof Promise) maybePromise.then(openTab) + else openTab() }) } } diff --git a/packages/app/src/pages/session/message-timeline.tsx b/packages/app/src/pages/session/message-timeline.tsx index b13ccb474ac..b8410903550 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: { >
{ + 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 00000000000..4b9727e61d8 --- /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") +} diff --git a/packages/console/app/package.json b/packages/console/app/package.json index 904aeadd8e0..05d2309a423 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -1,13 +1,13 @@ { "name": "@opencode-ai/console-app", - "version": "1.2.10", + "version": "1.2.14", "type": "module", "license": "MIT", "scripts": { "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 ./.output/public/tui.json", "start": "vite start" }, "dependencies": { diff --git a/packages/console/app/src/i18n/ar.ts b/packages/console/app/src/i18n/ar.ts index bf22ec157fc..cda1e2a3637 100644 --- a/packages/console/app/src/i18n/ar.ts +++ b/packages/console/app/src/i18n/ar.ts @@ -243,6 +243,7 @@ export const dict = { "black.hero.title": "الوصول إلى أفضل نماذج البرمجة في العالم", "black.hero.subtitle": "بما في ذلك Claude، GPT، Gemini والمزيد", "black.title": "OpenCode Black | الأسعار", + "black.paused": "التسجيل في خطة Black متوقف مؤقتًا.", "black.plan.icon20": "خطة Black 20", "black.plan.icon100": "خطة Black 100", "black.plan.icon200": "خطة Black 200", @@ -337,12 +338,15 @@ 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": "كتابة الكاش", "workspace.usage.breakdown.output": "الخرج", "workspace.usage.breakdown.reasoning": "المنطق", - "workspace.usage.subscription": "الاشتراك (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "التكلفة", "workspace.cost.subtitle": "تكاليف الاستخدام مقسمة حسب النموذج.", @@ -351,6 +355,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(محذوف)", "workspace.cost.empty": "لا توجد بيانات استخدام متاحة للفترة المحددة.", "workspace.cost.subscriptionShort": "اشتراك", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "مفاتيح API", "workspace.keys.subtitle": "إدارة مفاتيح API الخاصة بك للوصول إلى خدمات opencode.", @@ -478,6 +483,36 @@ export const dict = { "workspace.black.waitlist.enrolled": "مسجل", "workspace.black.waitlist.enrollNote": 'عند النقر فوق "تسجيل"، يبدأ اشتراكك على الفور وسيتم خصم الرسوم من بطاقتك.', + "workspace.lite.loading": "جارٍ التحميل...", + "workspace.lite.time.day": "يوم", + "workspace.lite.time.days": "أيام", + "workspace.lite.time.hour": "ساعة", + "workspace.lite.time.hours": "ساعات", + "workspace.lite.time.minute": "دقيقة", + "workspace.lite.time.minutes": "دقائق", + "workspace.lite.time.fewSeconds": "بضع ثوان", + "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.subscription.selectProvider": + 'اختر "OpenCode Go" كمزود في إعدادات opencode الخاصة بك لاستخدام نماذج Go.', + "workspace.lite.other.title": "اشتراك Go", + "workspace.lite.other.message": + "عضو آخر في مساحة العمل هذه مشترك بالفعل في OpenCode Go. يمكن لعضو واحد فقط لكل مساحة عمل الاشتراك.", + "workspace.lite.promo.title": "OpenCode Go", + "workspace.lite.promo.description": + "OpenCode Go هو اشتراك بسعر $10 شهريًا يوفر وصولاً موثوقًا إلى نماذج البرمجة المفتوحة الشائعة مع حدود استخدام سخية.", + "workspace.lite.promo.modelsTitle": "ما يتضمنه", + "workspace.lite.promo.footer": + "تم تصميم الخطة بشكل أساسي للمستخدمين الدوليين، مع استضافة النماذج في الولايات المتحدة والاتحاد الأوروبي وسنغافورة للحصول على وصول عالمي مستقر. قد تتغير الأسعار وحدود الاستخدام بناءً على تعلمنا من الاستخدام المبكر والملاحظات.", + "workspace.lite.promo.subscribe": "الاشتراك في Go", + "workspace.lite.promo.subscribing": "جارٍ إعادة التوجيه...", + "download.title": "OpenCode | تنزيل", "download.meta.description": "نزّل OpenCode لـ macOS، Windows، وLinux", "download.hero.title": "تنزيل OpenCode", diff --git a/packages/console/app/src/i18n/br.ts b/packages/console/app/src/i18n/br.ts index 0f39484eff4..ddeb0c10a94 100644 --- a/packages/console/app/src/i18n/br.ts +++ b/packages/console/app/src/i18n/br.ts @@ -247,6 +247,7 @@ export const dict = { "black.hero.title": "Acesse os melhores modelos de codificação do mundo", "black.hero.subtitle": "Incluindo Claude, GPT, Gemini e mais", "black.title": "OpenCode Black | Preços", + "black.paused": "A inscrição no plano Black está temporariamente pausada.", "black.plan.icon20": "Plano Black 20", "black.plan.icon100": "Plano Black 100", "black.plan.icon200": "Plano Black 200", @@ -342,12 +343,15 @@ 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", "workspace.usage.breakdown.output": "Saída", "workspace.usage.breakdown.reasoning": "Raciocínio", - "workspace.usage.subscription": "assinatura (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Custo", "workspace.cost.subtitle": "Custos de uso discriminados por modelo.", @@ -356,6 +360,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(excluído)", "workspace.cost.empty": "Nenhum dado de uso disponível para o período selecionado.", "workspace.cost.subscriptionShort": "ass", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "Chaves de API", "workspace.keys.subtitle": "Gerencie suas chaves de API para acessar os serviços opencode.", @@ -484,6 +489,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Ao clicar em Inscrever-se, sua assinatura começará imediatamente e seu cartão será cobrado.", + "workspace.lite.loading": "Carregando...", + "workspace.lite.time.day": "dia", + "workspace.lite.time.days": "dias", + "workspace.lite.time.hour": "hora", + "workspace.lite.time.hours": "horas", + "workspace.lite.time.minute": "minuto", + "workspace.lite.time.minutes": "minutos", + "workspace.lite.time.fewSeconds": "alguns segundos", + "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.subscription.selectProvider": + 'Selecione "OpenCode Go" como provedor na sua configuração do opencode para usar os modelos Go.', + "workspace.lite.other.title": "Assinatura Go", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "Baixe o OpenCode para macOS, Windows e Linux", "download.hero.title": "Baixar OpenCode", diff --git a/packages/console/app/src/i18n/da.ts b/packages/console/app/src/i18n/da.ts index 39f8cfb5252..18b2b89ff95 100644 --- a/packages/console/app/src/i18n/da.ts +++ b/packages/console/app/src/i18n/da.ts @@ -245,6 +245,7 @@ export const dict = { "black.hero.title": "Få adgang til verdens bedste kodningsmodeller", "black.hero.subtitle": "Inklusive Claude, GPT, Gemini og mere", "black.title": "OpenCode Black | Priser", + "black.paused": "Black-plantilmelding er midlertidigt sat på pause.", "black.plan.icon20": "Black 20-plan", "black.plan.icon100": "Black 100-plan", "black.plan.icon200": "Black 200-plan", @@ -340,12 +341,15 @@ 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", "workspace.usage.breakdown.output": "Output", "workspace.usage.breakdown.reasoning": "Ræsonnement", - "workspace.usage.subscription": "abonnement (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Omkostninger", "workspace.cost.subtitle": "Brugsomkostninger opdelt efter model.", @@ -354,6 +358,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(slettet)", "workspace.cost.empty": "Ingen brugsdata tilgængelige for den valgte periode.", "workspace.cost.subscriptionShort": "sub", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API-nøgler", "workspace.keys.subtitle": "Administrer dine API-nøgler for at få adgang til opencode-tjenester.", @@ -482,6 +487,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Når du klikker på Tilmeld, starter dit abonnement med det samme, og dit kort vil blive debiteret.", + "workspace.lite.loading": "Indlæser...", + "workspace.lite.time.day": "dag", + "workspace.lite.time.days": "dage", + "workspace.lite.time.hour": "time", + "workspace.lite.time.hours": "timer", + "workspace.lite.time.minute": "minut", + "workspace.lite.time.minutes": "minutter", + "workspace.lite.time.fewSeconds": "et par sekunder", + "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.subscription.selectProvider": + 'Vælg "OpenCode Go" som udbyder i din opencode-konfiguration for at bruge Go-modeller.', + "workspace.lite.other.title": "Go-abonnement", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "Download OpenCode til macOS, Windows og Linux", "download.hero.title": "Download OpenCode", diff --git a/packages/console/app/src/i18n/de.ts b/packages/console/app/src/i18n/de.ts index 733f38ca5fc..5bee74aed39 100644 --- a/packages/console/app/src/i18n/de.ts +++ b/packages/console/app/src/i18n/de.ts @@ -247,6 +247,7 @@ export const dict = { "black.hero.title": "Zugriff auf die weltweit besten Coding-Modelle", "black.hero.subtitle": "Einschließlich Claude, GPT, Gemini und mehr", "black.title": "OpenCode Black | Preise", + "black.paused": "Die Anmeldung zum Black-Plan ist vorübergehend pausiert.", "black.plan.icon20": "Black 20 Plan", "black.plan.icon100": "Black 100 Plan", "black.plan.icon200": "Black 200 Plan", @@ -342,12 +343,15 @@ 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", "workspace.usage.breakdown.output": "Output", "workspace.usage.breakdown.reasoning": "Reasoning", - "workspace.usage.subscription": "Abonnement (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Kosten", "workspace.cost.subtitle": "Nutzungskosten aufgeschlüsselt nach Modell.", @@ -356,6 +360,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(gelöscht)", "workspace.cost.empty": "Keine Nutzungsdaten für den gewählten Zeitraum verfügbar.", "workspace.cost.subscriptionShort": "Abo", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API Keys", "workspace.keys.subtitle": "Verwalte deine API Keys für den Zugriff auf OpenCode-Dienste.", @@ -484,6 +489,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Wenn du auf Einschreiben klickst, startet dein Abo sofort und deine Karte wird belastet.", + "workspace.lite.loading": "Lade...", + "workspace.lite.time.day": "Tag", + "workspace.lite.time.days": "Tage", + "workspace.lite.time.hour": "Stunde", + "workspace.lite.time.hours": "Stunden", + "workspace.lite.time.minute": "Minute", + "workspace.lite.time.minutes": "Minuten", + "workspace.lite.time.fewSeconds": "einige Sekunden", + "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.subscription.selectProvider": + 'Wähle "OpenCode Go" als Anbieter in deiner opencode-Konfiguration, um Go-Modelle zu verwenden.', + "workspace.lite.other.title": "Go-Abonnement", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "Lade OpenCode für macOS, Windows und Linux herunter", "download.hero.title": "OpenCode herunterladen", diff --git a/packages/console/app/src/i18n/en.ts b/packages/console/app/src/i18n/en.ts index 08c716aba3b..d6db2e7f8af 100644 --- a/packages/console/app/src/i18n/en.ts +++ b/packages/console/app/src/i18n/en.ts @@ -239,6 +239,7 @@ export const dict = { "black.hero.title": "Access all the world's best coding models", "black.hero.subtitle": "Including Claude, GPT, Gemini and more", "black.title": "OpenCode Black | Pricing", + "black.paused": "Black plan enrollment is temporarily paused.", "black.plan.icon20": "Black 20 plan", "black.plan.icon100": "Black 100 plan", "black.plan.icon200": "Black 200 plan", @@ -334,12 +335,15 @@ 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", "workspace.usage.breakdown.output": "Output", "workspace.usage.breakdown.reasoning": "Reasoning", - "workspace.usage.subscription": "subscription (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Cost", "workspace.cost.subtitle": "Usage costs broken down by model.", @@ -348,6 +352,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(deleted)", "workspace.cost.empty": "No usage data available for the selected period.", "workspace.cost.subscriptionShort": "sub", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API Keys", "workspace.keys.subtitle": "Manage your API keys for accessing opencode services.", @@ -476,6 +481,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "When you click Enroll, your subscription starts immediately and your card will be charged.", + "workspace.lite.loading": "Loading...", + "workspace.lite.time.day": "day", + "workspace.lite.time.days": "days", + "workspace.lite.time.hour": "hour", + "workspace.lite.time.hours": "hours", + "workspace.lite.time.minute": "minute", + "workspace.lite.time.minutes": "minutes", + "workspace.lite.time.fewSeconds": "a few seconds", + "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.subscription.selectProvider": + 'Select "OpenCode Go" as the provider in your opencode configuration to use Go models.', + "workspace.lite.other.title": "Go Subscription", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "Download OpenCode for macOS, Windows, and Linux", "download.hero.title": "Download OpenCode", diff --git a/packages/console/app/src/i18n/es.ts b/packages/console/app/src/i18n/es.ts index 1a18a872ebf..c4676fe6e9a 100644 --- a/packages/console/app/src/i18n/es.ts +++ b/packages/console/app/src/i18n/es.ts @@ -248,6 +248,7 @@ export const dict = { "black.hero.title": "Accede a los mejores modelos de codificación del mundo", "black.hero.subtitle": "Incluyendo Claude, GPT, Gemini y más", "black.title": "OpenCode Black | Precios", + "black.paused": "La inscripción al plan Black está temporalmente pausada.", "black.plan.icon20": "Plan Black 20", "black.plan.icon100": "Plan Black 100", "black.plan.icon200": "Plan Black 200", @@ -343,12 +344,15 @@ 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é", "workspace.usage.breakdown.output": "Salida", "workspace.usage.breakdown.reasoning": "Razonamiento", - "workspace.usage.subscription": "suscripción (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Costo", "workspace.cost.subtitle": "Costos de uso desglosados por modelo.", @@ -357,6 +361,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(eliminado)", "workspace.cost.empty": "No hay datos de uso disponibles para el periodo seleccionado.", "workspace.cost.subscriptionShort": "sub", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "Claves API", "workspace.keys.subtitle": "Gestiona tus claves API para acceder a los servicios de opencode.", @@ -485,6 +490,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Cuando haces clic en Inscribirse, tu suscripción comienza inmediatamente y se cargará a tu tarjeta.", + "workspace.lite.loading": "Cargando...", + "workspace.lite.time.day": "día", + "workspace.lite.time.days": "días", + "workspace.lite.time.hour": "hora", + "workspace.lite.time.hours": "horas", + "workspace.lite.time.minute": "minuto", + "workspace.lite.time.minutes": "minutos", + "workspace.lite.time.fewSeconds": "unos pocos segundos", + "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.subscription.selectProvider": + 'Selecciona "OpenCode Go" como proveedor en tu configuración de opencode para usar los modelos Go.', + "workspace.lite.other.title": "Suscripción Go", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "Descarga OpenCode para macOS, Windows y Linux", "download.hero.title": "Descargar OpenCode", diff --git a/packages/console/app/src/i18n/fr.ts b/packages/console/app/src/i18n/fr.ts index 8974927a967..7b2306bc2f6 100644 --- a/packages/console/app/src/i18n/fr.ts +++ b/packages/console/app/src/i18n/fr.ts @@ -251,6 +251,7 @@ export const dict = { "black.hero.title": "Accédez aux meilleurs modèles de code au monde", "black.hero.subtitle": "Y compris Claude, GPT, Gemini et plus", "black.title": "OpenCode Black | Tarification", + "black.paused": "L'inscription au plan Black est temporairement suspendue.", "black.plan.icon20": "Forfait Black 20", "black.plan.icon100": "Forfait Black 100", "black.plan.icon200": "Forfait Black 200", @@ -348,12 +349,15 @@ 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", "workspace.usage.breakdown.output": "Sortie", "workspace.usage.breakdown.reasoning": "Raisonnement", - "workspace.usage.subscription": "abonnement ({{amount}} $)", + "workspace.usage.subscription": "Black ({{amount}} $)", + "workspace.usage.lite": "Go ({{amount}} $)", + "workspace.usage.byok": "BYOK ({{amount}} $)", "workspace.cost.title": "Coût", "workspace.cost.subtitle": "Coûts d'utilisation répartis par modèle.", @@ -362,6 +366,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(supprimé)", "workspace.cost.empty": "Aucune donnée d'utilisation disponible pour la période sélectionnée.", "workspace.cost.subscriptionShort": "abo", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "Clés API", "workspace.keys.subtitle": "Gérez vos clés API pour accéder aux services OpenCode.", @@ -493,6 +498,37 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Lorsque vous cliquez sur S'inscrire, votre abonnement démarre immédiatement et votre carte sera débitée.", + "workspace.lite.loading": "Chargement...", + "workspace.lite.time.day": "jour", + "workspace.lite.time.days": "jours", + "workspace.lite.time.hour": "heure", + "workspace.lite.time.hours": "heures", + "workspace.lite.time.minute": "minute", + "workspace.lite.time.minutes": "minutes", + "workspace.lite.time.fewSeconds": "quelques secondes", + "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", + "workspace.lite.subscription.monthlyUsage": "Utilisation mensuelle", + "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.subscription.selectProvider": + 'Sélectionnez "OpenCode Go" comme fournisseur dans votre configuration opencode pour utiliser les modèles Go.', + "workspace.lite.other.title": "Abonnement Go", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "Téléchargez OpenCode pour macOS, Windows et Linux", "download.hero.title": "Télécharger OpenCode", diff --git a/packages/console/app/src/i18n/it.ts b/packages/console/app/src/i18n/it.ts index ce464f0009a..81dd293057f 100644 --- a/packages/console/app/src/i18n/it.ts +++ b/packages/console/app/src/i18n/it.ts @@ -246,6 +246,7 @@ export const dict = { "black.hero.title": "Accedi ai migliori modelli di coding al mondo", "black.hero.subtitle": "Inclusi Claude, GPT, Gemini e altri", "black.title": "OpenCode Black | Prezzi", + "black.paused": "L'iscrizione al piano Black è temporaneamente sospesa.", "black.plan.icon20": "Piano Black 20", "black.plan.icon100": "Piano Black 100", "black.plan.icon200": "Piano Black 200", @@ -342,12 +343,15 @@ 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", "workspace.usage.breakdown.output": "Output", "workspace.usage.breakdown.reasoning": "Reasoning", - "workspace.usage.subscription": "abbonamento (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Costo", "workspace.cost.subtitle": "Costi di utilizzo suddivisi per modello.", @@ -356,6 +360,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(eliminato)", "workspace.cost.empty": "Nessun dato di utilizzo disponibile per il periodo selezionato.", "workspace.cost.subscriptionShort": "sub", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "Chiavi API", "workspace.keys.subtitle": "Gestisci le tue chiavi API per accedere ai servizi opencode.", @@ -484,6 +489,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Quando clicchi su Iscriviti, il tuo abbonamento inizia immediatamente e la tua carta verrà addebitata.", + "workspace.lite.loading": "Caricamento...", + "workspace.lite.time.day": "giorno", + "workspace.lite.time.days": "giorni", + "workspace.lite.time.hour": "ora", + "workspace.lite.time.hours": "ore", + "workspace.lite.time.minute": "minuto", + "workspace.lite.time.minutes": "minuti", + "workspace.lite.time.fewSeconds": "pochi secondi", + "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.subscription.selectProvider": + 'Seleziona "OpenCode Go" come provider nella tua configurazione opencode per utilizzare i modelli Go.', + "workspace.lite.other.title": "Abbonamento Go", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "Scarica OpenCode per macOS, Windows e Linux", "download.hero.title": "Scarica OpenCode", diff --git a/packages/console/app/src/i18n/ja.ts b/packages/console/app/src/i18n/ja.ts index 4dea6ccf4fe..afcf6aeb9b3 100644 --- a/packages/console/app/src/i18n/ja.ts +++ b/packages/console/app/src/i18n/ja.ts @@ -244,6 +244,7 @@ export const dict = { "black.hero.title": "世界最高峰のコーディングモデルすべてにアクセス", "black.hero.subtitle": "Claude、GPT、Gemini などを含む", "black.title": "OpenCode Black | 料金", + "black.paused": "Blackプランの登録は一時的に停止しています。", "black.plan.icon20": "Black 20 プラン", "black.plan.icon100": "Black 100 プラン", "black.plan.icon200": "Black 200 プラン", @@ -339,12 +340,15 @@ 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": "キャッシュ書き込み", "workspace.usage.breakdown.output": "出力", "workspace.usage.breakdown.reasoning": "推論", - "workspace.usage.subscription": "サブスクリプション (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "コスト", "workspace.cost.subtitle": "モデルごとの使用料金の内訳。", @@ -353,6 +357,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(削除済み)", "workspace.cost.empty": "選択した期間の使用状況データはありません。", "workspace.cost.subscriptionShort": "サブ", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "APIキー", "workspace.keys.subtitle": "OpenCodeサービスにアクセスするためのAPIキーを管理します。", @@ -482,6 +487,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "「登録する」をクリックすると、サブスクリプションがすぐに開始され、カードに請求されます。", + "workspace.lite.loading": "読み込み中...", + "workspace.lite.time.day": "日", + "workspace.lite.time.days": "日", + "workspace.lite.time.hour": "時間", + "workspace.lite.time.hours": "時間", + "workspace.lite.time.minute": "分", + "workspace.lite.time.minutes": "分", + "workspace.lite.time.fewSeconds": "数秒", + "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.subscription.selectProvider": + "Go モデルを使用するには、opencode の設定で「OpenCode Go」をプロバイダーとして選択してください。", + "workspace.lite.other.title": "Goサブスクリプション", + "workspace.lite.other.message": + "このワークスペースの別のメンバーが既に OpenCode Go を購読しています。ワークスペースにつき1人のメンバーのみが購読できます。", + "workspace.lite.promo.title": "OpenCode Go", + "workspace.lite.promo.description": + "OpenCode Goは月額$10のサブスクリプションプランで、人気のオープンコーディングモデルへの安定したアクセスを十分な利用枠で提供します。", + "workspace.lite.promo.modelsTitle": "含まれるもの", + "workspace.lite.promo.footer": + "このプランは主にグローバルユーザー向けに設計されており、米国、EU、シンガポールでホストされたモデルにより安定したグローバルアクセスを提供します。料金と利用制限は、初期の利用状況やフィードバックに基づいて変更される可能性があります。", + "workspace.lite.promo.subscribe": "Goを購読する", + "workspace.lite.promo.subscribing": "リダイレクト中...", + "download.title": "OpenCode | ダウンロード", "download.meta.description": "OpenCode を macOS、Windows、Linux 向けにダウンロード", "download.hero.title": "OpenCode をダウンロード", diff --git a/packages/console/app/src/i18n/ko.ts b/packages/console/app/src/i18n/ko.ts index 984dbbe67b0..b2375c3f7d8 100644 --- a/packages/console/app/src/i18n/ko.ts +++ b/packages/console/app/src/i18n/ko.ts @@ -241,6 +241,7 @@ export const dict = { "black.hero.title": "세계 최고의 코딩 모델에 액세스하세요", "black.hero.subtitle": "Claude, GPT, Gemini 등 포함", "black.title": "OpenCode Black | 가격", + "black.paused": "Black 플랜 등록이 일시적으로 중단되었습니다.", "black.plan.icon20": "Black 20 플랜", "black.plan.icon100": "Black 100 플랜", "black.plan.icon200": "Black 200 플랜", @@ -336,12 +337,15 @@ 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": "캐시 쓰기", "workspace.usage.breakdown.output": "출력", "workspace.usage.breakdown.reasoning": "추론", - "workspace.usage.subscription": "구독 (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "비용", "workspace.cost.subtitle": "모델별 사용 비용 내역.", @@ -350,6 +354,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(삭제됨)", "workspace.cost.empty": "선택한 기간에 사용 데이터가 없습니다.", "workspace.cost.subscriptionShort": "구독", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API 키", "workspace.keys.subtitle": "OpenCode 서비스 액세스를 위한 API 키를 관리하세요.", @@ -477,6 +482,36 @@ export const dict = { "workspace.black.waitlist.enrolled": "등록됨", "workspace.black.waitlist.enrollNote": "등록을 클릭하면 구독이 즉시 시작되며 카드에 요금이 청구됩니다.", + "workspace.lite.loading": "로드 중...", + "workspace.lite.time.day": "일", + "workspace.lite.time.days": "일", + "workspace.lite.time.hour": "시간", + "workspace.lite.time.hours": "시간", + "workspace.lite.time.minute": "분", + "workspace.lite.time.minutes": "분", + "workspace.lite.time.fewSeconds": "몇 초", + "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.subscription.selectProvider": + 'Go 모델을 사용하려면 opencode 설정에서 "OpenCode Go"를 공급자로 선택하세요.', + "workspace.lite.other.title": "Go 구독", + "workspace.lite.other.message": + "이 워크스페이스의 다른 멤버가 이미 OpenCode Go를 구독 중입니다. 워크스페이스당 한 명의 멤버만 구독할 수 있습니다.", + "workspace.lite.promo.title": "OpenCode Go", + "workspace.lite.promo.description": + "OpenCode Go는 넉넉한 사용 한도와 함께 인기 있는 오픈 코딩 모델에 대한 안정적인 액세스를 제공하는 월 $10의 구독입니다.", + "workspace.lite.promo.modelsTitle": "포함 내역", + "workspace.lite.promo.footer": + "이 플랜은 주로 글로벌 사용자를 위해 설계되었으며, 안정적인 글로벌 액세스를 위해 미국, EU 및 싱가포르에 모델이 호스팅되어 있습니다. 가격 및 사용 한도는 초기 사용을 통해 학습하고 피드백을 수집함에 따라 변경될 수 있습니다.", + "workspace.lite.promo.subscribe": "Go 구독하기", + "workspace.lite.promo.subscribing": "리디렉션 중...", + "download.title": "OpenCode | 다운로드", "download.meta.description": "macOS, Windows, Linux용 OpenCode 다운로드", "download.hero.title": "OpenCode 다운로드", diff --git a/packages/console/app/src/i18n/no.ts b/packages/console/app/src/i18n/no.ts index 1f9b1b2464f..41bacfb053f 100644 --- a/packages/console/app/src/i18n/no.ts +++ b/packages/console/app/src/i18n/no.ts @@ -245,6 +245,7 @@ export const dict = { "black.hero.title": "Få tilgang til verdens beste kodemodeller", "black.hero.subtitle": "Inkludert Claude, GPT, Gemini og mer", "black.title": "OpenCode Black | Priser", + "black.paused": "Black-planregistrering er midlertidig satt på pause.", "black.plan.icon20": "Black 20-plan", "black.plan.icon100": "Black 100-plan", "black.plan.icon200": "Black 200-plan", @@ -340,12 +341,15 @@ 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", "workspace.usage.breakdown.output": "Output", "workspace.usage.breakdown.reasoning": "Resonnering", - "workspace.usage.subscription": "abonnement (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Kostnad", "workspace.cost.subtitle": "Brukskostnader fordelt på modell.", @@ -354,6 +358,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(slettet)", "workspace.cost.empty": "Ingen bruksdata tilgjengelig for den valgte perioden.", "workspace.cost.subscriptionShort": "sub", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API-nøkler", "workspace.keys.subtitle": "Administrer API-nøklene dine for å få tilgang til opencode-tjenester.", @@ -482,6 +487,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Når du klikker på Meld på, starter abonnementet umiddelbart og kortet ditt belastes.", + "workspace.lite.loading": "Laster...", + "workspace.lite.time.day": "dag", + "workspace.lite.time.days": "dager", + "workspace.lite.time.hour": "time", + "workspace.lite.time.hours": "timer", + "workspace.lite.time.minute": "minutt", + "workspace.lite.time.minutes": "minutter", + "workspace.lite.time.fewSeconds": "noen få sekunder", + "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.subscription.selectProvider": + 'Velg "OpenCode Go" som leverandør i opencode-konfigurasjonen din for å bruke Go-modeller.', + "workspace.lite.other.title": "Go-abonnement", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "Last ned OpenCode for macOS, Windows og Linux", "download.hero.title": "Last ned OpenCode", diff --git a/packages/console/app/src/i18n/pl.ts b/packages/console/app/src/i18n/pl.ts index f35300710cf..dc3c59196d5 100644 --- a/packages/console/app/src/i18n/pl.ts +++ b/packages/console/app/src/i18n/pl.ts @@ -246,6 +246,7 @@ export const dict = { "black.hero.title": "Dostęp do najlepszych na świecie modeli kodujących", "black.hero.subtitle": "W tym Claude, GPT, Gemini i inne", "black.title": "OpenCode Black | Cennik", + "black.paused": "Rejestracja planu Black jest tymczasowo wstrzymana.", "black.plan.icon20": "Plan Black 20", "black.plan.icon100": "Plan Black 100", "black.plan.icon200": "Plan Black 200", @@ -341,12 +342,15 @@ 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", "workspace.usage.breakdown.output": "Wyjście", "workspace.usage.breakdown.reasoning": "Rozumowanie", - "workspace.usage.subscription": "subskrypcja (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Koszt", "workspace.cost.subtitle": "Koszty użycia w podziale na modele.", @@ -355,6 +359,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(usunięte)", "workspace.cost.empty": "Brak danych o użyciu dla wybranego okresu.", "workspace.cost.subscriptionShort": "sub", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "Klucze API", "workspace.keys.subtitle": "Zarządzaj kluczami API do usług opencode.", @@ -483,6 +488,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Po kliknięciu Zapisz się, Twoja subskrypcja rozpocznie się natychmiast, a karta zostanie obciążona.", + "workspace.lite.loading": "Ładowanie...", + "workspace.lite.time.day": "dzień", + "workspace.lite.time.days": "dni", + "workspace.lite.time.hour": "godzina", + "workspace.lite.time.hours": "godzin(y)", + "workspace.lite.time.minute": "minuta", + "workspace.lite.time.minutes": "minut(y)", + "workspace.lite.time.fewSeconds": "kilka sekund", + "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.subscription.selectProvider": + 'Wybierz "OpenCode Go" jako dostawcę w konfiguracji opencode, aby używać modeli Go.', + "workspace.lite.other.title": "Subskrypcja Go", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "Pobierz OpenCode na macOS, Windows i Linux", "download.hero.title": "Pobierz OpenCode", diff --git a/packages/console/app/src/i18n/ru.ts b/packages/console/app/src/i18n/ru.ts index 27a30cc815e..21b89dc94e0 100644 --- a/packages/console/app/src/i18n/ru.ts +++ b/packages/console/app/src/i18n/ru.ts @@ -249,6 +249,7 @@ export const dict = { "black.hero.title": "Доступ к лучшим моделям для кодинга в мире", "black.hero.subtitle": "Включая Claude, GPT, Gemini и другие", "black.title": "OpenCode Black | Цены", + "black.paused": "Регистрация на план Black временно приостановлена.", "black.plan.icon20": "План Black 20", "black.plan.icon100": "План Black 100", "black.plan.icon200": "План Black 200", @@ -346,12 +347,15 @@ 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": "Запись кэша", "workspace.usage.breakdown.output": "Выход", "workspace.usage.breakdown.reasoning": "Reasoning (рассуждения)", - "workspace.usage.subscription": "подписка (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Расходы", "workspace.cost.subtitle": "Расходы на использование с разбивкой по моделям.", @@ -360,6 +364,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(удалено)", "workspace.cost.empty": "Нет данных об использовании за выбранный период.", "workspace.cost.subscriptionShort": "подписка", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API Ключи", "workspace.keys.subtitle": "Управляйте вашими API ключами для доступа к сервисам opencode.", @@ -488,6 +493,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Когда вы нажмете Подключиться, ваша подписка начнется немедленно, и с карты будет списана оплата.", + "workspace.lite.loading": "Загрузка...", + "workspace.lite.time.day": "день", + "workspace.lite.time.days": "дней", + "workspace.lite.time.hour": "час", + "workspace.lite.time.hours": "часов", + "workspace.lite.time.minute": "минута", + "workspace.lite.time.minutes": "минут", + "workspace.lite.time.fewSeconds": "несколько секунд", + "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.subscription.selectProvider": + 'Выберите "OpenCode Go" в качестве провайдера в настройках opencode для использования моделей Go.', + "workspace.lite.other.title": "Подписка Go", + "workspace.lite.other.message": + "Другой участник в этом рабочем пространстве уже подписан на OpenCode Go. Только один участник в рабочем пространстве может оформить подписку.", + "workspace.lite.promo.title": "OpenCode Go", + "workspace.lite.promo.description": + "OpenCode Go — это подписка за $10 в месяц, которая предоставляет надежный доступ к популярным открытым моделям для кодинга с щедрыми лимитами использования.", + "workspace.lite.promo.modelsTitle": "Что включено", + "workspace.lite.promo.footer": + "План предназначен в первую очередь для международных пользователей. Модели размещены в США, ЕС и Сингапуре для стабильного глобального доступа. Цены и лимиты использования могут меняться по мере того, как мы изучаем раннее использование и собираем отзывы.", + "workspace.lite.promo.subscribe": "Подписаться на Go", + "workspace.lite.promo.subscribing": "Перенаправление...", + "download.title": "OpenCode | Скачать", "download.meta.description": "Скачать OpenCode для macOS, Windows и Linux", "download.hero.title": "Скачать OpenCode", diff --git a/packages/console/app/src/i18n/th.ts b/packages/console/app/src/i18n/th.ts index d94be479c9f..0646483544f 100644 --- a/packages/console/app/src/i18n/th.ts +++ b/packages/console/app/src/i18n/th.ts @@ -244,6 +244,7 @@ export const dict = { "black.hero.title": "เข้าถึงโมเดลเขียนโค้ดที่ดีที่สุดในโลก", "black.hero.subtitle": "รวมถึง Claude, GPT, Gemini และอื่นๆ อีกมากมาย", "black.title": "OpenCode Black | ราคา", + "black.paused": "การสมัครแผน Black หยุดชั่วคราว", "black.plan.icon20": "แผน Black 20", "black.plan.icon100": "แผน Black 100", "black.plan.icon200": "แผน Black 200", @@ -339,12 +340,15 @@ 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", "workspace.usage.breakdown.output": "Output", "workspace.usage.breakdown.reasoning": "Reasoning", - "workspace.usage.subscription": "สมัครสมาชิก (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "ค่าใช้จ่าย", "workspace.cost.subtitle": "ต้นทุนการใช้งานแยกตามโมเดล", @@ -353,6 +357,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(ลบแล้ว)", "workspace.cost.empty": "ไม่มีข้อมูลการใช้งานในช่วงเวลาที่เลือก", "workspace.cost.subscriptionShort": "sub", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API Keys", "workspace.keys.subtitle": "จัดการ API keys ของคุณสำหรับการเข้าถึงบริการ OpenCode", @@ -481,6 +486,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "เมื่อคุณคลิกลงทะเบียน การสมัครสมาชิกของคุณจะเริ่มต้นทันทีและบัตรของคุณจะถูกเรียกเก็บเงิน", + "workspace.lite.loading": "กำลังโหลด...", + "workspace.lite.time.day": "วัน", + "workspace.lite.time.days": "วัน", + "workspace.lite.time.hour": "ชั่วโมง", + "workspace.lite.time.hours": "ชั่วโมง", + "workspace.lite.time.minute": "นาที", + "workspace.lite.time.minutes": "นาที", + "workspace.lite.time.fewSeconds": "ไม่กี่วินาที", + "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.subscription.selectProvider": + 'เลือก "OpenCode Go" เป็นผู้ให้บริการในการตั้งค่า opencode ของคุณเพื่อใช้โมเดล Go', + "workspace.lite.other.title": "การสมัครสมาชิก Go", + "workspace.lite.other.message": + "สมาชิกคนอื่นใน Workspace นี้ได้สมัคร OpenCode Go แล้ว สามารถสมัครได้เพียงหนึ่งคนต่อหนึ่ง Workspace เท่านั้น", + "workspace.lite.promo.title": "OpenCode Go", + "workspace.lite.promo.description": + "OpenCode Go เป็นการสมัครสมาชิกราคา 10 ดอลลาร์ต่อเดือน ที่ให้การเข้าถึงโมเดลโอเพนโค้ดดิงยอดนิยมได้อย่างเสถียร ด้วยขีดจำกัดการใช้งานที่ครอบคลุม", + "workspace.lite.promo.modelsTitle": "สิ่งที่รวมอยู่ด้วย", + "workspace.lite.promo.footer": + "แผนนี้ออกแบบมาสำหรับผู้ใช้งานต่างประเทศเป็นหลัก โดยมีโมเดลโฮสต์อยู่ในสหรัฐอเมริกา สหภาพยุโรป และสิงคโปร์ เพื่อการเข้าถึงที่เสถียรทั่วโลก ราคาและขีดจำกัดการใช้งานอาจมีการเปลี่ยนแปลงตามที่เราได้เรียนรู้จากการใช้งานในช่วงแรกและข้อเสนอแนะ", + "workspace.lite.promo.subscribe": "สมัครสมาชิก Go", + "workspace.lite.promo.subscribing": "กำลังเปลี่ยนเส้นทาง...", + "download.title": "OpenCode | ดาวน์โหลด", "download.meta.description": "ดาวน์โหลด OpenCode สำหรับ macOS, Windows และ Linux", "download.hero.title": "ดาวน์โหลด OpenCode", diff --git a/packages/console/app/src/i18n/tr.ts b/packages/console/app/src/i18n/tr.ts index e2f747704e7..d94dd15d0df 100644 --- a/packages/console/app/src/i18n/tr.ts +++ b/packages/console/app/src/i18n/tr.ts @@ -247,6 +247,7 @@ export const dict = { "black.hero.title": "Dünyanın en iyi kodlama modellerine erişin", "black.hero.subtitle": "Claude, GPT, Gemini ve daha fazlası dahil", "black.title": "OpenCode Black | Fiyatlandırma", + "black.paused": "Black plan kaydı geçici olarak duraklatıldı.", "black.plan.icon20": "Black 20 planı", "black.plan.icon100": "Black 100 planı", "black.plan.icon200": "Black 200 planı", @@ -342,12 +343,15 @@ 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", "workspace.usage.breakdown.output": "Çıkış", "workspace.usage.breakdown.reasoning": "Muhakeme", - "workspace.usage.subscription": "abonelik (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "Maliyet", "workspace.cost.subtitle": "Modele göre ayrılmış kullanım maliyetleri.", @@ -356,6 +360,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(silindi)", "workspace.cost.empty": "Seçilen döneme ait kullanım verisi yok.", "workspace.cost.subscriptionShort": "abonelik", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API Anahtarları", "workspace.keys.subtitle": "opencode hizmetlerine erişim için API anahtarlarınızı yönetin.", @@ -484,6 +489,36 @@ export const dict = { "workspace.black.waitlist.enrollNote": "Kayıt Ol'a tıkladığınızda aboneliğiniz hemen başlar ve kartınızdan çekim yapılır.", + "workspace.lite.loading": "Yükleniyor...", + "workspace.lite.time.day": "gün", + "workspace.lite.time.days": "gün", + "workspace.lite.time.hour": "saat", + "workspace.lite.time.hours": "saat", + "workspace.lite.time.minute": "dakika", + "workspace.lite.time.minutes": "dakika", + "workspace.lite.time.fewSeconds": "birkaç saniye", + "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.subscription.selectProvider": + 'Go modellerini kullanmak için opencode yapılandırmanızda "OpenCode Go"\'yu sağlayıcı olarak seçin.', + "workspace.lite.other.title": "Go Aboneliği", + "workspace.lite.other.message": + "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": + "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", "download.meta.description": "OpenCode'u macOS, Windows ve Linux için indirin", "download.hero.title": "OpenCode'u İndir", diff --git a/packages/console/app/src/i18n/zh.ts b/packages/console/app/src/i18n/zh.ts index c31b9ea6610..bf21073ce1f 100644 --- a/packages/console/app/src/i18n/zh.ts +++ b/packages/console/app/src/i18n/zh.ts @@ -234,6 +234,7 @@ export const dict = { "black.hero.title": "访问全球顶尖编程模型", "black.hero.subtitle": "包括 Claude, GPT, Gemini 等", "black.title": "OpenCode Black | 定价", + "black.paused": "Black 订阅已暂时暂停注册。", "black.plan.icon20": "Black 20 计划", "black.plan.icon100": "Black 100 计划", "black.plan.icon200": "Black 200 计划", @@ -327,12 +328,15 @@ 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": "缓存写入", "workspace.usage.breakdown.output": "输出", "workspace.usage.breakdown.reasoning": "推理", - "workspace.usage.subscription": "订阅 (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "成本", "workspace.cost.subtitle": "按模型细分的使用成本。", @@ -341,6 +345,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(已删除)", "workspace.cost.empty": "所选期间无可用使用数据。", "workspace.cost.subscriptionShort": "订阅", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API 密钥", "workspace.keys.subtitle": "管理访问 OpenCode 服务的 API 密钥。", @@ -468,6 +473,35 @@ export const dict = { "workspace.black.waitlist.enrolled": "已加入", "workspace.black.waitlist.enrollNote": "点击加入后,您的订阅将立即开始,并将从您的卡中扣费。", + "workspace.lite.loading": "加载中...", + "workspace.lite.time.day": "天", + "workspace.lite.time.days": "天", + "workspace.lite.time.hour": "小时", + "workspace.lite.time.hours": "小时", + "workspace.lite.time.minute": "分钟", + "workspace.lite.time.minutes": "分钟", + "workspace.lite.time.fewSeconds": "几秒钟", + "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.subscription.selectProvider": + "在你的 opencode 配置中选择「OpenCode Go」作为提供商,即可使用 Go 模型。", + "workspace.lite.other.title": "Go 订阅", + "workspace.lite.other.message": "此工作区中的另一位成员已经订阅了 OpenCode Go。每个工作区只有一名成员可以订阅。", + "workspace.lite.promo.title": "OpenCode Go", + "workspace.lite.promo.description": + "OpenCode Go 是一个每月 $10 的订阅计划,提供对主流开源编码模型的稳定访问,并配备充足的使用额度。", + "workspace.lite.promo.modelsTitle": "包含模型", + "workspace.lite.promo.footer": + "该计划主要面向国际用户设计,模型部署在美国、欧盟和新加坡,以确保全球范围内的稳定访问体验。定价和使用额度可能会根据早期用户的使用情况和反馈持续调整与优化。", + "workspace.lite.promo.subscribe": "订阅 Go", + "workspace.lite.promo.subscribing": "正在重定向...", + "download.title": "OpenCode | 下载", "download.meta.description": "下载适用于 macOS, Windows, 和 Linux 的 OpenCode", "download.hero.title": "下载 OpenCode", diff --git a/packages/console/app/src/i18n/zht.ts b/packages/console/app/src/i18n/zht.ts index c7b411ca5b5..8ac69596cb7 100644 --- a/packages/console/app/src/i18n/zht.ts +++ b/packages/console/app/src/i18n/zht.ts @@ -234,6 +234,7 @@ export const dict = { "black.hero.title": "存取全球最佳編碼模型", "black.hero.subtitle": "包括 Claude、GPT、Gemini 等", "black.title": "OpenCode Black | 定價", + "black.paused": "Black 訂閱暫時暫停註冊。", "black.plan.icon20": "Black 20 方案", "black.plan.icon100": "Black 100 方案", "black.plan.icon200": "Black 200 方案", @@ -327,12 +328,15 @@ 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": "快取寫入", "workspace.usage.breakdown.output": "輸出", "workspace.usage.breakdown.reasoning": "推理", - "workspace.usage.subscription": "訂閱 (${{amount}})", + "workspace.usage.subscription": "Black (${{amount}})", + "workspace.usage.lite": "Go (${{amount}})", + "workspace.usage.byok": "BYOK (${{amount}})", "workspace.cost.title": "成本", "workspace.cost.subtitle": "按模型細分的使用成本。", @@ -341,6 +345,7 @@ export const dict = { "workspace.cost.deletedSuffix": "(已刪除)", "workspace.cost.empty": "所選期間沒有可用的使用資料。", "workspace.cost.subscriptionShort": "訂", + "workspace.cost.liteShort": "lite", "workspace.keys.title": "API 金鑰", "workspace.keys.subtitle": "管理你的 API 金鑰以存取 OpenCode 服務。", @@ -468,6 +473,35 @@ export const dict = { "workspace.black.waitlist.enrolled": "已加入", "workspace.black.waitlist.enrollNote": "當你點選「加入」後,你的訂閱將立即開始,並且將從你的卡片中扣款。", + "workspace.lite.loading": "載入中...", + "workspace.lite.time.day": "天", + "workspace.lite.time.days": "天", + "workspace.lite.time.hour": "小時", + "workspace.lite.time.hours": "小時", + "workspace.lite.time.minute": "分鐘", + "workspace.lite.time.minutes": "分鐘", + "workspace.lite.time.fewSeconds": "幾秒", + "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.subscription.selectProvider": + "在您的 opencode 設定中選擇「OpenCode Go」作為提供商,即可使用 Go 模型。", + "workspace.lite.other.title": "Go 訂閱", + "workspace.lite.other.message": "此工作區中的另一位成員已訂閱 OpenCode Go。每個工作區只能有一位成員訂閱。", + "workspace.lite.promo.title": "OpenCode Go", + "workspace.lite.promo.description": + "OpenCode Go 是一個每月 $10 的訂閱方案,提供對主流開放原始碼編碼模型的穩定存取,並配備充足的使用額度。", + "workspace.lite.promo.modelsTitle": "包含模型", + "workspace.lite.promo.footer": + "該計畫主要面向國際用戶設計,模型部署在美國、歐盟和新加坡,以確保全球範圍內的穩定存取體驗。定價和使用額度可能會根據早期用戶的使用情況和回饋持續調整與優化。", + "workspace.lite.promo.subscribe": "訂閱 Go", + "workspace.lite.promo.subscribing": "重新導向中...", + "download.title": "OpenCode | 下載", "download.meta.description": "下載適用於 macOS、Windows 與 Linux 的 OpenCode", "download.hero.title": "下載 OpenCode", diff --git a/packages/console/app/src/routes/black.css b/packages/console/app/src/routes/black.css index 66bffea5995..4031a78fc33 100644 --- a/packages/console/app/src/routes/black.css +++ b/packages/console/app/src/routes/black.css @@ -335,6 +335,19 @@ } } + [data-slot="paused"] { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 0.59); + font-size: 18px; + font-style: normal; + font-weight: 400; + line-height: 160%; + padding: 120px 20px; + } + [data-slot="pricing-card"] { display: flex; flex-direction: column; diff --git a/packages/console/app/src/routes/black/index.tsx b/packages/console/app/src/routes/black/index.tsx index 72b196f5714..8bce3cd464f 100644 --- a/packages/console/app/src/routes/black/index.tsx +++ b/packages/console/app/src/routes/black/index.tsx @@ -1,14 +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 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())) @@ -42,72 +49,76 @@ export default function Black() { <> {i18n.t("black.title")}
- - -
- - {(plan) => ( - + )} + +
+
+ + {(plan) => ( +
+
- +

- ${plan.id}{" "} - {i18n.t("black.price.perMonth")} - + ${plan().id}{" "} + {i18n.t("black.price.perPersonBilledMonthly")} + {(multiplier) => {i18n.t(multiplier())}}

- - )} - -
- - - {(plan) => ( -
-
-
- -
-

- ${plan().id}{" "} - {i18n.t("black.price.perPersonBilledMonthly")} - - {(multiplier) => {i18n.t(multiplier())}} - -

-
    -
  • {i18n.t("black.terms.1")}
  • -
  • {i18n.t("black.terms.2")}
  • -
  • {i18n.t("black.terms.3")}
  • -
  • {i18n.t("black.terms.4")}
  • -
  • {i18n.t("black.terms.5")}
  • -
  • {i18n.t("black.terms.6")}
  • -
  • {i18n.t("black.terms.7")}
  • -
-
- - - {i18n.t("black.action.continue")} - +
    +
  • {i18n.t("black.terms.1")}
  • +
  • {i18n.t("black.terms.2")}
  • +
  • {i18n.t("black.terms.3")}
  • +
  • {i18n.t("black.terms.4")}
  • +
  • {i18n.t("black.terms.5")}
  • +
  • {i18n.t("black.terms.6")}
  • +
  • {i18n.t("black.terms.7")}
  • +
+
+ + + {i18n.t("black.action.continue")} + +
-
- )} -
- -

- {i18n.t("black.finePrint.beforeTerms")} ·{" "} - {i18n.t("black.finePrint.terms")} -

+ )} + + + + +

+ {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 index 644d87d9b32..19b56eabe67 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")}

- +
) } diff --git a/packages/console/app/src/routes/stripe/webhook.ts b/packages/console/app/src/routes/stripe/webhook.ts index 828eb4c711c..47ca442ecbe 100644 --- a/packages/console/app/src/routes/stripe/webhook.ts +++ b/packages/console/app/src/routes/stripe/webhook.ts @@ -1,13 +1,13 @@ import { Billing } from "@opencode-ai/console-core/billing.js" import type { APIEvent } from "@solidjs/start/server" -import { and, Database, eq, isNull, sql } from "@opencode-ai/console-core/drizzle/index.js" -import { BillingTable, PaymentTable, SubscriptionTable } from "@opencode-ai/console-core/schema/billing.sql.js" +import { and, Database, eq, sql } from "@opencode-ai/console-core/drizzle/index.js" +import { BillingTable, LiteTable, PaymentTable } from "@opencode-ai/console-core/schema/billing.sql.js" import { Identifier } from "@opencode-ai/console-core/identifier.js" import { centsToMicroCents } from "@opencode-ai/console-core/util/price.js" import { Actor } from "@opencode-ai/console-core/actor.js" import { Resource } from "@opencode-ai/console-resource" -import { UserTable } from "@opencode-ai/console-core/schema/user.sql.js" -import { AuthTable } from "@opencode-ai/console-core/schema/auth.sql.js" +import { LiteData } from "@opencode-ai/console-core/lite.js" +import { BlackData } from "@opencode-ai/console-core/black.js" export async function POST(input: APIEvent) { const body = await Billing.stripe().webhooks.constructEventAsync( @@ -103,310 +103,93 @@ export async function POST(input: APIEvent) { }) }) } - if (body.type === "checkout.session.completed" && body.data.object.mode === "subscription") { - const workspaceID = body.data.object.custom_fields.find((f) => f.key === "workspaceid")?.text?.value - const amountInCents = body.data.object.amount_total as number - const customerID = body.data.object.customer as string - const customerEmail = body.data.object.customer_details?.email as string - const invoiceID = body.data.object.invoice as string - const subscriptionID = body.data.object.subscription as string - const promoCode = body.data.object.discounts?.[0]?.promotion_code as string - - if (!workspaceID) throw new Error("Workspace ID not found") - if (!customerID) throw new Error("Customer ID not found") - if (!amountInCents) throw new Error("Amount not found") - if (!invoiceID) throw new Error("Invoice ID not found") - if (!subscriptionID) throw new Error("Subscription ID not found") - - // get payment id from invoice - const invoice = await Billing.stripe().invoices.retrieve(invoiceID, { - expand: ["payments"], - }) - const paymentID = invoice.payments?.data[0].payment.payment_intent as string - if (!paymentID) throw new Error("Payment ID not found") - - // get payment method for the payment intent - const paymentIntent = await Billing.stripe().paymentIntents.retrieve(paymentID, { - expand: ["payment_method"], - }) - const paymentMethod = paymentIntent.payment_method - if (!paymentMethod || typeof paymentMethod === "string") throw new Error("Payment method not expanded") - - // get coupon id from promotion code - const couponID = await (async () => { - if (!promoCode) return - const coupon = await Billing.stripe().promotionCodes.retrieve(promoCode) - const couponID = coupon.coupon.id - if (!couponID) throw new Error("Coupon not found for promotion code") - return couponID - })() - - await Actor.provide("system", { workspaceID }, async () => { - // look up current billing - const billing = await Billing.get() - if (!billing) throw new Error(`Workspace with ID ${workspaceID} not found`) + if (body.type === "customer.subscription.created") { + const type = body.data.object.metadata?.type + if (type === "lite") { + const workspaceID = body.data.object.metadata?.workspaceID + const userID = body.data.object.metadata?.userID + const customerID = body.data.object.customer as string + const invoiceID = body.data.object.latest_invoice as string + const subscriptionID = body.data.object.id as string - // Temporarily skip this check because during Black drop, user can checkout - // as a new customer - //if (billing.customerID !== customerID) throw new Error("Customer ID mismatch") + if (!workspaceID) throw new Error("Workspace ID not found") + if (!userID) throw new Error("User ID not found") + if (!customerID) throw new Error("Customer ID not found") + if (!invoiceID) throw new Error("Invoice ID not found") + if (!subscriptionID) throw new Error("Subscription ID not found") - // Temporarily check the user to apply to. After Black drop, we will allow - // look up the user to apply to - const users = await Database.use((tx) => - tx - .select({ id: UserTable.id, email: AuthTable.subject }) - .from(UserTable) - .innerJoin(AuthTable, and(eq(AuthTable.accountID, UserTable.accountID), eq(AuthTable.provider, "email"))) - .where(and(eq(UserTable.workspaceID, workspaceID), isNull(UserTable.timeDeleted))), - ) - const user = users.find((u) => u.email === customerEmail) ?? users[0] - if (!user) { - console.error(`Error: User with email ${customerEmail} not found in workspace ${workspaceID}`) - process.exit(1) - } + // get payment id from invoice + const invoice = await Billing.stripe().invoices.retrieve(invoiceID, { + expand: ["payments"], + }) + const paymentID = invoice.payments?.data[0].payment.payment_intent as string + if (!paymentID) throw new Error("Payment ID not found") - // set customer metadata - if (!billing?.customerID) { - await Billing.stripe().customers.update(customerID, { - metadata: { - workspaceID, - }, - }) - } + // get payment method for the payment intent + const paymentIntent = await Billing.stripe().paymentIntents.retrieve(paymentID, { + expand: ["payment_method"], + }) + const paymentMethod = paymentIntent.payment_method + if (!paymentMethod || typeof paymentMethod === "string") throw new Error("Payment method not expanded") - await Database.transaction(async (tx) => { - await tx - .update(BillingTable) - .set({ - customerID, - subscriptionID, - subscription: { - status: "subscribed", - coupon: couponID, - seats: 1, - plan: "200", + await Actor.provide("system", { workspaceID }, async () => { + // look up current billing + const billing = await Billing.get() + if (!billing) throw new Error(`Workspace with ID ${workspaceID} not found`) + if (billing.customerID && billing.customerID !== customerID) throw new Error("Customer ID mismatch") + + // set customer metadata + if (!billing?.customerID) { + await Billing.stripe().customers.update(customerID, { + metadata: { + workspaceID, }, - paymentMethodID: paymentMethod.id, - paymentMethodLast4: paymentMethod.card?.last4 ?? null, - paymentMethodType: paymentMethod.type, }) - .where(eq(BillingTable.workspaceID, workspaceID)) + } - await tx.insert(SubscriptionTable).values({ - workspaceID, - id: Identifier.create("subscription"), - userID: user.id, - }) + await Database.transaction(async (tx) => { + await tx + .update(BillingTable) + .set({ + customerID, + liteSubscriptionID: subscriptionID, + lite: {}, + paymentMethodID: paymentMethod.id, + paymentMethodLast4: paymentMethod.card?.last4 ?? null, + paymentMethodType: paymentMethod.type, + }) + .where(eq(BillingTable.workspaceID, workspaceID)) - await tx.insert(PaymentTable).values({ - workspaceID, - id: Identifier.create("payment"), - amount: centsToMicroCents(amountInCents), - paymentID, - invoiceID, - customerID, - enrichment: { - type: "subscription", - couponID, - }, + await tx.insert(LiteTable).values({ + workspaceID, + id: Identifier.create("lite"), + userID: userID, + }) }) }) - }) - } - if (body.type === "customer.subscription.created") { - /* -{ - id: "evt_1Smq802SrMQ2Fneksse5FMNV", - object: "event", - api_version: "2025-07-30.basil", - created: 1767766916, - data: { - object: { - id: "sub_1Smq7x2SrMQ2Fnek8F1yf3ZD", - object: "subscription", - application: null, - application_fee_percent: null, - automatic_tax: { - disabled_reason: null, - enabled: false, - liability: null, - }, - billing_cycle_anchor: 1770445200, - billing_cycle_anchor_config: null, - billing_mode: { - flexible: { - proration_discounts: "included", - }, - type: "flexible", - updated_at: 1770445200, - }, - billing_thresholds: null, - cancel_at: null, - cancel_at_period_end: false, - canceled_at: null, - cancellation_details: { - comment: null, - feedback: null, - reason: null, - }, - collection_method: "charge_automatically", - created: 1770445200, - currency: "usd", - customer: "cus_TkKmZZvysJ2wej", - customer_account: null, - days_until_due: null, - default_payment_method: null, - default_source: "card_1Smq7u2SrMQ2FneknjyOa7sq", - default_tax_rates: [], - description: null, - discounts: [], - ended_at: null, - invoice_settings: { - account_tax_ids: null, - issuer: { - type: "self", - }, - }, - items: { - object: "list", - data: [ - { - id: "si_TkKnBKXFX76t0O", - object: "subscription_item", - billing_thresholds: null, - created: 1770445200, - current_period_end: 1772864400, - current_period_start: 1770445200, - discounts: [], - metadata: {}, - plan: { - id: "price_1SmfFG2SrMQ2FnekJuzwHMea", - object: "plan", - active: true, - amount: 20000, - amount_decimal: "20000", - billing_scheme: "per_unit", - created: 1767725082, - currency: "usd", - interval: "month", - interval_count: 1, - livemode: false, - metadata: {}, - meter: null, - nickname: null, - product: "prod_Tk9LjWT1n0DgYm", - tiers_mode: null, - transform_usage: null, - trial_period_days: null, - usage_type: "licensed", - }, - price: { - id: "price_1SmfFG2SrMQ2FnekJuzwHMea", - object: "price", - active: true, - billing_scheme: "per_unit", - created: 1767725082, - currency: "usd", - custom_unit_amount: null, - livemode: false, - lookup_key: null, - metadata: {}, - nickname: null, - product: "prod_Tk9LjWT1n0DgYm", - recurring: { - interval: "month", - interval_count: 1, - meter: null, - trial_period_days: null, - usage_type: "licensed", - }, - tax_behavior: "unspecified", - tiers_mode: null, - transform_quantity: null, - type: "recurring", - unit_amount: 20000, - unit_amount_decimal: "20000", - }, - quantity: 1, - subscription: "sub_1Smq7x2SrMQ2Fnek8F1yf3ZD", - tax_rates: [], - }, - ], - has_more: false, - total_count: 1, - url: "/v1/subscription_items?subscription=sub_1Smq7x2SrMQ2Fnek8F1yf3ZD", - }, - latest_invoice: "in_1Smq7x2SrMQ2FnekSJesfPwE", - livemode: false, - metadata: {}, - next_pending_invoice_item_invoice: null, - on_behalf_of: null, - pause_collection: null, - payment_settings: { - payment_method_options: null, - payment_method_types: null, - save_default_payment_method: "off", - }, - pending_invoice_item_interval: null, - pending_setup_intent: null, - pending_update: null, - plan: { - id: "price_1SmfFG2SrMQ2FnekJuzwHMea", - object: "plan", - active: true, - amount: 20000, - amount_decimal: "20000", - billing_scheme: "per_unit", - created: 1767725082, - currency: "usd", - interval: "month", - interval_count: 1, - livemode: false, - metadata: {}, - meter: null, - nickname: null, - product: "prod_Tk9LjWT1n0DgYm", - tiers_mode: null, - transform_usage: null, - trial_period_days: null, - usage_type: "licensed", - }, - quantity: 1, - schedule: null, - start_date: 1770445200, - status: "active", - test_clock: "clock_1Smq6n2SrMQ2FnekQw4yt2PZ", - transfer_data: null, - trial_end: null, - trial_settings: { - end_behavior: { - missing_payment_method: "create_invoice", - }, - }, - trial_start: null, - }, - }, - livemode: false, - pending_webhooks: 0, - request: { - id: "req_6YO9stvB155WJD", - idempotency_key: "581ba059-6f86-49b2-9c49-0d8450255322", - }, - type: "customer.subscription.created", -} - */ + } } if (body.type === "customer.subscription.updated" && body.data.object.status === "incomplete_expired") { const subscriptionID = body.data.object.id if (!subscriptionID) throw new Error("Subscription ID not found") - await Billing.unsubscribe({ subscriptionID }) + const productID = body.data.object.items.data[0].price.product as string + if (productID === LiteData.productID()) { + await Billing.unsubscribeLite({ subscriptionID }) + } else if (productID === BlackData.productID()) { + await Billing.unsubscribeBlack({ subscriptionID }) + } } if (body.type === "customer.subscription.deleted") { const subscriptionID = body.data.object.id if (!subscriptionID) throw new Error("Subscription ID not found") - await Billing.unsubscribe({ subscriptionID }) + const productID = body.data.object.items.data[0].price.product as string + if (productID === LiteData.productID()) { + await Billing.unsubscribeLite({ subscriptionID }) + } else if (productID === BlackData.productID()) { + await Billing.unsubscribeBlack({ subscriptionID }) + } } if (body.type === "invoice.payment_succeeded") { if ( @@ -430,6 +213,7 @@ export async function POST(input: APIEvent) { typeof subscriptionData.discounts[0] === "string" ? subscriptionData.discounts[0] : subscriptionData.discounts[0]?.coupon?.id + const productID = subscriptionData.items.data[0].price.product as string // get payment id from invoice const invoice = await Billing.stripe().invoices.retrieve(invoiceID, { @@ -459,7 +243,7 @@ export async function POST(input: APIEvent) { invoiceID, customerID, enrichment: { - type: "subscription", + type: productID === LiteData.productID() ? "lite" : "subscription", couponID, }, }), 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 ce0eb2c6a12..b8f089864da 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 { Black } 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: Black.analyzeRollingUsage({ - plan: row.subscription.plan, + rollingUsage: Subscription.analyzeRollingUsage({ + limit: blackData.rollingLimit, + window: blackData.rollingWindow, usage: row.rollingUsage ?? 0, timeUpdated: row.timeRollingUpdated ?? new Date(), }), - weeklyUsage: Black.analyzeWeeklyUsage({ - plan: row.subscription.plan, + weeklyUsage: Subscription.analyzeWeeklyUsage({ + limit: blackData.fixedLimit, usage: row.fixedUsage ?? 0, timeUpdated: row.timeFixedUpdated ?? new Date(), }), @@ -87,7 +90,7 @@ const enroll = action(async (workspaceID: string) => { "use server" return json( await withActor(async () => { - await Billing.subscribe({ seats: 1 }) + await Billing.subscribeBlack({ seats: 1 }) return { error: undefined } }, workspaceID).catch((e) => ({ error: e.message as string })), { revalidate: [queryBillingInfo.key, querySubscription.key] }, 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 a252a02344e..e039a09ef8b 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/index.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/index.tsx @@ -3,7 +3,8 @@ import { BillingSection } from "./billing-section" import { ReloadSection } from "./reload-section" import { PaymentSection } from "./payment-section" import { BlackSection } from "./black-section" -import { Show } from "solid-js" +import { LiteSection } from "./lite-section" +import { createMemo, Show } from "solid-js" import { createAsync, useParams } from "@solidjs/router" import { queryBillingInfo, querySessionInfo } from "../../common" @@ -11,14 +12,18 @@ export default function () { const params = useParams() const sessionInfo = createAsync(() => querySessionInfo(params.id!)) const billingInfo = createAsync(() => queryBillingInfo(params.id!)) + const isBlack = createMemo(() => billingInfo()?.subscriptionID || billingInfo()?.timeSubscriptionBooked) return (
- + + + + 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 new file mode 100644 index 00000000000..76d9bcfb099 --- /dev/null +++ b/packages/console/app/src/routes/workspace/[id]/billing/lite-section.module.css @@ -0,0 +1,190 @@ +.root { + [data-slot="title-row"] { + display: flex; + justify-content: space-between; + align-items: center; + gap: var(--space-4); + } + + [data-slot="usage"] { + display: flex; + gap: var(--space-6); + margin-top: var(--space-4); + + @media (max-width: 40rem) { + flex-direction: column; + gap: var(--space-4); + } + } + + [data-slot="usage-item"] { + flex: 1; + display: flex; + flex-direction: column; + gap: var(--space-2); + } + + [data-slot="usage-header"] { + display: flex; + justify-content: space-between; + align-items: baseline; + } + + [data-slot="usage-label"] { + font-size: var(--font-size-md); + font-weight: 500; + color: var(--color-text); + } + + [data-slot="usage-value"] { + font-size: var(--font-size-sm); + color: var(--color-text-muted); + } + + [data-slot="progress"] { + height: 8px; + background-color: var(--color-bg-surface); + border-radius: var(--border-radius-sm); + overflow: hidden; + } + + [data-slot="progress-bar"] { + height: 100%; + background-color: var(--color-accent); + border-radius: var(--border-radius-sm); + transition: width 0.3s ease; + } + + [data-slot="reset-time"] { + font-size: var(--font-size-sm); + color: var(--color-text-muted); + } + + [data-slot="setting-row"] { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-3); + margin-top: var(--space-4); + + p { + font-size: var(--font-size-sm); + line-height: 1.5; + color: var(--color-text-secondary); + margin: 0; + } + } + + [data-slot="toggle-label"] { + position: relative; + display: inline-block; + width: 2.5rem; + height: 1.5rem; + cursor: pointer; + flex-shrink: 0; + + input { + opacity: 0; + width: 0; + height: 0; + } + + span { + position: absolute; + inset: 0; + background-color: #ccc; + border: 1px solid #bbb; + border-radius: 1.5rem; + transition: all 0.3s ease; + cursor: pointer; + + &::before { + content: ""; + position: absolute; + top: 50%; + left: 0.125rem; + width: 1.25rem; + height: 1.25rem; + background-color: white; + border: 1px solid #ddd; + border-radius: 50%; + transform: translateY(-50%); + transition: all 0.3s ease; + } + } + + input:checked + span { + background-color: #21ad0e; + border-color: #148605; + + &::before { + transform: translateX(1rem) translateY(-50%); + } + } + + &:hover span { + box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2); + } + + input:checked:hover + span { + box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3); + } + + &:has(input:disabled) { + cursor: not-allowed; + } + + input:disabled + span { + opacity: 0.5; + cursor: not-allowed; + } + } + + [data-slot="beta-notice"] { + padding: var(--space-3) var(--space-4); + border: 1px solid var(--color-border); + border-radius: var(--border-radius-sm); + background-color: var(--color-bg-surface); + font-size: var(--font-size-sm); + color: var(--color-text-secondary); + line-height: 1.5; + margin-top: var(--space-3); + + a { + color: var(--color-accent); + text-decoration: none; + } + } + + [data-slot="other-message"] { + font-size: var(--font-size-sm); + color: var(--color-text-muted); + line-height: 1.5; + } + + [data-slot="promo-description"] { + 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 new file mode 100644 index 00000000000..395d008e1d5 --- /dev/null +++ b/packages/console/app/src/routes/workspace/[id]/billing/lite-section.tsx @@ -0,0 +1,285 @@ +import { action, useParams, useAction, useSubmission, json, query, createAsync } from "@solidjs/router" +import { createStore } from "solid-js/store" +import { Show } from "solid-js" +import { Billing } from "@opencode-ai/console-core/billing.js" +import { Database, eq, and, isNull } from "@opencode-ai/console-core/drizzle/index.js" +import { BillingTable, LiteTable } 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/subscription.js" +import { LiteData } from "@opencode-ai/console-core/lite.js" +import { withActor } from "~/context/auth.withActor" +import { queryBillingInfo } from "../../common" +import styles from "./lite-section.module.css" +import { useI18n } from "~/context/i18n" +import { useLanguage } from "~/context/language" + +const queryLiteSubscription = query(async (workspaceID: string) => { + "use server" + return withActor(async () => { + const row = await Database.use((tx) => + tx + .select({ + userID: LiteTable.userID, + rollingUsage: LiteTable.rollingUsage, + weeklyUsage: LiteTable.weeklyUsage, + monthlyUsage: LiteTable.monthlyUsage, + timeRollingUpdated: LiteTable.timeRollingUpdated, + timeWeeklyUpdated: LiteTable.timeWeeklyUpdated, + timeMonthlyUpdated: LiteTable.timeMonthlyUpdated, + timeCreated: LiteTable.timeCreated, + lite: BillingTable.lite, + }) + .from(BillingTable) + .innerJoin(LiteTable, eq(LiteTable.workspaceID, BillingTable.workspaceID)) + .where(and(eq(LiteTable.workspaceID, Actor.workspace()), isNull(LiteTable.timeDeleted))) + .then((r) => r[0]), + ) + if (!row) return null + + const limits = LiteData.getLimits() + const mine = row.userID === Actor.userID() + + return { + mine, + useBalance: row.lite?.useBalance ?? false, + rollingUsage: Subscription.analyzeRollingUsage({ + limit: limits.rollingLimit, + window: limits.rollingWindow, + usage: row.rollingUsage ?? 0, + timeUpdated: row.timeRollingUpdated ?? new Date(), + }), + weeklyUsage: Subscription.analyzeWeeklyUsage({ + limit: limits.weeklyLimit, + usage: row.weeklyUsage ?? 0, + timeUpdated: row.timeWeeklyUpdated ?? new Date(), + }), + monthlyUsage: Subscription.analyzeMonthlyUsage({ + limit: limits.monthlyLimit, + usage: row.monthlyUsage ?? 0, + timeUpdated: row.timeMonthlyUpdated ?? new Date(), + timeSubscribed: row.timeCreated, + }), + } + }, workspaceID) +}, "lite.subscription.get") + +function formatResetTime(seconds: number, i18n: ReturnType) { + const days = Math.floor(seconds / 86400) + if (days >= 1) { + const hours = Math.floor((seconds % 86400) / 3600) + return `${days} ${days === 1 ? i18n.t("workspace.lite.time.day") : i18n.t("workspace.lite.time.days")} ${hours} ${hours === 1 ? i18n.t("workspace.lite.time.hour") : i18n.t("workspace.lite.time.hours")}` + } + const hours = Math.floor(seconds / 3600) + const minutes = Math.floor((seconds % 3600) / 60) + if (hours >= 1) + return `${hours} ${hours === 1 ? i18n.t("workspace.lite.time.hour") : i18n.t("workspace.lite.time.hours")} ${minutes} ${minutes === 1 ? i18n.t("workspace.lite.time.minute") : i18n.t("workspace.lite.time.minutes")}` + if (minutes === 0) return i18n.t("workspace.lite.time.fewSeconds") + return `${minutes} ${minutes === 1 ? i18n.t("workspace.lite.time.minute") : i18n.t("workspace.lite.time.minutes")}` +} + +const createLiteCheckoutUrl = action(async (workspaceID: string, successUrl: string, cancelUrl: string) => { + "use server" + return json( + await withActor( + () => + Billing.generateLiteCheckoutUrl({ successUrl, cancelUrl }) + .then((data) => ({ error: undefined, data })) + .catch((e) => ({ + error: e.message as string, + data: undefined, + })), + workspaceID, + ), + { revalidate: [queryBillingInfo.key, queryLiteSubscription.key] }, + ) +}, "liteCheckoutUrl") + +const createSessionUrl = action(async (workspaceID: string, returnUrl: string) => { + "use server" + return json( + await withActor( + () => + Billing.generateSessionUrl({ returnUrl }) + .then((data) => ({ error: undefined, data })) + .catch((e) => ({ + error: e.message as string, + data: undefined, + })), + workspaceID, + ), + { revalidate: [queryBillingInfo.key, queryLiteSubscription.key] }, + ) +}, "liteSessionUrl") + +const setLiteUseBalance = action(async (form: FormData) => { + "use server" + const workspaceID = form.get("workspaceID")?.toString() + if (!workspaceID) return { error: "Workspace ID is required" } + const useBalance = form.get("useBalance")?.toString() === "true" + + return json( + await withActor(async () => { + await Database.use((tx) => + tx + .update(BillingTable) + .set({ + lite: useBalance ? { useBalance: true } : {}, + }) + .where(eq(BillingTable.workspaceID, workspaceID)), + ) + return { error: undefined } + }, workspaceID).catch((e) => ({ error: e.message as string })), + { revalidate: [queryBillingInfo.key, queryLiteSubscription.key] }, + ) +}, "setLiteUseBalance") + +export function LiteSection() { + const params = useParams() + const i18n = useI18n() + const language = useLanguage() + const lite = createAsync(() => queryLiteSubscription(params.id!)) + const sessionAction = useAction(createSessionUrl) + const sessionSubmission = useSubmission(createSessionUrl) + const checkoutAction = useAction(createLiteCheckoutUrl) + const checkoutSubmission = useSubmission(createLiteCheckoutUrl) + const useBalanceSubmission = useSubmission(setLiteUseBalance) + const [store, setStore] = createStore({ + redirecting: false, + }) + + async function onClickSession() { + const result = await sessionAction(params.id!, window.location.href) + if (result.data) { + setStore("redirecting", true) + window.location.href = result.data + } + } + + async function onClickSubscribe() { + const result = await checkoutAction(params.id!, window.location.href, window.location.href) + if (result.data) { + setStore("redirecting", true) + window.location.href = result.data + } + } + + return ( + <> + + {(sub) => ( +
+
+

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

+
+

{i18n.t("workspace.lite.subscription.message")}

+ +
+
+
+ {i18n.t("workspace.lite.subscription.selectProvider")}{" "} + + {i18n.t("common.learnMore")} + + . +
+
+
+
+ {i18n.t("workspace.lite.subscription.rollingUsage")} + {sub().rollingUsage.usagePercent}% +
+
+
+
+ + {i18n.t("workspace.lite.subscription.resetsIn")}{" "} + {formatResetTime(sub().rollingUsage.resetInSec, i18n)} + +
+
+
+ {i18n.t("workspace.lite.subscription.weeklyUsage")} + {sub().weeklyUsage.usagePercent}% +
+
+
+
+ + {i18n.t("workspace.lite.subscription.resetsIn")} {formatResetTime(sub().weeklyUsage.resetInSec, i18n)} + +
+
+
+ {i18n.t("workspace.lite.subscription.monthlyUsage")} + {sub().monthlyUsage.usagePercent}% +
+
+
+
+ + {i18n.t("workspace.lite.subscription.resetsIn")}{" "} + {formatResetTime(sub().monthlyUsage.resetInSec, i18n)} + +
+
+
+

{i18n.t("workspace.lite.subscription.useBalance")}

+ + + +
+
+ )} +
+ +
+
+

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

+
+

{i18n.t("workspace.lite.other.message")}

+
+
+ +
+
+

{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")}

+ +
+
+ + ) +} diff --git a/packages/console/app/src/routes/workspace/[id]/graph-section.tsx b/packages/console/app/src/routes/workspace/[id]/graph-section.tsx index f26c7291d8a..56a31cdd060 100644 --- a/packages/console/app/src/routes/workspace/[id]/graph-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/graph-section.tsx @@ -36,7 +36,7 @@ async function getCosts(workspaceID: string, year: number, month: number) { model: UsageTable.model, totalCost: sum(UsageTable.cost), keyId: UsageTable.keyID, - subscription: sql`COALESCE(JSON_EXTRACT(${UsageTable.enrichment}, '$.plan') = 'sub', false)`, + plan: sql`JSON_EXTRACT(${UsageTable.enrichment}, '$.plan')`, }) .from(UsageTable) .where( @@ -50,13 +50,13 @@ async function getCosts(workspaceID: string, year: number, month: number) { sql`DATE(${UsageTable.timeCreated})`, UsageTable.model, UsageTable.keyID, - sql`COALESCE(JSON_EXTRACT(${UsageTable.enrichment}, '$.plan') = 'sub', false)`, + sql`JSON_EXTRACT(${UsageTable.enrichment}, '$.plan')`, ) .then((x) => x.map((r) => ({ ...r, totalCost: r.totalCost ? parseInt(r.totalCost) : 0, - subscription: Boolean(r.subscription), + plan: r.plan as "sub" | "lite" | "byok" | null, })), ), ) @@ -218,18 +218,21 @@ export function GraphSection() { const colorTextSecondary = styles.getPropertyValue("--color-text-secondary").trim() const colorBorder = styles.getPropertyValue("--color-border").trim() const subSuffix = ` (${i18n.t("workspace.cost.subscriptionShort")})` + const liteSuffix = ` (${i18n.t("workspace.cost.liteShort")})` + const dailyDataRegular = new Map>() const dailyDataSub = new Map>() - const dailyDataNonSub = new Map>() + const dailyDataLite = new Map>() for (const dateKey of dates) { + dailyDataRegular.set(dateKey, new Map()) dailyDataSub.set(dateKey, new Map()) - dailyDataNonSub.set(dateKey, new Map()) + dailyDataLite.set(dateKey, new Map()) } data.usage .filter((row) => (store.key ? row.keyId === store.key : true)) .forEach((row) => { - const targetMap = row.subscription ? dailyDataSub : dailyDataNonSub + const targetMap = row.plan === "sub" ? dailyDataSub : row.plan === "lite" ? dailyDataLite : dailyDataRegular const dayMap = targetMap.get(row.date) if (!dayMap) return dayMap.set(row.model, (dayMap.get(row.model) ?? 0) + row.totalCost) @@ -237,15 +240,15 @@ export function GraphSection() { const filteredModels = store.model === null ? getModels() : [store.model] - // Create datasets: non-subscription first, then subscription (with hatched pattern effect via opacity) + // Create datasets: regular first, then subscription, then lite (with visual distinction via opacity) const datasets = [ ...filteredModels - .filter((model) => dates.some((date) => (dailyDataNonSub.get(date)?.get(model) || 0) > 0)) + .filter((model) => dates.some((date) => (dailyDataRegular.get(date)?.get(model) || 0) > 0)) .map((model) => { const color = getModelColor(model) return { label: model, - data: dates.map((date) => (dailyDataNonSub.get(date)?.get(model) || 0) / 100_000_000), + data: dates.map((date) => (dailyDataRegular.get(date)?.get(model) || 0) / 100_000_000), backgroundColor: color, hoverBackgroundColor: color, borderWidth: 0, @@ -266,6 +269,21 @@ export function GraphSection() { stack: "subscription", } }), + ...filteredModels + .filter((model) => dates.some((date) => (dailyDataLite.get(date)?.get(model) || 0) > 0)) + .map((model) => { + const color = getModelColor(model) + return { + label: `${model}${liteSuffix}`, + data: dates.map((date) => (dailyDataLite.get(date)?.get(model) || 0) / 100_000_000), + backgroundColor: addOpacityToColor(color, 0.35), + hoverBackgroundColor: addOpacityToColor(color, 0.55), + borderWidth: 1, + borderColor: addOpacityToColor(color, 0.7), + borderDash: [4, 2], + stack: "lite", + } + }), ] return { @@ -347,9 +365,18 @@ export function GraphSection() { const meta = chart.getDatasetMeta(i) const label = dataset.label || "" const isSub = label.endsWith(subSuffix) - const model = isSub ? label.slice(0, -subSuffix.length) : label + const isLite = label.endsWith(liteSuffix) + const model = isSub + ? label.slice(0, -subSuffix.length) + : isLite + ? label.slice(0, -liteSuffix.length) + : label const baseColor = getModelColor(model) - const originalColor = isSub ? addOpacityToColor(baseColor, 0.5) : baseColor + const originalColor = isSub + ? addOpacityToColor(baseColor, 0.5) + : isLite + ? addOpacityToColor(baseColor, 0.35) + : baseColor const color = i === legendItem.datasetIndex ? originalColor : addOpacityToColor(baseColor, 0.15) meta.data.forEach((bar: any) => { bar.options.backgroundColor = color @@ -363,9 +390,18 @@ export function GraphSection() { const meta = chart.getDatasetMeta(i) const label = dataset.label || "" const isSub = label.endsWith(subSuffix) - const model = isSub ? label.slice(0, -subSuffix.length) : label + const isLite = label.endsWith(liteSuffix) + const model = isSub + ? label.slice(0, -subSuffix.length) + : isLite + ? label.slice(0, -liteSuffix.length) + : label const baseColor = getModelColor(model) - const color = isSub ? addOpacityToColor(baseColor, 0.5) : baseColor + const color = isSub + ? addOpacityToColor(baseColor, 0.5) + : isLite + ? addOpacityToColor(baseColor, 0.35) + : baseColor meta.data.forEach((bar: any) => { bar.options.backgroundColor = color }) 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 079a27c3ca7..a20a5bf0d1b 100644 --- a/packages/console/app/src/routes/workspace/[id]/usage-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/usage-section.tsx @@ -1,6 +1,6 @@ import { Billing } from "@opencode-ai/console-core/billing.js" import { createAsync, query, useParams } from "@solidjs/router" -import { createMemo, For, Show, createEffect, createSignal } from "solid-js" +import { createMemo, For, Show, Switch, Match, createEffect, createSignal } from "solid-js" import { formatDateUTC, formatDateForTable } from "../common" import { withActor } from "~/context/auth.withActor" import { IconChevronLeft, IconChevronRight, IconBreakdown } from "~/component/icon" @@ -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")} @@ -174,15 +175,25 @@ export function UsageSection() {
- ${((usage.cost ?? 0) / 100000000).toFixed(4)}} - > - {i18n.t("workspace.usage.subscription", { - amount: ((usage.cost ?? 0) / 100000000).toFixed(4), - })} - + ${((usage.cost ?? 0) / 100000000).toFixed(4)}}> + + {i18n.t("workspace.usage.subscription", { + amount: ((usage.cost ?? 0) / 100000000).toFixed(4), + })} + + + {i18n.t("workspace.usage.lite", { + amount: ((usage.cost ?? 0) / 100000000).toFixed(4), + })} + + + {i18n.t("workspace.usage.byok", { + amount: ((usage.cost ?? 0) / 100000000).toFixed(4), + })} + + + {usage.sessionID?.slice(-8) ?? "-"} ) }} diff --git a/packages/console/app/src/routes/workspace/common.tsx b/packages/console/app/src/routes/workspace/common.tsx index 5cbd6718351..d41793dd92b 100644 --- a/packages/console/app/src/routes/workspace/common.tsx +++ b/packages/console/app/src/routes/workspace/common.tsx @@ -115,6 +115,8 @@ export const queryBillingInfo = query(async (workspaceID: string) => { subscriptionPlan: billing.subscriptionPlan, timeSubscriptionBooked: billing.timeSubscriptionBooked, timeSubscriptionSelected: billing.timeSubscriptionSelected, + lite: billing.lite, + liteSubscriptionID: billing.liteSubscriptionID, } }, workspaceID) }, "billing.get") diff --git a/packages/console/app/src/routes/zen/lite/v1/chat/completions.ts b/packages/console/app/src/routes/zen/go/v1/chat/completions.ts similarity index 100% rename from packages/console/app/src/routes/zen/lite/v1/chat/completions.ts rename to packages/console/app/src/routes/zen/go/v1/chat/completions.ts diff --git a/packages/console/app/src/routes/zen/go/v1/messages.ts b/packages/console/app/src/routes/zen/go/v1/messages.ts new file mode 100644 index 00000000000..ee401e6aa2c --- /dev/null +++ b/packages/console/app/src/routes/zen/go/v1/messages.ts @@ -0,0 +1,12 @@ +import type { APIEvent } from "@solidjs/start/server" +import { handler } from "~/routes/zen/util/handler" + +export function POST(input: APIEvent) { + return handler(input, { + format: "anthropic", + modelList: "lite", + parseApiKey: (headers: Headers) => headers.get("x-api-key") ?? undefined, + parseModel: (url: string, body: any) => body.model, + parseIsStream: (url: string, body: any) => !!body.stream, + }) +} diff --git a/packages/console/app/src/routes/zen/util/handler.ts b/packages/console/app/src/routes/zen/util/handler.ts index 5f2b51c21e9..1719625839c 100644 --- a/packages/console/app/src/routes/zen/util/handler.ts +++ b/packages/console/app/src/routes/zen/util/handler.ts @@ -1,15 +1,16 @@ import type { APIEvent } from "@solidjs/start/server" import { and, Database, eq, isNull, lt, or, sql } from "@opencode-ai/console-core/drizzle/index.js" import { KeyTable } from "@opencode-ai/console-core/schema/key.sql.js" -import { BillingTable, SubscriptionTable, UsageTable } from "@opencode-ai/console-core/schema/billing.sql.js" +import { BillingTable, LiteTable, SubscriptionTable, UsageTable } from "@opencode-ai/console-core/schema/billing.sql.js" import { centsToMicroCents } from "@opencode-ai/console-core/util/price.js" -import { getWeekBounds } from "@opencode-ai/console-core/util/date.js" +import { getMonthlyBounds, getWeekBounds } from "@opencode-ai/console-core/util/date.js" import { Identifier } from "@opencode-ai/console-core/identifier.js" 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" @@ -32,13 +33,15 @@ import { createRateLimiter } from "./rateLimiter" 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 = { excludeProviders: string[] retryCount: number } -type BillingSource = "anonymous" | "free" | "byok" | "subscription" | "balance" +type BillingSource = "anonymous" | "free" | "byok" | "subscription" | "lite" | "balance" export async function handler( input: APIEvent, @@ -57,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 ] @@ -196,7 +199,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 +249,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) } @@ -453,6 +456,7 @@ export async function handler( reloadTrigger: BillingTable.reloadTrigger, timeReloadLockedTill: BillingTable.timeReloadLockedTill, subscription: BillingTable.subscription, + lite: BillingTable.lite, }, user: { id: UserTable.id, @@ -460,13 +464,23 @@ export async function handler( monthlyUsage: UserTable.monthlyUsage, timeMonthlyUsageUpdated: UserTable.timeMonthlyUsageUpdated, }, - subscription: { + black: { id: SubscriptionTable.id, rollingUsage: SubscriptionTable.rollingUsage, fixedUsage: SubscriptionTable.fixedUsage, timeRollingUpdated: SubscriptionTable.timeRollingUpdated, timeFixedUpdated: SubscriptionTable.timeFixedUpdated, }, + lite: { + id: LiteTable.id, + timeCreated: LiteTable.timeCreated, + rollingUsage: LiteTable.rollingUsage, + weeklyUsage: LiteTable.weeklyUsage, + monthlyUsage: LiteTable.monthlyUsage, + timeRollingUpdated: LiteTable.timeRollingUpdated, + timeWeeklyUpdated: LiteTable.timeWeeklyUpdated, + timeMonthlyUpdated: LiteTable.timeMonthlyUpdated, + }, provider: { credentials: ProviderTable.credentials, }, @@ -494,16 +508,42 @@ export async function handler( isNull(SubscriptionTable.timeDeleted), ), ) + .leftJoin( + LiteTable, + and( + eq(LiteTable.workspaceID, KeyTable.workspaceID), + eq(LiteTable.userID, KeyTable.userID), + isNull(LiteTable.timeDeleted), + ), + ) .where(and(eq(KeyTable.key, apiKey), isNull(KeyTable.timeDeleted))) .then((rows) => rows[0]), ) 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, - isSubscription: data.subscription ? true : false, - subscription: data.billing.subscription?.plan, + ...(() => { + if (data.billing.subscription) + return { + isSubscription: true, + subscription: data.billing.subscription.plan, + } + if (data.billing.lite) + return { + isSubscription: true, + subscription: "lite", + } + return {} + })(), }) return { @@ -511,9 +551,10 @@ export async function handler( workspaceID: data.workspaceID, billing: data.billing, user: data.user, - subscription: data.subscription, + black: data.black, + lite: data.lite, provider: data.provider, - isFree: FREE_WORKSPACES.includes(data.workspaceID), + isFree: ADMIN_WORKSPACES.includes(data.workspaceID), isDisabled: !!data.timeDisabled, } } @@ -524,25 +565,26 @@ export async function handler( if (authInfo.isFree) return "free" if (modelInfo.allowAnonymous) return "free" - // Validate subscription billing - if (authInfo.billing.subscription && authInfo.subscription) { + const formatRetryTime = (seconds: number) => { + const days = Math.floor(seconds / 86400) + if (days >= 1) return `${days} day${days > 1 ? "s" : ""}` + const hours = Math.floor(seconds / 3600) + const minutes = Math.ceil((seconds % 3600) / 60) + if (hours >= 1) return `${hours}hr ${minutes}min` + return `${minutes}min` + } + + // Validate black subscription billing + if (authInfo.billing.subscription && authInfo.black) { try { - const sub = authInfo.subscription + const sub = authInfo.black const plan = authInfo.billing.subscription.plan - const formatRetryTime = (seconds: number) => { - const days = Math.floor(seconds / 86400) - if (days >= 1) return `${days} day${days > 1 ? "s" : ""}` - const hours = Math.floor(seconds / 3600) - const minutes = Math.ceil((seconds % 3600) / 60) - if (hours >= 1) return `${hours}hr ${minutes}min` - return `${minutes}min` - } - // 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 +597,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, }) @@ -573,6 +617,62 @@ export async function handler( } } + // Validate lite subscription billing + if (opts.modelList === "lite" && authInfo.billing.lite && authInfo.lite) { + try { + const sub = authInfo.lite + const liteData = LiteData.getLimits() + + // Check weekly limit + if (sub.weeklyUsage && sub.timeWeeklyUpdated) { + const result = Subscription.analyzeWeeklyUsage({ + limit: liteData.weeklyLimit, + usage: sub.weeklyUsage, + timeUpdated: sub.timeWeeklyUpdated, + }) + if (result.status === "rate-limited") + throw new SubscriptionUsageLimitError( + `Subscription quota exceeded. Retry in ${formatRetryTime(result.resetInSec)}.`, + result.resetInSec, + ) + } + + // Check monthly limit + if (sub.monthlyUsage && sub.timeMonthlyUpdated) { + const result = Subscription.analyzeMonthlyUsage({ + limit: liteData.monthlyLimit, + usage: sub.monthlyUsage, + timeUpdated: sub.timeMonthlyUpdated, + timeSubscribed: sub.timeCreated, + }) + if (result.status === "rate-limited") + throw new SubscriptionUsageLimitError( + `Subscription quota exceeded. Retry in ${formatRetryTime(result.resetInSec)}.`, + result.resetInSec, + ) + } + + // Check rolling limit + if (sub.monthlyUsage && sub.timeMonthlyUpdated) { + const result = Subscription.analyzeRollingUsage({ + limit: liteData.rollingLimit, + window: liteData.rollingWindow, + usage: sub.monthlyUsage, + timeUpdated: sub.timeMonthlyUpdated, + }) + if (result.status === "rate-limited") + throw new SubscriptionUsageLimitError( + `Subscription quota exceeded. Retry in ${formatRetryTime(result.resetInSec)}.`, + result.resetInSec, + ) + } + + return "lite" + } catch (e) { + if (!authInfo.billing.lite.useBalance) throw e + } + } + // Validate pay as you go billing const billing = authInfo.billing if (!billing.paymentMethodID) @@ -687,6 +787,7 @@ export async function handler( } async function trackUsage( + sessionId: string, billingSource: BillingSource, authInfo: AuthInfo, modelInfo: ModelInfo, @@ -734,79 +835,127 @@ export async function handler( cacheWrite1hTokens, cost, keyID: authInfo.apiKeyId, - enrichment: billingSource === "subscription" ? { plan: "sub" } : undefined, + sessionID: sessionId.substring(0, 30), + enrichment: (() => { + if (billingSource === "subscription") return { plan: "sub" } + if (billingSource === "byok") return { plan: "byok" } + if (billingSource === "lite") return { plan: "lite" } + return undefined + })(), }), db .update(KeyTable) .set({ timeUsed: sql`now()` }) .where(and(eq(KeyTable.workspaceID, authInfo.workspaceID), eq(KeyTable.id, authInfo.apiKeyId))), - ...(billingSource === "subscription" - ? (() => { - const plan = authInfo.billing.subscription!.plan - const black = BlackData.getLimits({ plan }) - const week = getWeekBounds(new Date()) - const rollingWindowSeconds = black.rollingWindow * 3600 - return [ - db - .update(SubscriptionTable) - .set({ - fixedUsage: sql` + ...(() => { + if (billingSource === "subscription") { + const plan = authInfo.billing.subscription!.plan + const black = BlackData.getLimits({ plan }) + const week = getWeekBounds(new Date()) + const rollingWindowSeconds = black.rollingWindow * 3600 + return [ + db + .update(SubscriptionTable) + .set({ + fixedUsage: sql` CASE WHEN ${SubscriptionTable.timeFixedUpdated} >= ${week.start} THEN ${SubscriptionTable.fixedUsage} + ${cost} ELSE ${cost} END `, - timeFixedUpdated: sql`now()`, - rollingUsage: sql` + timeFixedUpdated: sql`now()`, + rollingUsage: sql` CASE WHEN UNIX_TIMESTAMP(${SubscriptionTable.timeRollingUpdated}) >= UNIX_TIMESTAMP(now()) - ${rollingWindowSeconds} THEN ${SubscriptionTable.rollingUsage} + ${cost} ELSE ${cost} END `, - timeRollingUpdated: sql` + timeRollingUpdated: sql` CASE WHEN UNIX_TIMESTAMP(${SubscriptionTable.timeRollingUpdated}) >= UNIX_TIMESTAMP(now()) - ${rollingWindowSeconds} THEN ${SubscriptionTable.timeRollingUpdated} ELSE now() END `, - }) - .where( - and( - eq(SubscriptionTable.workspaceID, authInfo.workspaceID), - eq(SubscriptionTable.userID, authInfo.user.id), - ), + }) + .where( + and( + eq(SubscriptionTable.workspaceID, authInfo.workspaceID), + eq(SubscriptionTable.userID, authInfo.user.id), ), - ] - })() - : [ + ), + ] + } + if (billingSource === "lite") { + const lite = LiteData.getLimits() + const week = getWeekBounds(new Date()) + const month = getMonthlyBounds(new Date(), authInfo.lite!.timeCreated) + const rollingWindowSeconds = lite.rollingWindow * 3600 + return [ db - .update(BillingTable) + .update(LiteTable) .set({ - balance: authInfo.isFree + monthlyUsage: sql` + CASE + WHEN ${LiteTable.timeMonthlyUpdated} >= ${month.start} THEN ${LiteTable.monthlyUsage} + ${cost} + ELSE ${cost} + END + `, + timeMonthlyUpdated: sql`now()`, + weeklyUsage: sql` + CASE + WHEN ${LiteTable.timeWeeklyUpdated} >= ${week.start} THEN ${LiteTable.weeklyUsage} + ${cost} + ELSE ${cost} + END + `, + timeWeeklyUpdated: sql`now()`, + rollingUsage: sql` + CASE + WHEN UNIX_TIMESTAMP(${LiteTable.timeRollingUpdated}) >= UNIX_TIMESTAMP(now()) - ${rollingWindowSeconds} THEN ${LiteTable.rollingUsage} + ${cost} + ELSE ${cost} + END + `, + timeRollingUpdated: sql` + CASE + WHEN UNIX_TIMESTAMP(${LiteTable.timeRollingUpdated}) >= UNIX_TIMESTAMP(now()) - ${rollingWindowSeconds} THEN ${LiteTable.timeRollingUpdated} + ELSE now() + END + `, + }) + .where(and(eq(LiteTable.workspaceID, authInfo.workspaceID), eq(LiteTable.userID, authInfo.user.id))), + ] + } + + return [ + db + .update(BillingTable) + .set({ + balance: + billingSource === "free" || billingSource === "byok" ? sql`${BillingTable.balance} - ${0}` : sql`${BillingTable.balance} - ${cost}`, - monthlyUsage: sql` + monthlyUsage: sql` CASE WHEN MONTH(${BillingTable.timeMonthlyUsageUpdated}) = MONTH(now()) AND YEAR(${BillingTable.timeMonthlyUsageUpdated}) = YEAR(now()) THEN ${BillingTable.monthlyUsage} + ${cost} ELSE ${cost} END `, - timeMonthlyUsageUpdated: sql`now()`, - }) - .where(eq(BillingTable.workspaceID, authInfo.workspaceID)), - db - .update(UserTable) - .set({ - monthlyUsage: sql` + timeMonthlyUsageUpdated: sql`now()`, + }) + .where(eq(BillingTable.workspaceID, authInfo.workspaceID)), + db + .update(UserTable) + .set({ + monthlyUsage: sql` CASE WHEN MONTH(${UserTable.timeMonthlyUsageUpdated}) = MONTH(now()) AND YEAR(${UserTable.timeMonthlyUsageUpdated}) = YEAR(now()) THEN ${UserTable.monthlyUsage} + ${cost} ELSE ${cost} END `, - timeMonthlyUsageUpdated: sql`now()`, - }) - .where(and(eq(UserTable.workspaceID, authInfo.workspaceID), eq(UserTable.id, authInfo.user.id))), - ]), + timeMonthlyUsageUpdated: sql`now()`, + }) + .where(and(eq(UserTable.workspaceID, authInfo.workspaceID), eq(UserTable.id, authInfo.user.id))), + ] + })(), ]), ) diff --git a/packages/console/app/src/routes/zen/v1/models.ts b/packages/console/app/src/routes/zen/v1/models.ts index f9c14ededdc..d2592d20b07 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", 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 00000000000..6b26128c665 --- /dev/null +++ b/packages/console/core/migrations/20250902065410_fluffy_raza/snapshot.json @@ -0,0 +1,967 @@ +{ + "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": [] +} 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 00000000000..8e0af76b5bf --- /dev/null +++ b/packages/console/core/migrations/20250903035359_serious_whistler/snapshot.json @@ -0,0 +1,967 @@ +{ + "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": [] +} 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 00000000000..27f5a5dbbdc --- /dev/null +++ b/packages/console/core/migrations/20250911133331_violet_loners/snapshot.json @@ -0,0 +1,981 @@ +{ + "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": [] +} 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 00000000000..da412fed41a --- /dev/null +++ b/packages/console/core/migrations/20250911141957_dusty_clint_barton/snapshot.json @@ -0,0 +1,1001 @@ +{ + "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": [] +} 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 00000000000..e0c84bb2d3e --- /dev/null +++ b/packages/console/core/migrations/20250911214917_first_mockingbird/snapshot.json @@ -0,0 +1,1015 @@ +{ + "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": [] +} 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 00000000000..57ef218deba --- /dev/null +++ b/packages/console/core/migrations/20250911231144_jazzy_skrulls/snapshot.json @@ -0,0 +1,1015 @@ +{ + "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": [] +} 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 00000000000..75472504c3a --- /dev/null +++ b/packages/console/core/migrations/20250912021148_parallel_gauntlet/snapshot.json @@ -0,0 +1,1043 @@ +{ + "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": [] +} 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 00000000000..5aa25052ab6 --- /dev/null +++ b/packages/console/core/migrations/20250912161749_familiar_nightshade/snapshot.json @@ -0,0 +1,1029 @@ +{ + "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": [] +} 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 00000000000..f7606b78629 --- /dev/null +++ b/packages/console/core/migrations/20250914213824_eminent_ultimatum/snapshot.json @@ -0,0 +1,1043 @@ +{ + "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": [] +} 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 00000000000..9f4163f61c3 --- /dev/null +++ b/packages/console/core/migrations/20250914222302_redundant_piledriver/snapshot.json @@ -0,0 +1,1057 @@ +{ + "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": [] +} 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 00000000000..835c27e5974 --- /dev/null +++ b/packages/console/core/migrations/20250914232505_needy_sue_storm/snapshot.json @@ -0,0 +1,1073 @@ +{ + "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": [] +} 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 00000000000..e2f48178a84 --- /dev/null +++ b/packages/console/core/migrations/20250915150801_freezing_phil_sheldon/snapshot.json @@ -0,0 +1,1087 @@ +{ + "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": [] +} 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 00000000000..eae20d54c0f --- /dev/null +++ b/packages/console/core/migrations/20250915172014_bright_photon/snapshot.json @@ -0,0 +1,1129 @@ +{ + "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": [] +} 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 00000000000..6c0a9b3836e --- /dev/null +++ b/packages/console/core/migrations/20250915172258_absurd_hobgoblin/snapshot.json @@ -0,0 +1,1129 @@ +{ + "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": [] +} 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 00000000000..c94526e91ab --- /dev/null +++ b/packages/console/core/migrations/20250919135159_demonic_princess_powerful/snapshot.json @@ -0,0 +1,1143 @@ +{ + "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": [] +} 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 00000000000..9de034489b9 --- /dev/null +++ b/packages/console/core/migrations/20250921042124_cloudy_revanche/snapshot.json @@ -0,0 +1,1129 @@ +{ + "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": [] +} 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 00000000000..8f513193ed6 --- /dev/null +++ b/packages/console/core/migrations/20250923213126_cold_la_nuit/snapshot.json @@ -0,0 +1,1143 @@ +{ + "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": [] +} 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 00000000000..4a6758c6be8 --- /dev/null +++ b/packages/console/core/migrations/20250924230623_woozy_thaddeus_ross/snapshot.json @@ -0,0 +1,1157 @@ +{ + "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": [] +} 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 00000000000..a23bd3c8ef1 --- /dev/null +++ b/packages/console/core/migrations/20250928163425_nervous_iron_lad/snapshot.json @@ -0,0 +1,1185 @@ +{ + "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": [] +} 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 00000000000..4f52f4b0b5f --- /dev/null +++ b/packages/console/core/migrations/20250928235456_dazzling_cable/snapshot.json @@ -0,0 +1,1185 @@ +{ + "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": [] +} 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 00000000000..6808c0fd5be --- /dev/null +++ b/packages/console/core/migrations/20250929181457_supreme_jack_power/snapshot.json @@ -0,0 +1,1171 @@ +{ + "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": [] +} 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 00000000000..5c2ab1a4b15 --- /dev/null +++ b/packages/console/core/migrations/20250929224703_flawless_clea/snapshot.json @@ -0,0 +1,1185 @@ +{ + "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": [] +} 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 00000000000..12dd96929f1 --- /dev/null +++ b/packages/console/core/migrations/20251002175032_nice_dreadnoughts/snapshot.json @@ -0,0 +1,1233 @@ +{ + "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": [] +} 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 00000000000..21f2b0ed2c7 --- /dev/null +++ b/packages/console/core/migrations/20251002223020_optimal_paibok/snapshot.json @@ -0,0 +1,1265 @@ +{ + "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": [] +} 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 00000000000..638be654c63 --- /dev/null +++ b/packages/console/core/migrations/20251003202205_early_black_crow/snapshot.json @@ -0,0 +1,1237 @@ +{ + "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": [] +} 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 00000000000..63663564462 --- /dev/null +++ b/packages/console/core/migrations/20251003210411_legal_joseph/snapshot.json @@ -0,0 +1,1251 @@ +{ + "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": [] +} 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 00000000000..1588e6b8e3c --- /dev/null +++ b/packages/console/core/migrations/20251004030300_numerous_prodigy/snapshot.json @@ -0,0 +1,1231 @@ +{ + "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": [] +} 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 00000000000..15467efc387 --- /dev/null +++ b/packages/console/core/migrations/20251004045106_hot_wong/snapshot.json @@ -0,0 +1,1203 @@ +{ + "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": [] +} 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 00000000000..7dd21cfe147 --- /dev/null +++ b/packages/console/core/migrations/20251007024345_careful_cerise/snapshot.json @@ -0,0 +1,1203 @@ +{ + "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": [] +} 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 00000000000..610ce901141 --- /dev/null +++ b/packages/console/core/migrations/20251007043715_panoramic_harrier/snapshot.json @@ -0,0 +1,1245 @@ +{ + "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": [] +} 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 00000000000..77205c73d27 --- /dev/null +++ b/packages/console/core/migrations/20251007230438_ordinary_ultragirl/snapshot.json @@ -0,0 +1,1359 @@ +{ + "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": [] +} 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 00000000000..d91bd7d1aa3 --- /dev/null +++ b/packages/console/core/migrations/20251008161718_outgoing_outlaw_kid/snapshot.json @@ -0,0 +1,1487 @@ +{ + "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": [] +} 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 00000000000..6fe9fd5dc00 --- /dev/null +++ b/packages/console/core/migrations/20251009021849_white_doctor_doom/snapshot.json @@ -0,0 +1,1501 @@ +{ + "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": [] +} 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 00000000000..3ea26248b34 --- /dev/null +++ b/packages/console/core/migrations/20251016175624_cynical_jack_flag/snapshot.json @@ -0,0 +1,1515 @@ +{ + "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": [] +} 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 00000000000..c22274da057 --- /dev/null +++ b/packages/console/core/migrations/20251016214520_short_bulldozer/snapshot.json @@ -0,0 +1,1637 @@ +{ + "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": [] +} 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 00000000000..02661314529 --- /dev/null +++ b/packages/console/core/migrations/20251017015733_narrow_blindfold/snapshot.json @@ -0,0 +1,1623 @@ +{ + "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": [] +} 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 00000000000..106aa33c6dc --- /dev/null +++ b/packages/console/core/migrations/20251017024232_slimy_energizer/snapshot.json @@ -0,0 +1,1635 @@ +{ + "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": [] +} 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 00000000000..27f03383a64 --- /dev/null +++ b/packages/console/core/migrations/20251031163113_messy_jackal/snapshot.json @@ -0,0 +1,1663 @@ +{ + "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": [] +} 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 00000000000..5250b414615 --- /dev/null +++ b/packages/console/core/migrations/20251125223403_famous_magik/snapshot.json @@ -0,0 +1,1743 @@ +{ + "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": [] +} 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 00000000000..0a540a4b9f8 --- /dev/null +++ b/packages/console/core/migrations/20251228182259_striped_forge/snapshot.json @@ -0,0 +1,1867 @@ +{ + "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": [] +} 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 00000000000..04e088505bf --- /dev/null +++ b/packages/console/core/migrations/20260105034337_broken_gamora/snapshot.json @@ -0,0 +1,1887 @@ +{ + "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": [] +} 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 00000000000..17a9730364b --- /dev/null +++ b/packages/console/core/migrations/20260106204919_odd_misty_knight/snapshot.json @@ -0,0 +1,1939 @@ +{ + "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": [] +} 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 00000000000..179c712ba73 --- /dev/null +++ b/packages/console/core/migrations/20260107000117_flat_nightmare/snapshot.json @@ -0,0 +1,2037 @@ +{ + "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": [] +} 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 00000000000..27b00b6e009 --- /dev/null +++ b/packages/console/core/migrations/20260107022356_lame_calypso/snapshot.json @@ -0,0 +1,2037 @@ +{ + "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": [] +} 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 00000000000..088f95612d0 --- /dev/null +++ b/packages/console/core/migrations/20260107041522_tiny_captain_midlands/snapshot.json @@ -0,0 +1,2037 @@ +{ + "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": [] +} 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 00000000000..03fe57605ab --- /dev/null +++ b/packages/console/core/migrations/20260107055817_cuddly_diamondback/snapshot.json @@ -0,0 +1,2053 @@ +{ + "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": [] +} 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 00000000000..90142e70edb --- /dev/null +++ b/packages/console/core/migrations/20260108224422_charming_black_bolt/snapshot.json @@ -0,0 +1,2203 @@ +{ + "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": [] +} 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 00000000000..dad3cdbfa63 --- /dev/null +++ b/packages/console/core/migrations/20260109000245_huge_omega_red/snapshot.json @@ -0,0 +1,2153 @@ +{ + "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": [] +} 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 00000000000..9a43cd2bdf6 --- /dev/null +++ b/packages/console/core/migrations/20260109001625_mean_frank_castle/snapshot.json @@ -0,0 +1,2153 @@ +{ + "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": [] +} 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 00000000000..0e6084f51e9 --- /dev/null +++ b/packages/console/core/migrations/20260109014234_noisy_domino/snapshot.json @@ -0,0 +1,2167 @@ +{ + "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": [] +} 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 00000000000..ebff34d85d8 --- /dev/null +++ b/packages/console/core/migrations/20260109040130_bumpy_mephistopheles/snapshot.json @@ -0,0 +1,2181 @@ +{ + "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": [] +} 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 00000000000..f03e37f2f5f --- /dev/null +++ b/packages/console/core/migrations/20260113215232_jazzy_green_goblin/snapshot.json @@ -0,0 +1,2195 @@ +{ + "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": [] +} 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 00000000000..000b6f55620 --- /dev/null +++ b/packages/console/core/migrations/20260113223840_aromatic_agent_zero/snapshot.json @@ -0,0 +1,2209 @@ +{ + "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": [] +} 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 00000000000..d62a4ca5820 --- /dev/null +++ b/packages/console/core/migrations/20260116213606_gigantic_hardball/snapshot.json @@ -0,0 +1,2223 @@ +{ + "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": [] +} 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 00000000000..85f6c848a9b --- /dev/null +++ b/packages/console/core/migrations/20260116224745_numerous_annihilus/snapshot.json @@ -0,0 +1,2209 @@ +{ + "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": [] +} 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 00000000000..cb606b01ae1 --- /dev/null +++ b/packages/console/core/migrations/20260122190905_moaning_karnak/snapshot.json @@ -0,0 +1,2223 @@ +{ + "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": [] +} 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 00000000000..03cfe4c033c --- /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 00000000000..a91dacd60e6 --- /dev/null +++ b/packages/console/core/migrations/20260222233442_clever_toxin/snapshot.json @@ -0,0 +1,2237 @@ +{ + "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": [] +} diff --git a/packages/console/core/migrations/20260224043338_nifty_starjammers/migration.sql b/packages/console/core/migrations/20260224043338_nifty_starjammers/migration.sql new file mode 100644 index 00000000000..1c97afbd987 --- /dev/null +++ b/packages/console/core/migrations/20260224043338_nifty_starjammers/migration.sql @@ -0,0 +1,19 @@ +CREATE TABLE `lite` ( + `id` varchar(30) NOT NULL, + `workspace_id` varchar(30) NOT NULL, + `time_created` timestamp(3) NOT NULL DEFAULT (now()), + `time_updated` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), + `time_deleted` timestamp(3), + `user_id` varchar(30) NOT NULL, + `rolling_usage` bigint, + `weekly_usage` bigint, + `monthly_usage` bigint, + `time_rolling_updated` timestamp(3), + `time_weekly_updated` timestamp(3), + `time_monthly_updated` timestamp(3), + CONSTRAINT `PRIMARY` PRIMARY KEY(`workspace_id`,`id`), + CONSTRAINT `workspace_user_id` UNIQUE INDEX(`workspace_id`,`user_id`) +); +--> 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 00000000000..bc20ee2b964 --- /dev/null +++ b/packages/console/core/migrations/20260224043338_nifty_starjammers/snapshot.json @@ -0,0 +1,2463 @@ +{ + "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": [] +} 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 17d3bd7f9d3..00000000000 --- 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 d23d1601d93..00000000000 --- 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 45d06926c1a..00000000000 --- 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 e832ebb00ce..00000000000 --- 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 6d2695c488e..00000000000 --- 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 12246a6d62d..00000000000 --- 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 d726b6f6783..00000000000 --- 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 122db42cb90..00000000000 --- 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 02c47320022..00000000000 --- 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 a3bd57cae75..00000000000 --- 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 cb55610ae67..00000000000 --- 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 7eb6fa71ad2..00000000000 --- 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 4220c988b2c..00000000000 --- 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 ef805ee8363..00000000000 --- 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 b526aeead42..00000000000 --- 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 57d893cd80b..00000000000 --- 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 eefeb31a758..00000000000 --- 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 d7687f9c6cf..00000000000 --- 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 3e3c64c7341..00000000000 --- 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 9a0d4d24396..00000000000 --- 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 9defceb5a3b..00000000000 --- 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 64d3e9d2493..00000000000 --- 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 8a1c4e7d8e9..00000000000 --- 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 4f6f66283af..00000000000 --- 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 1ef25970a33..00000000000 --- 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 6746a6e8c61..00000000000 --- 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 d3c7dc496f1..00000000000 --- 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 408766f7179..00000000000 --- 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 827cb53c5ec..00000000000 --- 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 d235697cc2a..00000000000 --- 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 66978dfa5fc..00000000000 --- 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 c4716592503..00000000000 --- 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 51e84a1d3a4..00000000000 --- 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 76d4720e89b..00000000000 --- 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 e9c999be714..00000000000 --- 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 815d120ea01..00000000000 --- 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 926b143ebe1..00000000000 --- 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 8a80ea52215..00000000000 --- 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 b0a59c49781..00000000000 --- 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 ba34f1ac490..00000000000 --- 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 77012fd0ff1..00000000000 --- 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 583b55925b3..00000000000 --- 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 e0f731e3975..00000000000 --- 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 ef9caa74e6b..00000000000 --- 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 cde7fabf228..00000000000 --- 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 6ab9760c680..00000000000 --- 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 46ff73e263a..00000000000 --- 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 f8002bd8bb6..00000000000 --- 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 e0593749b38..00000000000 --- 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 58679382e52..00000000000 --- 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 75289bc262d..00000000000 --- 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 0f904791623..00000000000 --- 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 339e153eba8..00000000000 --- 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 75a2cb7c929..00000000000 --- 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 a1e3851d857..00000000000 --- 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 82293d86663..00000000000 --- 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 f807eab6687..00000000000 --- 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 a99f1ec3232..078d662072d 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.14", "private": true, "type": "module", "license": "MIT", @@ -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/black-select-workspaces.ts b/packages/console/core/script/black-select-workspaces.ts index f22478e1b3d..63bfab88750 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 6367fd89a4a..0dfda24116d 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/script/promote-lite.ts b/packages/console/core/script/promote-lite.ts new file mode 100755 index 00000000000..8fd58c8059b --- /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 00000000000..2f3e6683572 --- /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/billing.ts b/packages/console/core/src/billing.ts index 2c1cdb0687b..fcf238a3538 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 5f8db62738d..a18c5258d04 100644 --- a/packages/console/core/src/black.ts +++ b/packages/console/core/src/black.ts @@ -1,9 +1,7 @@ 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" +import { BlackPlans } from "./schema/billing.sql" export namespace BlackData { const Schema = z.object({ @@ -30,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) @@ -38,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 @@ -60,75 +60,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/identifier.ts b/packages/console/core/src/identifier.ts index b10bf32f6f1..8aa324ba07f 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 new file mode 100644 index 00000000000..49d23e59ec0 --- /dev/null +++ b/packages/console/core/src/lite.ts @@ -0,0 +1,25 @@ +import { z } from "zod" +import { fn } from "./util/fn" +import { Resource } from "@opencode-ai/console-resource" + +export namespace LiteData { + const Schema = z.object({ + rollingLimit: z.number().int(), + rollingWindow: z.number().int(), + weeklyLimit: z.number().int(), + monthlyLimit: 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 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 ba8f8928068..a5c70c21154 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", { @@ -67,7 +87,7 @@ export const PaymentTable = mysqlTable( timeRefunded: utc("time_refunded"), enrichment: json("enrichment").$type< | { - type: "subscription" + type: "subscription" | "lite" couponID?: string } | { @@ -93,8 +113,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 00000000000..879f940e0eb --- /dev/null +++ b/packages/console/core/src/subscription.ts @@ -0,0 +1,109 @@ +import { z } from "zod" +import { fn } from "./util/fn" +import { centsToMicroCents } from "./util/price" +import { getWeekBounds, getMonthlyBounds } 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.floor(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.floor(Math.min(100, (usage / fixedLimitInMicroCents) * 100)), + } + } + + return { + status: "rate-limited" as const, + resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), + usagePercent: 100, + } + }, + ) + + 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 074df8a2fad..00000000000 --- 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 9c1ab12d2c9..dea9c390e06 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/sst-env.d.ts b/packages/console/core/sst-env.d.ts index 73f83d16762..edff904e015 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/core/test/date.test.ts b/packages/console/core/test/date.test.ts new file mode 100644 index 00000000000..e5a0a90e551 --- /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 00000000000..57e63f94c41 --- /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) + }) +}) diff --git a/packages/console/function/package.json b/packages/console/function/package.json index 386ee19df23..ac1c6bfd89a 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.14", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/console/function/sst-env.d.ts b/packages/console/function/sst-env.d.ts index 73f83d16762..edff904e015 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/mail/package.json b/packages/console/mail/package.json index 7a08244bb62..1b91c7cbe01 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.14", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", diff --git a/packages/console/resource/sst-env.d.ts b/packages/console/resource/sst-env.d.ts index 73f83d16762..edff904e015 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/desktop/README.md b/packages/desktop/README.md index ebaf4882231..358b7d24d51 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. diff --git a/packages/desktop/package.json b/packages/desktop/package.json index dc25cb02037..2bd9cce9a35 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.14", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/desktop/scripts/utils.ts b/packages/desktop/scripts/utils.ts index 2629eb466c0..f6ea7009c86 100644 --- a/packages/desktop/scripts/utils.ts +++ b/packages/desktop/scripts/utils.ts @@ -8,7 +8,7 @@ export const SIDECAR_BINARIES: Array<{ rustTarget: string; ocBinary: string; ass }, { rustTarget: "x86_64-apple-darwin", - ocBinary: "opencode-darwin-x64-baseline", + ocBinary: "opencode-darwin-x64", assetExt: "zip", }, { diff --git a/packages/desktop/src-tauri/Cargo.lock b/packages/desktop/src-tauri/Cargo.lock index f9516350e13..55f0d5f3603 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 e98b8965c16..b228c7b6162 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 acab0fa7034..af1a45cf3a3 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(()) } } @@ -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); diff --git a/packages/desktop/src-tauri/src/lib.rs b/packages/desktop/src-tauri/src/lib.rs index 7ea3aaa8a76..71fe8407f02 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 00000000000..8c36e53f779 --- /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 00000000000..cab265b626b --- /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 +} diff --git a/packages/enterprise/package.json b/packages/enterprise/package.json index fae66ab31a8..0cd3ec69083 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.14", "private": true, "type": "module", "license": "MIT", diff --git a/packages/enterprise/sst-env.d.ts b/packages/enterprise/sst-env.d.ts index 73f83d16762..edff904e015 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/extensions/zed/extension.toml b/packages/extensions/zed/extension.toml index a112d793fd7..436b2e9e191 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.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.10/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.10/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.10/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.10/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.10/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 c67be670961..7a68ef5b9d2 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.14", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", diff --git a/packages/function/sst-env.d.ts b/packages/function/sst-env.d.ts index 73f83d16762..edff904e015 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/packages/opencode/BUN_SHELL_MIGRATION_PLAN.md b/packages/opencode/BUN_SHELL_MIGRATION_PLAN.md new file mode 100644 index 00000000000..6cb21ac8f61 --- /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/package.json b/packages/opencode/package.json index f8912737375..e23d2e41ad3 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.14", "name": "opencode", "type": "module", "license": "MIT", @@ -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", diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index 34e80d71a08..19353b67fe4 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -56,7 +56,7 @@ const migrations = await Promise.all( ) console.log(`Loaded ${migrations.length} migrations`) -const singleFlag = process.argv.includes("--single") +const singleFlag = process.argv.includes("--single") || (!!process.env.CI && !process.argv.includes("--all")) const baselineFlag = process.argv.includes("--baseline") const skipInstall = process.argv.includes("--skip-install") @@ -103,11 +103,6 @@ const allTargets: { os: "darwin", arch: "x64", }, - { - os: "darwin", - arch: "x64", - avx2: false, - }, { os: "win32", arch: "x64", diff --git a/packages/opencode/script/schema.ts b/packages/opencode/script/schema.ts index 585701c9518..61d11ea7c93 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/acp/agent.ts b/packages/opencode/src/acp/agent.ts index 765c741c0d6..8b338f1b571 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,50 @@ 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") { + await this.toolStart(sessionId, part) + 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 +323,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 +332,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 +413,8 @@ export namespace ACP { return } case "error": + this.toolStarts.delete(part.callID) + this.bashSnapshots.delete(part.callID) await this.connection .sessionUpdate({ sessionId, @@ -426,6 +436,7 @@ export namespace ACP { ], rawOutput: { error: part.state.error, + metadata: part.state.metadata, }, }, }) @@ -800,26 +811,23 @@ export namespace ACP { for (const part of message.parts) { if (part.type === "tool") { + await this.toolStart(sessionId, part) 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((err) => { - log.error("failed to send tool pending to ACP", { error: err }) - }) + this.bashSnapshots.delete(part.callID) 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 +839,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 +847,8 @@ export namespace ACP { }) break case "completed": + this.toolStarts.delete(part.callID) + this.bashSnapshots.delete(part.callID) const kind = toToolKind(part.tool) const content: ToolCallContent[] = [ { @@ -916,6 +927,8 @@ export namespace ACP { }) break case "error": + this.toolStarts.delete(part.callID) + this.bashSnapshots.delete(part.callID) await this.connection .sessionUpdate({ sessionId, @@ -937,6 +950,7 @@ export namespace ACP { ], rawOutput: { error: part.state.error, + metadata: part.state.metadata, }, }, }) @@ -1063,6 +1077,35 @@ 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 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/src/bun/index.ts b/packages/opencode/src/bun/index.ts index 79aaae2bcc4..e3bddcc2263 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 } @@ -93,7 +86,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/bun/registry.ts b/packages/opencode/src/bun/registry.ts index c567668acd7..a85a6c989c8 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 e050a0abf80..95635916413 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,17 +265,20 @@ 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 + if (!proc.stdout) { + prompts.log.error("Failed") + prompts.outro("Done") + return + } + 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 new Response(proc.stdout).text() 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 4aa702359d1..7fb5fda97b9 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/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index ab3d0968925..97c910a47d4 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 a2559cfce67..e892f9922d1 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 38dc402758b..be031296e90 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/dialog-provider.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx index 9682bee4ead..d88dfdd86f1 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 diff --git a/packages/opencode/src/cli/cmd/tui/component/tips.tsx b/packages/opencode/src/cli/cmd/tui/component/tips.tsx index d0a7e5b44ec..73d82248adb 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 0dbbbc6f9ee..566d66ade50 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 465ed805ea1..2320c08ccc6 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 00000000000..62dbf1ebd1b --- /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 f5a7f6f6ca4..34704537684 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -76,8 +76,10 @@ 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" addDefaultParsers(parsers.parsers) @@ -101,6 +103,7 @@ const context = createContext<{ showGenericToolOutput: () => boolean diffWrapMode: () => "word" | "none" sync: ReturnType + tui: ReturnType }>() function use() { @@ -113,6 +116,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 +170,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() } @@ -809,6 +813,7 @@ export function Session() { thinking: showThinking(), toolDetails: showDetails(), assistantMetadata: showAssistantMetadata(), + includeMetadata: true, }, ) await Clipboard.copy(transcript) @@ -819,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", @@ -853,6 +902,7 @@ export function Session() { thinking: options.thinking, toolDetails: options.toolDetails, assistantMetadata: options.assistantMetadata, + includeMetadata: true, }, ) @@ -988,6 +1038,7 @@ export function Session() { showGenericToolOutput, diffWrapMode, sync, + tui: tuiConfig, }} > @@ -1762,11 +1813,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 +1826,7 @@ function Write(props: ToolProps) { content={code()} /> - - - {(diagnostic) => ( - - Error [{diagnostic.range.start.line}:{diagnostic.range.start.character}]: {diagnostic.message} - - )} - - + @@ -1962,7 +2000,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" @@ -1972,12 +2010,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 +2035,7 @@ function Edit(props: ToolProps) { removedLineNumberBg={theme.diffRemovedLineNumberBg} /> - - - - {(diagnostic) => ( - - Error [{diagnostic.range.start.line + 1}:{diagnostic.range.start.character + 1}]{" "} - {diagnostic.message} - - )} - - - + @@ -2033,7 +2054,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" }) @@ -2086,6 +2107,7 @@ function ApplyPatch(props: ToolProps) { } > + )} @@ -2163,6 +2185,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)) { 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 389fc2418cc..a50cd96fc84 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 50f63c3dfbd..750347d9d63 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/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 00000000000..f3fe6fa8766 --- /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/clipboard.ts b/packages/opencode/src/cli/cmd/tui/util/clipboard.ts index 7d1aad3a86e..1a8197bf4e8 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 cb7c691bbde..6d32c63c001 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/cli/cmd/tui/util/transcript.ts b/packages/opencode/src/cli/cmd/tui/util/transcript.ts index 420c9dde1bf..af0560e4c34 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/src/cli/cmd/workspace-serve.ts b/packages/opencode/src/cli/cmd/workspace-serve.ts new file mode 100644 index 00000000000..9b47defd392 --- /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/config/config.ts b/packages/opencode/src/config/config.ts index aad0fd76c4b..28aea4d6777 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -1,9 +1,9 @@ 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" import { ModelsDev } from "../provider/models" import { mergeDeep, pipe, unique } from "remeda" import { Global } from "../global" @@ -33,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" }) @@ -41,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" @@ -52,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])) @@ -90,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`), @@ -106,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)) } } @@ -128,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 }) } @@ -162,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 ??= {} @@ -185,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, @@ -199,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))) } } @@ -240,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 } @@ -276,7 +256,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) @@ -289,7 +268,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) => { @@ -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) @@ -342,10 +321,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) } } @@ -929,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"), @@ -1017,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) @@ -1240,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" @@ -1332,7 +1246,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 @@ -1343,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", @@ -1360,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/markdown.ts b/packages/opencode/src/config/markdown.ts index 5b4ccf04771..3c9709b5b3b 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/src/config/migrate-tui-config.ts b/packages/opencode/src/config/migrate-tui-config.ts new file mode 100644 index 00000000000..b426e4fbd10 --- /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 00000000000..396417e9a5b --- /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 00000000000..f9068e3f01d --- /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 00000000000..f0964f63b35 --- /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/file/ignore.ts b/packages/opencode/src/file/ignore.ts index 94ffaf5ce04..b9731040c7d 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 } diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts index ca1eadae8e0..9c4e9cf0284 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/file/time.ts b/packages/opencode/src/file/time.ts index c85781eb411..efb1c437647 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.`, ) diff --git a/packages/opencode/src/file/watcher.ts b/packages/opencode/src/file/watcher.ts index c4a4747777e..626a746c832 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/flag/flag.ts b/packages/opencode/src/flag/flag.ts index 0049d716d09..e02f191c709 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/src/format/formatter.ts b/packages/opencode/src/format/formatter.ts index 47b2d6a12d2..19b9e2cbe97 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 bab758030b9..b849f778ece 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/index.ts b/packages/opencode/src/index.ts index 65515658862..9af79278c06 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") || diff --git a/packages/opencode/src/lsp/server.ts b/packages/opencode/src/lsp/server.ts index a4ebeb5a256..afd297a5ed6 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/patch/index.ts b/packages/opencode/src/patch/index.ts index 0efeff544f6..b87ad555286 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/project/project.ts b/packages/opencode/src/project/project.ts index e49d9686136..a75a0a02e78 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(), @@ -125,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) } } @@ -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/server/routes/session.ts b/packages/opencode/src/server/routes/session.ts index 1195529e06a..12938aeaba0 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 8454a9c3e97..22de477f8d1 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/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.ts index 83cc467e423..cf254b4cef7 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() @@ -105,7 +108,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("\\", "/")), } } @@ -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/src/storage/db.ts b/packages/opencode/src/storage/db.ts index 6d7bfd72810..f29aac18d16 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/src/tool/apply_patch.ts b/packages/opencode/src/tool/apply_patch.ts index 1344467c719..06293b6eba6 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 ee2279bbfbe..0751f789b7d 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) @@ -145,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/src/tool/external-directory.ts b/packages/opencode/src/tool/external-directory.ts index 1d3958fc464..5d8885b2ad4 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/tool/grep.ts b/packages/opencode/src/tool/grep.ts index 00497d4e3fd..82e7ac1667e 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/tool/plan.ts b/packages/opencode/src/tool/plan.ts index 6cb7a691c88..ff84dccec44 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 ef0e78ffa86..c6d7fbc1e4b 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,9 +26,10 @@ 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" export namespace ToolRegistry { const log = Log.create({ service: "tool.registry" }) @@ -43,7 +45,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)) } @@ -117,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, ] } diff --git a/packages/opencode/src/util/filesystem.ts b/packages/opencode/src/util/filesystem.ts index 3a1e8b8ec15..a87aaeb9866 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/src/util/git.ts b/packages/opencode/src/util/git.ts index 201def36a8c..731131357f2 100644 --- a/packages/opencode/src/util/git.ts +++ b/packages/opencode/src/util/git.ts @@ -1,64 +1,35 @@ -import { $ } from "bun" -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 `Bun.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 = Bun.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 - const [exitCode, stdout, stderr] = await Promise.all([ - proc.exited, - new Response(proc.stdout).arrayBuffer(), - new Response(proc.stderr).arrayBuffer(), - ]) - const stdoutBuf = Buffer.from(stdout) - const stderrBuf = Buffer.from(stderr) - return { - exitCode, - text: () => stdoutBuf.toString(), - stdout: stdoutBuf, - stderr: stderrBuf, - } - } 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 new file mode 100644 index 00000000000..71f001a86a1 --- /dev/null +++ b/packages/opencode/src/util/process.ts @@ -0,0 +1,126 @@ +import { spawn as launch, type ChildProcess } from "child_process" +import { buffer } from "node:stream/consumers" + +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 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[], opts: Options = {}): Child { + if (cmd.length === 0) throw new Error("Command is required") + opts.abort?.throwIfAborted() + + const proc = launch(cmd[0], cmd.slice(1), { + 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 closed = false + let timer: ReturnType | undefined + + const abort = () => { + if (closed) return + if (proc.exitCode !== null || proc.signalCode !== null) return + closed = true + + proc.kill(opts.kill ?? "SIGTERM") + + const ms = opts.timeout ?? 5_000 + if (ms <= 0) return + timer = setTimeout(() => proc.kill("SIGKILL"), ms) + } + + const exited = new Promise((resolve, reject) => { + const done = () => { + opts.abort?.removeEventListener("abort", abort) + if (timer) clearTimeout(timer) + } + + proc.once("exit", (code, signal) => { + done() + resolve(code ?? (signal ? 1 : 0)) + }) + + proc.once("error", (error) => { + done() + reject(error) + }) + }) + + 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/src/util/wildcard.ts b/packages/opencode/src/util/wildcard.ts index 4a6eba96ff9..f54b6c85fd7 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/acp/event-subscription.test.ts b/packages/opencode/test/acp/event-subscription.test.ts index 1145a1357d2..1abf578281d 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,192 @@ 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("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({ + 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() + }, + }) + }) }) 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 00000000000..501ec2c2ef1 --- /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 00000000000..1b6545b1519 --- /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 7a5fa6b8f1c..57a24a1b837 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) diff --git a/packages/opencode/test/config/config.test.ts b/packages/opencode/test/config/config.test.ts index 56773570af5..f245dc3493d 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`") }, }) }) @@ -689,7 +711,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) @@ -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/markdown.test.ts b/packages/opencode/test/config/markdown.test.ts index c6133317e2c..865af210773 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: diff --git a/packages/opencode/test/config/tui.test.ts b/packages/opencode/test/config/tui.test.ts new file mode 100644 index 00000000000..f9de5b041b4 --- /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/opencode/test/ide/ide.test.ts b/packages/opencode/test/ide/ide.test.ts index 4d70140197f..e10700e80ff 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) => { diff --git a/packages/opencode/test/preload.ts b/packages/opencode/test/preload.ts index dee7045707e..41028633e83 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 }) +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") diff --git a/packages/opencode/test/skill/discovery.test.ts b/packages/opencode/test/skill/discovery.test.ts index d1963f697b9..5664fa32b8a 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") diff --git a/packages/opencode/test/skill/skill.test.ts b/packages/opencode/test/skill/skill.test.ts index c310256c5e7..2264723a090 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/snapshot/snapshot.test.ts b/packages/opencode/test/snapshot/snapshot.test.ts index 9a0622c4a5a..1804ab5c2a2 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!) @@ -542,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 @@ -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]) diff --git a/packages/opencode/test/tool/apply_patch.test.ts b/packages/opencode/test/tool/apply_patch.test.ts index a08e235885a..f81723fee09 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) diff --git a/packages/opencode/test/tool/bash.test.ts b/packages/opencode/test/tool/bash.test.ts index 3bd923b6041..ac93016927a 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(), "*")) }, }) }) @@ -203,8 +204,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, ) @@ -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 33c5e2c7397..a75f767b3b6 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/read.test.ts b/packages/opencode/test/tool/read.test.ts index 88228f14e87..b22fc3e7120 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/tool/write.test.ts b/packages/opencode/test/tool/write.test.ts index 4f1a7d28e8c..695d48ccbbc 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, ), diff --git a/packages/opencode/test/util/filesystem.test.ts b/packages/opencode/test/util/filesystem.test.ts index 0f544793734..a6255db88f5 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() diff --git a/packages/opencode/test/util/glob.test.ts b/packages/opencode/test/util/glob.test.ts index ae1bcdcf82e..e58d92c85c6 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 () => { diff --git a/packages/opencode/test/util/process.test.ts b/packages/opencode/test/util/process.test.ts new file mode 100644 index 00000000000..ce599d6d8f0 --- /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) +}) diff --git a/packages/opencode/test/util/wildcard.test.ts b/packages/opencode/test/util/wildcard.test.ts index 9cd0e9b9450..56e753d12a3 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) + } +}) diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 623a117929f..c4ed60455ab 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.14", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/plugin/script/publish.ts b/packages/plugin/script/publish.ts index 647b56e5e2d..d2fe49f23ce 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 4fe0794d0ce..3faee471736 100644 --- a/packages/sdk/js/package.json +++ b/packages/sdk/js/package.json @@ -1,12 +1,12 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/sdk", - "version": "1.2.10", + "version": "1.2.14", "type": "module", "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 7568c54b0f2..268233a012e 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 c21f06230d1..ea5c5d634b2 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/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index b4848e60540..6165c0f7b09 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 4050ef15738..be6c00cf445 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 @@ -3564,6 +3155,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: { diff --git a/packages/sdk/openapi.json b/packages/sdk/openapi.json index 2741c2362ec..0f9c6f0203c 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}": { @@ -8651,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", @@ -9707,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" }, diff --git a/packages/slack/package.json b/packages/slack/package.json index d000cb47994..c61ff7521b3 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.14", "type": "module", "license": "MIT", "scripts": { diff --git a/packages/ui/package.json b/packages/ui/package.json index 3519996085d..08f46d633bc 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.14", "type": "module", "license": "MIT", "exports": { diff --git a/packages/ui/src/components/markdown.tsx b/packages/ui/src/components/markdown.tsx index be43eca81ad..bb41c74efbd 100644 --- a/packages/ui/src/components/markdown.tsx +++ b/packages/ui/src/components/markdown.tsx @@ -103,53 +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) 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) => { @@ -171,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) { @@ -255,26 +274,15 @@ export function Markdown( const temp = document.createElement("div") temp.innerHTML = content + 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 - if (fromEl.getAttribute("data-component") === "markdown-code") { - const fromPre = fromEl.querySelector("pre") - const toPre = toEl.querySelector("pre") - if (fromPre && toPre && !fromPre.isEqualNode(toPre)) { - morphdom(fromPre, toPre) - } - return false - } - 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 }, }) diff --git a/packages/ui/src/components/message-part.css b/packages/ui/src/components/message-part.css index 07a718141a9..bea33ff54cf 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; @@ -332,14 +338,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 +397,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 +485,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 +504,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; @@ -669,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"] { @@ -882,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; @@ -1212,11 +1104,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 +1197,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 828ddbe87d8..8fbad45bd8a 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" @@ -276,12 +273,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 +381,7 @@ export function AssistantParts(props: { message={entry().message} showAssistantCopyPartID={props.showAssistantCopyPartID} turnDurationMs={props.turnDurationMs} + defaultOpen={partDefaultOpen(entry().part, props.shellToolDefaultOpen, props.editToolDefaultOpen)} /> )} @@ -900,8 +910,43 @@ 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() const part = props.part as ToolPart if (part.tool === "todowrite" || part.tool === "todoread") return null @@ -910,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) => { @@ -1018,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) => }
) @@ -1479,57 +1449,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 +1520,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 +1716,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")} + + + + + + + } + > +
+
-
- } - > -
- -
- + + +
)} ) @@ -1871,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/components/session-review.css b/packages/ui/src/components/session-review.css index b9a2180cb8d..ec048d009bb 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; diff --git a/packages/ui/src/components/session-turn.tsx b/packages/ui/src/components/session-turn.tsx index 8e8a3f3875d..0eceb754c81 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} />
diff --git a/packages/ui/src/context/data.tsx b/packages/ui/src/context/data.tsx index 2c44763f536..e116199eb23 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, } diff --git a/packages/util/package.json b/packages/util/package.json index 4bcbb0305d4..d389d3ade1b 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.14", "private": true, "type": "module", "license": "MIT", diff --git a/packages/web/astro.config.mjs b/packages/web/astro.config.mjs index b14a7ccb8f8..612d4fb8cdd 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/package.json b/packages/web/package.json index 110c6ca2354..12bffe86d6b 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.14", "scripts": { "dev": "astro dev", "dev:remote": "VITE_API_URL=https://api.opencode.ai astro dev", diff --git a/packages/web/src/content/docs/ar/share.mdx b/packages/web/src/content/docs/ar/share.mdx index 535d44dadf8..6d13410458c 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 a15e1507434..b0760ee0c13 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/cli.mdx b/packages/web/src/content/docs/cli.mdx index c504f734fa5..6b1c3dee57e 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 eeccde2f791..038f253274e 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/da/share.mdx b/packages/web/src/content/docs/da/share.mdx index 1ac2094ca70..80b9f0959e2 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 99fad21099b..9b7e9284c7a 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 e1c62a031c0..3bb376f3862 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 acc7c03f83e..e6b067a8c82 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 f9eff6ca9bd..9b410a6b865 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 7995ba9a075..606e807dc8a 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/keybinds.mdx b/packages/web/src/content/docs/keybinds.mdx index 25fe2a1d910..95b3d496391 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/ko/share.mdx b/packages/web/src/content/docs/ko/share.mdx index 55cf6a2c3e3..9e5c6388243 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 370477d1cfc..ca0cb4829ac 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 463019295a3..0389267b59a 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/providers.mdx b/packages/web/src/content/docs/providers.mdx index db3bfeaeebe..34e3626499c 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 diff --git a/packages/web/src/content/docs/pt-br/share.mdx b/packages/web/src/content/docs/pt-br/share.mdx index 5aa0439d068..166226d6dc2 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 c4df3b6a703..8982afb08df 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 475ee08d041..b2c79334097 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 195d7696f9b..91bfce44172 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/themes.mdx b/packages/web/src/content/docs/themes.mdx index d37ce313556..8a7c6a46ac8 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/tr/share.mdx b/packages/web/src/content/docs/tr/share.mdx index 1b7abfdb7ea..a0544eb02aa 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/tui.mdx b/packages/web/src/content/docs/tui.mdx index 085eb6169f8..010e8328f41 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` @@ -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. --- diff --git a/packages/web/src/content/docs/zen.mdx b/packages/web/src/content/docs/zen.mdx index 453093206b9..48c040cf2df 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). diff --git a/packages/web/src/content/docs/zh-cn/share.mdx b/packages/web/src/content/docs/zh-cn/share.mdx index 8a7be16dc91..a2b34688e4d 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 1512007bc35..58365035b64 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" } ``` diff --git a/script/beta.ts b/script/beta.ts index a5fb027e633..b0e6c2dcc15 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 -m opencode/gpt-5.3-codex ${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 { diff --git a/script/publish.ts b/script/publish.ts index 8aa921daa83..b7ed5c8221c 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 = `