From 23b1431f0bd35fbdec759aa31be9148ebd2d901f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 2 Aug 2026 00:37:59 +0000 Subject: [PATCH 1/8] fix: keep media.prefix in the schema regardless of storage env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GET_ASSETS failed with "column media.prefix does not exist" on any deployment whose migrations were generated without bucket credentials and then run with them. s3Storage only injects its `prefix` field when a prefix is configured, so the database schema silently depended on environment variables — the column was never created, but every media query selected it. Declare the field on the Media collection instead, so the schema is the same whether or not object storage is set up. s3Storage reuses a `prefix` field it finds already present, and its default now comes from getMediaStoragePrefix(), a function so the app-specific prefix stays a runtime value rather than being emitted as a column default (which would reintroduce the same drift). Verified: with bucket credentials set, `payload migrate:create` reports no schema changes, and the media list query that produced the error succeeds. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01ApeAUnBTvGojDTftDGqTYu --- src/collections/Media.ts | 22 + .../20260802_002150_media_prefix.json | 7026 +++++++++++++++++ .../20260802_002150_media_prefix.ts | 9 + src/migrations/index.ts | 8 +- src/payload-types.ts | 2 + src/payload.config.ts | 10 +- src/utilities/getAppStoragePrefix.ts | 18 + tests/int/app-storage-prefix.int.spec.ts | 33 +- 8 files changed, 7122 insertions(+), 6 deletions(-) create mode 100644 src/migrations/20260802_002150_media_prefix.json create mode 100644 src/migrations/20260802_002150_media_prefix.ts diff --git a/src/collections/Media.ts b/src/collections/Media.ts index b147526..49c3dbd 100644 --- a/src/collections/Media.ts +++ b/src/collections/Media.ts @@ -1,5 +1,6 @@ import type { CollectionConfig } from 'payload' import { mediaAccess } from '@/access/authenticated' +import { getMediaStoragePrefix } from '@/utilities/getAppStoragePrefix' export const Media: CollectionConfig = { slug: 'media', @@ -28,6 +29,27 @@ export const Media: CollectionConfig = { hidden: true, }, }, + /** + * Declared here rather than left to `s3Storage`, which only injects a + * `prefix` field when the bucket credentials happen to be set. That made the + * database schema depend on environment variables: a deployment whose + * migration was generated without storage configured, then run with it + * configured, queries a `media.prefix` column that was never created. + * + * `s3Storage` reuses this field when it is already present, so the schema is + * now identical either way. The default is a function on purpose — a literal + * would be emitted as a column default, putting the app-specific prefix back + * into the schema and reintroducing the same drift. + */ + { + name: 'prefix', + type: 'text', + admin: { + hidden: true, + readOnly: true, + }, + defaultValue: () => getMediaStoragePrefix(), + }, ], upload: true, } diff --git a/src/migrations/20260802_002150_media_prefix.json b/src/migrations/20260802_002150_media_prefix.json new file mode 100644 index 0000000..aa77915 --- /dev/null +++ b/src/migrations/20260802_002150_media_prefix.json @@ -0,0 +1,7026 @@ +{ + "version": "6", + "dialect": "sqlite", + "tables": { + "ai_addon_purchases": { + "name": "ai_addon_purchases", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "addonId": { + "name": "addonId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "credits": { + "name": "credits", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "currency": { + "name": "currency", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'USD'" + }, + "paymentProvider": { + "name": "paymentProvider", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "paymentId": { + "name": "paymentId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'pending'" + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + } + }, + "indexes": { + "ai_addon_purchases_user_idx": { + "name": "ai_addon_purchases_user_idx", + "columns": [ + "user" + ], + "isUnique": false + } + }, + "foreignKeys": { + "ai_addon_purchases_client_fkey": { + "name": "ai_addon_purchases_client_fkey", + "tableFrom": "ai_addon_purchases", + "tableTo": "clients", + "columnsFrom": [ + "client" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "ai_credit_addons": { + "name": "ai_credit_addons", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "creditsTotal": { + "name": "creditsTotal", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "creditsUsed": { + "name": "creditsUsed", + "type": "real", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": 0 + }, + "purchaseId": { + "name": "purchaseId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'active'" + } + }, + "indexes": { + "ai_credit_addons_status_idx": { + "name": "ai_credit_addons_status_idx", + "columns": [ + "status" + ], + "isUnique": false + }, + "ai_credit_addons_user_idx": { + "name": "ai_credit_addons_user_idx", + "columns": [ + "user" + ], + "isUnique": false + } + }, + "foreignKeys": { + "ai_credit_addons_client_fkey": { + "name": "ai_credit_addons_client_fkey", + "tableFrom": "ai_credit_addons", + "tableTo": "clients", + "columnsFrom": [ + "client" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "ai_logs": { + "name": "ai_logs", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "totalDuration": { + "name": "totalDuration", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "totalTokens": { + "name": "totalTokens", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tokenUsage": { + "name": "tokenUsage", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": 0 + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "creditSource": { + "name": "creditSource", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'monthly'" + }, + "addonId": { + "name": "addonId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "ai_logs_addon_id_idx": { + "name": "ai_logs_addon_id_idx", + "columns": [ + "addonId" + ], + "isUnique": false + }, + "ai_logs_credit_source_idx": { + "name": "ai_logs_credit_source_idx", + "columns": [ + "creditSource" + ], + "isUnique": false + } + }, + "foreignKeys": { + "ai_logs_app_fkey": { + "name": "ai_logs_app_fkey", + "tableFrom": "ai_logs", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "ai_logs_client_fkey": { + "name": "ai_logs_client_fkey", + "tableFrom": "ai_logs", + "tableTo": "clients", + "columnsFrom": [ + "client" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_api_keys": { + "name": "app_api_keys", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "apiKey": { + "name": "apiKey", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "''" + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'ACTIVE'" + } + }, + "indexes": {}, + "foreignKeys": { + "app_api_keys_app_fkey": { + "name": "app_api_keys_app_fkey", + "tableFrom": "app_api_keys", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_assets": { + "name": "app_assets", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "size": { + "name": "size", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "folderId": { + "name": "folderId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "thumbnailUrl": { + "name": "thumbnailUrl", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "duration": { + "name": "duration", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "format": { + "name": "format", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "width": { + "name": "width", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "height": { + "name": "height", + "type": "real", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdBy": { + "name": "createdBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "deletedAt": { + "name": "deletedAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "app_assets_app_fkey": { + "name": "app_assets_app_fkey", + "tableFrom": "app_assets", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_domains": { + "name": "app_domains", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hosting": { + "name": "hosting", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'vercel'" + }, + "hostingProjectId": { + "name": "hostingProjectId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'env'" + }, + "subdomain": { + "name": "subdomain", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "domainConfigured": { + "name": "domainConfigured", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "app_domains_app_fkey": { + "name": "app_domains_app_fkey", + "tableFrom": "app_domains", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_form_submissions": { + "name": "app_form_submissions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "formData": { + "name": "formData", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "additionalData": { + "name": "additionalData", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "formName": { + "name": "formName", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "''" + }, + "pageUrl": { + "name": "pageUrl", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "app_form_submissions_app_fkey": { + "name": "app_form_submissions_app_fkey", + "tableFrom": "app_form_submissions", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_pages": { + "name": "app_pages", + "columns": { + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lang": { + "name": "lang", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "seo": { + "name": "seo", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "primaryPage": { + "name": "primaryPage", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blocks": { + "name": "blocks", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "currentEditor": { + "name": "currentEditor", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "changes": { + "name": "changes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "online": { + "name": "online", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + }, + "parent": { + "name": "parent", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pageType": { + "name": "pageType", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lastSaved": { + "name": "lastSaved", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dynamic": { + "name": "dynamic", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + }, + "libRefId": { + "name": "libRefId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dynamicSlugCustom": { + "name": "dynamicSlugCustom", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "''" + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "jsonld": { + "name": "jsonld", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "globalJsonLds": { + "name": "globalJsonLds", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "links": { + "name": "links", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "partialBlocks": { + "name": "partialBlocks", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "designTokens": { + "name": "designTokens", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ai": { + "name": "ai", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "deletedAt": { + "name": "deletedAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdBy": { + "name": "createdBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tracking": { + "name": "tracking", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + } + }, + "indexes": { + "idx_app_pages_app_slug": { + "name": "idx_app_pages_app_slug", + "columns": [ + "app", + "slug" + ], + "isUnique": false + } + }, + "foreignKeys": { + "app_pages_app_fkey": { + "name": "app_pages_app_fkey", + "tableFrom": "app_pages", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "app_pages_parent_fkey": { + "name": "app_pages_parent_fkey", + "tableFrom": "app_pages", + "tableTo": "app_pages", + "columnsFrom": [ + "parent" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_pages_online": { + "name": "app_pages_online", + "columns": { + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lang": { + "name": "lang", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "seo": { + "name": "seo", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "primaryPage": { + "name": "primaryPage", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blocks": { + "name": "blocks", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "currentEditor": { + "name": "currentEditor", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "changes": { + "name": "changes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "partialBlocks": { + "name": "partialBlocks", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "links": { + "name": "links", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "online": { + "name": "online", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": true + }, + "pageType": { + "name": "pageType", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "parent": { + "name": "parent", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lastSaved": { + "name": "lastSaved", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dynamic": { + "name": "dynamic", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + }, + "libRefId": { + "name": "libRefId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dynamicSlugCustom": { + "name": "dynamicSlugCustom", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "''" + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "jsonld": { + "name": "jsonld", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "globalJsonLds": { + "name": "globalJsonLds", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "designTokens": { + "name": "designTokens", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ai": { + "name": "ai", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "createdBy": { + "name": "createdBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "''" + }, + "deletedAt": { + "name": "deletedAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tracking": { + "name": "tracking", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + } + }, + "indexes": { + "idx_app_pages_online_app_slug": { + "name": "idx_app_pages_online_app_slug", + "columns": [ + "app", + "slug" + ], + "isUnique": false + } + }, + "foreignKeys": { + "app_pages_online_app_fkey": { + "name": "app_pages_online_app_fkey", + "tableFrom": "app_pages_online", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_pages_revisions": { + "name": "app_pages_revisions", + "columns": { + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "lang": { + "name": "lang", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "''" + }, + "seo": { + "name": "seo", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "primaryPage": { + "name": "primaryPage", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blocks": { + "name": "blocks", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "currentEditor": { + "name": "currentEditor", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "changes": { + "name": "changes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "partialBlocks": { + "name": "partialBlocks", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "links": { + "name": "links", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "online": { + "name": "online", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": true + }, + "pageType": { + "name": "pageType", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "parent": { + "name": "parent", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "lastSaved": { + "name": "lastSaved", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dynamic": { + "name": "dynamic", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + }, + "uid": { + "name": "uid", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "libRefId": { + "name": "libRefId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dynamicSlugCustom": { + "name": "dynamicSlugCustom", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "''" + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "jsonld": { + "name": "jsonld", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "globalJsonLds": { + "name": "globalJsonLds", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "designTokens": { + "name": "designTokens", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ai": { + "name": "ai", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "createdBy": { + "name": "createdBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tracking": { + "name": "tracking", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + } + }, + "indexes": {}, + "foreignKeys": { + "app_pages_revisions_app_fkey": { + "name": "app_pages_revisions_app_fkey", + "tableFrom": "app_pages_revisions", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_redirects": { + "name": "app_redirects", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "updatedAt": { + "name": "updatedAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "fromPath": { + "name": "fromPath", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "toPath": { + "name": "toPath", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "permanent": { + "name": "permanent", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "active": { + "name": "active", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "createdBy": { + "name": "createdBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "idx_app_redirects_app_toPath": { + "name": "idx_app_redirects_app_toPath", + "columns": [ + "app", + "toPath" + ], + "isUnique": false + }, + "app_redirects_app_fromPath_unique": { + "name": "app_redirects_app_fromPath_unique", + "columns": [ + "app", + "fromPath" + ], + "isUnique": true + } + }, + "foreignKeys": { + "app_redirects_app_fkey": { + "name": "app_redirects_app_fkey", + "tableFrom": "app_redirects", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_trash": { + "name": "app_trash", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "deletedBy": { + "name": "deletedBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "entityType": { + "name": "entityType", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "entityId": { + "name": "entityId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "trash_app_fkey": { + "name": "trash_app_fkey", + "tableFrom": "app_trash", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_user_addons": { + "name": "app_user_addons", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "addonId": { + "name": "addonId", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'active'" + } + }, + "indexes": {}, + "foreignKeys": { + "app_user_addons_client_fkey": { + "name": "app_user_addons_client_fkey", + "tableFrom": "app_user_addons", + "tableTo": "clients", + "columnsFrom": [ + "client" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_user_plans": { + "name": "app_user_plans", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "planId": { + "name": "planId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'FREE'" + }, + "nextBilledAt": { + "name": "nextBilledAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subscriptionId": { + "name": "subscriptionId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "scheduledForCancellation": { + "name": "scheduledForCancellation", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "app_user_plans_client_fkey": { + "name": "app_user_plans_client_fkey", + "tableFrom": "app_user_plans", + "tableTo": "clients", + "columnsFrom": [ + "client" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_users": { + "name": "app_users", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "permissions": { + "name": "permissions", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'active'" + } + }, + "indexes": {}, + "foreignKeys": { + "app_users_app_fkey": { + "name": "app_users_app_fkey", + "tableFrom": "app_users", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "apps": { + "name": "apps", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "settings": { + "name": "settings", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "fallbackLang": { + "name": "fallbackLang", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'en'" + }, + "languages": { + "name": "languages", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "changes": { + "name": "changes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "designTokens": { + "name": "designTokens", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "ai": { + "name": "ai", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "configData": { + "name": "configData", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "consentConfig": { + "name": "consentConfig", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + } + }, + "indexes": {}, + "foreignKeys": { + "apps_client_fkey": { + "name": "apps_client_fkey", + "tableFrom": "apps", + "tableTo": "clients", + "columnsFrom": [ + "client" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "apps_online": { + "name": "apps_online", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "settings": { + "name": "settings", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "fallbackLang": { + "name": "fallbackLang", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'en'" + }, + "languages": { + "name": "languages", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "changes": { + "name": "changes", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "apiKey": { + "name": "apiKey", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "designTokens": { + "name": "designTokens", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "ai": { + "name": "ai", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "configData": { + "name": "configData", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "consentConfig": { + "name": "consentConfig", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + } + }, + "indexes": {}, + "foreignKeys": { + "apps_online_client_fkey": { + "name": "apps_online_client_fkey", + "tableFrom": "apps_online", + "tableTo": "clients", + "columnsFrom": [ + "client" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "client_users": { + "name": "client_users", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "data": { + "name": "data", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + } + }, + "indexes": { + "client_users_user_client_unique": { + "name": "client_users_user_client_unique", + "columns": [ + "user", + "client" + ], + "isUnique": true + } + }, + "foreignKeys": { + "client_users_client_fkey": { + "name": "client_users_client_fkey", + "tableFrom": "client_users", + "tableTo": "clients", + "columnsFrom": [ + "client" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "clients": { + "name": "clients", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'active'" + }, + "billingStartDate": { + "name": "billingStartDate", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "startDate": { + "name": "startDate", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "settings": { + "name": "settings", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "loginHtml": { + "name": "loginHtml", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "features": { + "name": "features", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "paymentConfig": { + "name": "paymentConfig", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{}'" + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "helpHtml": { + "name": "helpHtml", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "madeWithBadge": { + "name": "madeWithBadge", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "superAdmins": { + "name": "superAdmins", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "ai": { + "name": "ai", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{\"models\":[]}'" + }, + "plansAndAddOns": { + "name": "plansAndAddOns", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{\"plans\":[],\"addOns\":[],\"provider\":\"DODO\",\"paymentEnv\":\"sandbox\"}'" + }, + "rolesAndPermissions": { + "name": "rolesAndPermissions", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{\"admin\":{\"permissions\":{\"*\":true}},\"editor\":{\"permissions\":{\"*\":false}},\"designer\":{\"permissions\":{\"*\":false}}}'" + }, + "coreFeatures": { + "name": "coreFeatures", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{\"ai\":true,\"email\":false,\"api_access\":false,\"multi_user\":false,\"export_code\":true,\"import_html\":true,\"multilingual\":false,\"revision_and_restore\":false}'" + }, + "envs": { + "name": "envs", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{\"payment\":{\"live\":{\"client\":\"\",\"server\":\"\"},\"sandbox\":{\"client\":\"\",\"server\":\"\"}}}'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "invited_users": { + "name": "invited_users", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'invited'" + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "invited_users_app_fkey": { + "name": "invited_users_app_fkey", + "tableFrom": "invited_users", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "invited_users_client_fkey": { + "name": "invited_users_client_fkey", + "tableFrom": "invited_users", + "tableTo": "clients", + "columnsFrom": [ + "client" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "libraries": { + "name": "libraries", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'active'" + }, + "client": { + "name": "client", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "libraries_app_fkey": { + "name": "libraries_app_fkey", + "tableFrom": "libraries", + "tableTo": "apps", + "columnsFrom": [ + "app" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "library_items": { + "name": "library_items", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "library": { + "name": "library", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blocks": { + "name": "blocks", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'[]'" + }, + "preview": { + "name": "preview", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "group": { + "name": "group", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'general'" + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "html": { + "name": "html", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdBy": { + "name": "createdBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "library_items_library_fkey": { + "name": "library_items_library_fkey", + "tableFrom": "library_items", + "tableTo": "libraries", + "columnsFrom": [ + "library" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "library_templates": { + "name": "library_templates", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "user": { + "name": "user", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pageId": { + "name": "pageId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "pageType": { + "name": "pageType", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "library": { + "name": "library", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "preview": { + "name": "preview", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "createdBy": { + "name": "createdBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "library_templates_library_fkey": { + "name": "library_templates_library_fkey", + "tableFrom": "library_templates", + "tableTo": "libraries", + "columnsFrom": [ + "library" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "roles": { + "name": "roles", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "permissions": { + "name": "permissions", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "isSystem": { + "name": "isSystem", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "roles_name_unique": { + "name": "roles_name_unique", + "columns": [ + "name" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "webhook_events": { + "name": "webhook_events", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(datetime('now'))" + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "eventType": { + "name": "eventType", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payload": { + "name": "payload", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "userId": { + "name": "userId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "clientId": { + "name": "clientId", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "webhook_events_clientId_fkey": { + "name": "webhook_events_clientId_fkey", + "tableFrom": "webhook_events", + "tableTo": "clients", + "columnsFrom": [ + "clientId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "users_sessions": { + "name": "users_sessions", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "expires_at": { + "name": "expires_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "users_sessions_order_idx": { + "name": "users_sessions_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "users_sessions_parent_id_idx": { + "name": "users_sessions_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "users_sessions_parent_id_fk": { + "name": "users_sessions_parent_id_fk", + "tableFrom": "users_sessions", + "tableTo": "users", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "users": { + "name": "users", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "first_name": { + "name": "first_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_name": { + "name": "last_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'none'" + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reset_password_token": { + "name": "reset_password_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reset_password_expiration": { + "name": "reset_password_expiration", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "salt": { + "name": "salt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hash": { + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "login_attempts": { + "name": "login_attempts", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": 0 + }, + "lock_until": { + "name": "lock_until", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "users_updated_at_idx": { + "name": "users_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "users_created_at_idx": { + "name": "users_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "users_email_idx": { + "name": "users_email_idx", + "columns": [ + "email" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "blog": { + "name": "blog", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "hero_image_id": { + "name": "hero_image_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "published_at": { + "name": "published_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "_status": { + "name": "_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'draft'" + } + }, + "indexes": { + "blog_hero_image_idx": { + "name": "blog_hero_image_idx", + "columns": [ + "hero_image_id" + ], + "isUnique": false + }, + "blog_updated_at_idx": { + "name": "blog_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "blog_created_at_idx": { + "name": "blog_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "blog__status_idx": { + "name": "blog__status_idx", + "columns": [ + "_status" + ], + "isUnique": false + } + }, + "foreignKeys": { + "blog_hero_image_id_media_id_fk": { + "name": "blog_hero_image_id_media_id_fk", + "tableFrom": "blog", + "tableTo": "media", + "columnsFrom": [ + "hero_image_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "blog_locales": { + "name": "blog_locales", + "columns": { + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{\"root\":{\"type\":\"root\",\"children\":[{\"type\":\"paragraph\",\"children\":[{\"type\":\"text\",\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"\",\"version\":1}],\"direction\":null,\"format\":\"\",\"indent\":0,\"textFormat\":0,\"textStyle\":\"\",\"version\":1}],\"direction\":null,\"format\":\"\",\"indent\":0,\"version\":1}}'" + }, + "excerpt": { + "name": "excerpt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "meta_title": { + "name": "meta_title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "meta_description": { + "name": "meta_description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "meta_image_id": { + "name": "meta_image_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "blog_slug_idx": { + "name": "blog_slug_idx", + "columns": [ + "slug", + "_locale" + ], + "isUnique": true + }, + "blog_meta_meta_image_idx": { + "name": "blog_meta_meta_image_idx", + "columns": [ + "meta_image_id", + "_locale" + ], + "isUnique": false + }, + "blog_locales_locale_parent_id_unique": { + "name": "blog_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "blog_locales_meta_image_id_media_id_fk": { + "name": "blog_locales_meta_image_id_media_id_fk", + "tableFrom": "blog_locales", + "tableTo": "media", + "columnsFrom": [ + "meta_image_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "blog_locales_parent_id_fk": { + "name": "blog_locales_parent_id_fk", + "tableFrom": "blog_locales", + "tableTo": "blog", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "blog_rels": { + "name": "blog_rels", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "blog_categories_id": { + "name": "blog_categories_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "users_id": { + "name": "users_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "blog_rels_order_idx": { + "name": "blog_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "blog_rels_parent_idx": { + "name": "blog_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "blog_rels_path_idx": { + "name": "blog_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + }, + "blog_rels_blog_categories_id_idx": { + "name": "blog_rels_blog_categories_id_idx", + "columns": [ + "blog_categories_id" + ], + "isUnique": false + }, + "blog_rels_users_id_idx": { + "name": "blog_rels_users_id_idx", + "columns": [ + "users_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "blog_rels_parent_fk": { + "name": "blog_rels_parent_fk", + "tableFrom": "blog_rels", + "tableTo": "blog", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "blog_rels_blog_categories_fk": { + "name": "blog_rels_blog_categories_fk", + "tableFrom": "blog_rels", + "tableTo": "blog_categories", + "columnsFrom": [ + "blog_categories_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "blog_rels_users_fk": { + "name": "blog_rels_users_fk", + "tableFrom": "blog_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_blog_v": { + "name": "_blog_v", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_app": { + "name": "version_app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_hero_image_id": { + "name": "version_hero_image_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_published_at": { + "name": "version_published_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_updated_at": { + "name": "version_updated_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_created_at": { + "name": "version_created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version__status": { + "name": "version__status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'draft'" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "snapshot": { + "name": "snapshot", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "published_locale": { + "name": "published_locale", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "latest": { + "name": "latest", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "_blog_v_parent_idx": { + "name": "_blog_v_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "_blog_v_version_version_hero_image_idx": { + "name": "_blog_v_version_version_hero_image_idx", + "columns": [ + "version_hero_image_id" + ], + "isUnique": false + }, + "_blog_v_version_version_updated_at_idx": { + "name": "_blog_v_version_version_updated_at_idx", + "columns": [ + "version_updated_at" + ], + "isUnique": false + }, + "_blog_v_version_version_created_at_idx": { + "name": "_blog_v_version_version_created_at_idx", + "columns": [ + "version_created_at" + ], + "isUnique": false + }, + "_blog_v_version_version__status_idx": { + "name": "_blog_v_version_version__status_idx", + "columns": [ + "version__status" + ], + "isUnique": false + }, + "_blog_v_created_at_idx": { + "name": "_blog_v_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "_blog_v_updated_at_idx": { + "name": "_blog_v_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "_blog_v_snapshot_idx": { + "name": "_blog_v_snapshot_idx", + "columns": [ + "snapshot" + ], + "isUnique": false + }, + "_blog_v_published_locale_idx": { + "name": "_blog_v_published_locale_idx", + "columns": [ + "published_locale" + ], + "isUnique": false + }, + "_blog_v_latest_idx": { + "name": "_blog_v_latest_idx", + "columns": [ + "latest" + ], + "isUnique": false + } + }, + "foreignKeys": { + "_blog_v_parent_id_blog_id_fk": { + "name": "_blog_v_parent_id_blog_id_fk", + "tableFrom": "_blog_v", + "tableTo": "blog", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "_blog_v_version_hero_image_id_media_id_fk": { + "name": "_blog_v_version_hero_image_id_media_id_fk", + "tableFrom": "_blog_v", + "tableTo": "media", + "columnsFrom": [ + "version_hero_image_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_blog_v_locales": { + "name": "_blog_v_locales", + "columns": { + "version_title": { + "name": "version_title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_slug": { + "name": "version_slug", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_content": { + "name": "version_content", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'{\"root\":{\"type\":\"root\",\"children\":[{\"type\":\"paragraph\",\"children\":[{\"type\":\"text\",\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"\",\"version\":1}],\"direction\":null,\"format\":\"\",\"indent\":0,\"textFormat\":0,\"textStyle\":\"\",\"version\":1}],\"direction\":null,\"format\":\"\",\"indent\":0,\"version\":1}}'" + }, + "version_excerpt": { + "name": "version_excerpt", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_meta_title": { + "name": "version_meta_title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_meta_description": { + "name": "version_meta_description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_meta_image_id": { + "name": "version_meta_image_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "_blog_v_version_version_slug_idx": { + "name": "_blog_v_version_version_slug_idx", + "columns": [ + "version_slug", + "_locale" + ], + "isUnique": false + }, + "_blog_v_version_meta_version_meta_image_idx": { + "name": "_blog_v_version_meta_version_meta_image_idx", + "columns": [ + "version_meta_image_id", + "_locale" + ], + "isUnique": false + }, + "_blog_v_locales_locale_parent_id_unique": { + "name": "_blog_v_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "_blog_v_locales_version_meta_image_id_media_id_fk": { + "name": "_blog_v_locales_version_meta_image_id_media_id_fk", + "tableFrom": "_blog_v_locales", + "tableTo": "media", + "columnsFrom": [ + "version_meta_image_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "_blog_v_locales_parent_id_fk": { + "name": "_blog_v_locales_parent_id_fk", + "tableFrom": "_blog_v_locales", + "tableTo": "_blog_v", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_blog_v_rels": { + "name": "_blog_v_rels", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "blog_categories_id": { + "name": "blog_categories_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "users_id": { + "name": "users_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "_blog_v_rels_order_idx": { + "name": "_blog_v_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "_blog_v_rels_parent_idx": { + "name": "_blog_v_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "_blog_v_rels_path_idx": { + "name": "_blog_v_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + }, + "_blog_v_rels_blog_categories_id_idx": { + "name": "_blog_v_rels_blog_categories_id_idx", + "columns": [ + "blog_categories_id" + ], + "isUnique": false + }, + "_blog_v_rels_users_id_idx": { + "name": "_blog_v_rels_users_id_idx", + "columns": [ + "users_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "_blog_v_rels_parent_fk": { + "name": "_blog_v_rels_parent_fk", + "tableFrom": "_blog_v_rels", + "tableTo": "_blog_v", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "_blog_v_rels_blog_categories_fk": { + "name": "_blog_v_rels_blog_categories_fk", + "tableFrom": "_blog_v_rels", + "tableTo": "blog_categories", + "columnsFrom": [ + "blog_categories_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "_blog_v_rels_users_fk": { + "name": "_blog_v_rels_users_fk", + "tableFrom": "_blog_v_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "blog_categories": { + "name": "blog_categories", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "_status": { + "name": "_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'draft'" + } + }, + "indexes": { + "blog_categories_updated_at_idx": { + "name": "blog_categories_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "blog_categories_created_at_idx": { + "name": "blog_categories_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "blog_categories__status_idx": { + "name": "blog_categories__status_idx", + "columns": [ + "_status" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "blog_categories_locales": { + "name": "blog_categories_locales", + "columns": { + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "blog_categories_slug_idx": { + "name": "blog_categories_slug_idx", + "columns": [ + "slug", + "_locale" + ], + "isUnique": true + }, + "blog_categories_locales_locale_parent_id_unique": { + "name": "blog_categories_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "blog_categories_locales_parent_id_fk": { + "name": "blog_categories_locales_parent_id_fk", + "tableFrom": "blog_categories_locales", + "tableTo": "blog_categories", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_blog_categories_v": { + "name": "_blog_categories_v", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_app": { + "name": "version_app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_updated_at": { + "name": "version_updated_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_created_at": { + "name": "version_created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version__status": { + "name": "version__status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'draft'" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "snapshot": { + "name": "snapshot", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "published_locale": { + "name": "published_locale", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "latest": { + "name": "latest", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "_blog_categories_v_parent_idx": { + "name": "_blog_categories_v_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "_blog_categories_v_version_version_updated_at_idx": { + "name": "_blog_categories_v_version_version_updated_at_idx", + "columns": [ + "version_updated_at" + ], + "isUnique": false + }, + "_blog_categories_v_version_version_created_at_idx": { + "name": "_blog_categories_v_version_version_created_at_idx", + "columns": [ + "version_created_at" + ], + "isUnique": false + }, + "_blog_categories_v_version_version__status_idx": { + "name": "_blog_categories_v_version_version__status_idx", + "columns": [ + "version__status" + ], + "isUnique": false + }, + "_blog_categories_v_created_at_idx": { + "name": "_blog_categories_v_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "_blog_categories_v_updated_at_idx": { + "name": "_blog_categories_v_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "_blog_categories_v_snapshot_idx": { + "name": "_blog_categories_v_snapshot_idx", + "columns": [ + "snapshot" + ], + "isUnique": false + }, + "_blog_categories_v_published_locale_idx": { + "name": "_blog_categories_v_published_locale_idx", + "columns": [ + "published_locale" + ], + "isUnique": false + }, + "_blog_categories_v_latest_idx": { + "name": "_blog_categories_v_latest_idx", + "columns": [ + "latest" + ], + "isUnique": false + } + }, + "foreignKeys": { + "_blog_categories_v_parent_id_blog_categories_id_fk": { + "name": "_blog_categories_v_parent_id_blog_categories_id_fk", + "tableFrom": "_blog_categories_v", + "tableTo": "blog_categories", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_blog_categories_v_locales": { + "name": "_blog_categories_v_locales", + "columns": { + "version_name": { + "name": "version_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_slug": { + "name": "version_slug", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_description": { + "name": "version_description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "_blog_categories_v_version_version_slug_idx": { + "name": "_blog_categories_v_version_version_slug_idx", + "columns": [ + "version_slug", + "_locale" + ], + "isUnique": false + }, + "_blog_categories_v_locales_locale_parent_id_unique": { + "name": "_blog_categories_v_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "_blog_categories_v_locales_parent_id_fk": { + "name": "_blog_categories_v_locales_parent_id_fk", + "tableFrom": "_blog_categories_v_locales", + "tableTo": "_blog_categories_v", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "media": { + "name": "media", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deleted_by": { + "name": "deleted_by", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "thumbnail_u_r_l": { + "name": "thumbnail_u_r_l", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "filename": { + "name": "filename", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "filesize": { + "name": "filesize", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "width": { + "name": "width", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "height": { + "name": "height", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "focal_x": { + "name": "focal_x", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "focal_y": { + "name": "focal_y", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "media_updated_at_idx": { + "name": "media_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "media_created_at_idx": { + "name": "media_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "media_filename_idx": { + "name": "media_filename_idx", + "columns": [ + "filename" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "media_locales": { + "name": "media_locales", + "columns": { + "alt": { + "name": "alt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "media_locales_locale_parent_id_unique": { + "name": "media_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "media_locales_parent_id_fk": { + "name": "media_locales_parent_id_fk", + "tableFrom": "media_locales", + "tableTo": "media", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "site_config_social_links": { + "name": "site_config_social_links", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "platform": { + "name": "platform", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "site_config_social_links_order_idx": { + "name": "site_config_social_links_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "site_config_social_links_parent_id_idx": { + "name": "site_config_social_links_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "site_config_social_links_parent_id_fk": { + "name": "site_config_social_links_parent_id_fk", + "tableFrom": "site_config_social_links", + "tableTo": "site_config", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "site_config": { + "name": "site_config", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "logo_id": { + "name": "logo_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "favicon_id": { + "name": "favicon_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "contact_email": { + "name": "contact_email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "contact_phone": { + "name": "contact_phone", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "physical_address_zip": { + "name": "physical_address_zip", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "physical_address_location": { + "name": "physical_address_location", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "_status": { + "name": "_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'draft'" + } + }, + "indexes": { + "site_config_logo_idx": { + "name": "site_config_logo_idx", + "columns": [ + "logo_id" + ], + "isUnique": false + }, + "site_config_favicon_idx": { + "name": "site_config_favicon_idx", + "columns": [ + "favicon_id" + ], + "isUnique": false + }, + "site_config_updated_at_idx": { + "name": "site_config_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "site_config_created_at_idx": { + "name": "site_config_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "site_config__status_idx": { + "name": "site_config__status_idx", + "columns": [ + "_status" + ], + "isUnique": false + } + }, + "foreignKeys": { + "site_config_logo_id_media_id_fk": { + "name": "site_config_logo_id_media_id_fk", + "tableFrom": "site_config", + "tableTo": "media", + "columnsFrom": [ + "logo_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "site_config_favicon_id_media_id_fk": { + "name": "site_config_favicon_id_media_id_fk", + "tableFrom": "site_config", + "tableTo": "media", + "columnsFrom": [ + "favicon_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "site_config_locales": { + "name": "site_config_locales", + "columns": { + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tagline": { + "name": "tagline", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "physical_address_address_line1": { + "name": "physical_address_address_line1", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "physical_address_address_line2": { + "name": "physical_address_address_line2", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "physical_address_city": { + "name": "physical_address_city", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "physical_address_state": { + "name": "physical_address_state", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "privacy_policy_page": { + "name": "privacy_policy_page", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "terms_of_services_page": { + "name": "terms_of_services_page", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "meta_title": { + "name": "meta_title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "meta_description": { + "name": "meta_description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "meta_image_id": { + "name": "meta_image_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "site_config_meta_meta_image_idx": { + "name": "site_config_meta_meta_image_idx", + "columns": [ + "meta_image_id", + "_locale" + ], + "isUnique": false + }, + "site_config_locales_locale_parent_id_unique": { + "name": "site_config_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "site_config_locales_meta_image_id_media_id_fk": { + "name": "site_config_locales_meta_image_id_media_id_fk", + "tableFrom": "site_config_locales", + "tableTo": "media", + "columnsFrom": [ + "meta_image_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "site_config_locales_parent_id_fk": { + "name": "site_config_locales_parent_id_fk", + "tableFrom": "site_config_locales", + "tableTo": "site_config", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_site_config_v_version_social_links": { + "name": "_site_config_v_version_social_links", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "platform": { + "name": "platform", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "_uuid": { + "name": "_uuid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "_site_config_v_version_social_links_order_idx": { + "name": "_site_config_v_version_social_links_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "_site_config_v_version_social_links_parent_id_idx": { + "name": "_site_config_v_version_social_links_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "_site_config_v_version_social_links_parent_id_fk": { + "name": "_site_config_v_version_social_links_parent_id_fk", + "tableFrom": "_site_config_v_version_social_links", + "tableTo": "_site_config_v", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_site_config_v": { + "name": "_site_config_v", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_app": { + "name": "version_app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_logo_id": { + "name": "version_logo_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_favicon_id": { + "name": "version_favicon_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_contact_email": { + "name": "version_contact_email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_contact_phone": { + "name": "version_contact_phone", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_physical_address_zip": { + "name": "version_physical_address_zip", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_physical_address_location": { + "name": "version_physical_address_location", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_updated_at": { + "name": "version_updated_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_created_at": { + "name": "version_created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version__status": { + "name": "version__status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'draft'" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "snapshot": { + "name": "snapshot", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "published_locale": { + "name": "published_locale", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "latest": { + "name": "latest", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "_site_config_v_parent_idx": { + "name": "_site_config_v_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "_site_config_v_version_version_logo_idx": { + "name": "_site_config_v_version_version_logo_idx", + "columns": [ + "version_logo_id" + ], + "isUnique": false + }, + "_site_config_v_version_version_favicon_idx": { + "name": "_site_config_v_version_version_favicon_idx", + "columns": [ + "version_favicon_id" + ], + "isUnique": false + }, + "_site_config_v_version_version_updated_at_idx": { + "name": "_site_config_v_version_version_updated_at_idx", + "columns": [ + "version_updated_at" + ], + "isUnique": false + }, + "_site_config_v_version_version_created_at_idx": { + "name": "_site_config_v_version_version_created_at_idx", + "columns": [ + "version_created_at" + ], + "isUnique": false + }, + "_site_config_v_version_version__status_idx": { + "name": "_site_config_v_version_version__status_idx", + "columns": [ + "version__status" + ], + "isUnique": false + }, + "_site_config_v_created_at_idx": { + "name": "_site_config_v_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "_site_config_v_updated_at_idx": { + "name": "_site_config_v_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "_site_config_v_snapshot_idx": { + "name": "_site_config_v_snapshot_idx", + "columns": [ + "snapshot" + ], + "isUnique": false + }, + "_site_config_v_published_locale_idx": { + "name": "_site_config_v_published_locale_idx", + "columns": [ + "published_locale" + ], + "isUnique": false + }, + "_site_config_v_latest_idx": { + "name": "_site_config_v_latest_idx", + "columns": [ + "latest" + ], + "isUnique": false + } + }, + "foreignKeys": { + "_site_config_v_parent_id_site_config_id_fk": { + "name": "_site_config_v_parent_id_site_config_id_fk", + "tableFrom": "_site_config_v", + "tableTo": "site_config", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "_site_config_v_version_logo_id_media_id_fk": { + "name": "_site_config_v_version_logo_id_media_id_fk", + "tableFrom": "_site_config_v", + "tableTo": "media", + "columnsFrom": [ + "version_logo_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "_site_config_v_version_favicon_id_media_id_fk": { + "name": "_site_config_v_version_favicon_id_media_id_fk", + "tableFrom": "_site_config_v", + "tableTo": "media", + "columnsFrom": [ + "version_favicon_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_site_config_v_locales": { + "name": "_site_config_v_locales", + "columns": { + "version_name": { + "name": "version_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_tagline": { + "name": "version_tagline", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_physical_address_address_line1": { + "name": "version_physical_address_address_line1", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_physical_address_address_line2": { + "name": "version_physical_address_address_line2", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_physical_address_city": { + "name": "version_physical_address_city", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_physical_address_state": { + "name": "version_physical_address_state", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_privacy_policy_page": { + "name": "version_privacy_policy_page", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_terms_of_services_page": { + "name": "version_terms_of_services_page", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_meta_title": { + "name": "version_meta_title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_meta_description": { + "name": "version_meta_description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_meta_image_id": { + "name": "version_meta_image_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "_site_config_v_version_meta_version_meta_image_idx": { + "name": "_site_config_v_version_meta_version_meta_image_idx", + "columns": [ + "version_meta_image_id", + "_locale" + ], + "isUnique": false + }, + "_site_config_v_locales_locale_parent_id_unique": { + "name": "_site_config_v_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "_site_config_v_locales_version_meta_image_id_media_id_fk": { + "name": "_site_config_v_locales_version_meta_image_id_media_id_fk", + "tableFrom": "_site_config_v_locales", + "tableTo": "media", + "columnsFrom": [ + "version_meta_image_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "_site_config_v_locales_parent_id_fk": { + "name": "_site_config_v_locales_parent_id_fk", + "tableFrom": "_site_config_v_locales", + "tableTo": "_site_config_v", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "form_submissions": { + "name": "form_submissions", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "form_name": { + "name": "form_name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "page_url": { + "name": "page_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "form_data": { + "name": "form_data", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "additional_data": { + "name": "additional_data", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + } + }, + "indexes": { + "form_submissions_updated_at_idx": { + "name": "form_submissions_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "form_submissions_created_at_idx": { + "name": "form_submissions_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "menus_items_children": { + "name": "menus_items_children", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'page'" + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "open_in_new_tab": { + "name": "open_in_new_tab", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "menus_items_children_order_idx": { + "name": "menus_items_children_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "menus_items_children_parent_id_idx": { + "name": "menus_items_children_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "menus_items_children_parent_id_fk": { + "name": "menus_items_children_parent_id_fk", + "tableFrom": "menus_items_children", + "tableTo": "menus_items", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "menus_items_children_locales": { + "name": "menus_items_children_locales", + "columns": { + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "menus_items_children_locales_locale_parent_id_unique": { + "name": "menus_items_children_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "menus_items_children_locales_parent_id_fk": { + "name": "menus_items_children_locales_parent_id_fk", + "tableFrom": "menus_items_children_locales", + "tableTo": "menus_items_children", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "menus_items": { + "name": "menus_items", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'page'" + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "open_in_new_tab": { + "name": "open_in_new_tab", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "menus_items_order_idx": { + "name": "menus_items_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "menus_items_parent_id_idx": { + "name": "menus_items_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "menus_items_parent_id_fk": { + "name": "menus_items_parent_id_fk", + "tableFrom": "menus_items", + "tableTo": "menus", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "menus_items_locales": { + "name": "menus_items_locales", + "columns": { + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "menus_items_locales_locale_parent_id_unique": { + "name": "menus_items_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "menus_items_locales_parent_id_fk": { + "name": "menus_items_locales_parent_id_fk", + "tableFrom": "menus_items_locales", + "tableTo": "menus_items", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "menus": { + "name": "menus", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "app": { + "name": "app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "_status": { + "name": "_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'draft'" + } + }, + "indexes": { + "menus_updated_at_idx": { + "name": "menus_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "menus_created_at_idx": { + "name": "menus_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "menus__status_idx": { + "name": "menus__status_idx", + "columns": [ + "_status" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_menus_v_version_items_children": { + "name": "_menus_v_version_items_children", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'page'" + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "open_in_new_tab": { + "name": "open_in_new_tab", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "_uuid": { + "name": "_uuid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "_menus_v_version_items_children_order_idx": { + "name": "_menus_v_version_items_children_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "_menus_v_version_items_children_parent_id_idx": { + "name": "_menus_v_version_items_children_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "_menus_v_version_items_children_parent_id_fk": { + "name": "_menus_v_version_items_children_parent_id_fk", + "tableFrom": "_menus_v_version_items_children", + "tableTo": "_menus_v_version_items", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_menus_v_version_items_children_locales": { + "name": "_menus_v_version_items_children_locales", + "columns": { + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "_menus_v_version_items_children_locales_locale_parent_id_uni": { + "name": "_menus_v_version_items_children_locales_locale_parent_id_uni", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "_menus_v_version_items_children_locales_parent_id_fk": { + "name": "_menus_v_version_items_children_locales_parent_id_fk", + "tableFrom": "_menus_v_version_items_children_locales", + "tableTo": "_menus_v_version_items_children", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_menus_v_version_items": { + "name": "_menus_v_version_items", + "columns": { + "_order": { + "name": "_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'page'" + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "open_in_new_tab": { + "name": "open_in_new_tab", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "_uuid": { + "name": "_uuid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "_menus_v_version_items_order_idx": { + "name": "_menus_v_version_items_order_idx", + "columns": [ + "_order" + ], + "isUnique": false + }, + "_menus_v_version_items_parent_id_idx": { + "name": "_menus_v_version_items_parent_id_idx", + "columns": [ + "_parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "_menus_v_version_items_parent_id_fk": { + "name": "_menus_v_version_items_parent_id_fk", + "tableFrom": "_menus_v_version_items", + "tableTo": "_menus_v", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_menus_v_version_items_locales": { + "name": "_menus_v_version_items_locales", + "columns": { + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "_locale": { + "name": "_locale", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "_parent_id": { + "name": "_parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "_menus_v_version_items_locales_locale_parent_id_unique": { + "name": "_menus_v_version_items_locales_locale_parent_id_unique", + "columns": [ + "_locale", + "_parent_id" + ], + "isUnique": true + } + }, + "foreignKeys": { + "_menus_v_version_items_locales_parent_id_fk": { + "name": "_menus_v_version_items_locales_parent_id_fk", + "tableFrom": "_menus_v_version_items_locales", + "tableTo": "_menus_v_version_items", + "columnsFrom": [ + "_parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "_menus_v": { + "name": "_menus_v", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_app": { + "name": "version_app", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_name": { + "name": "version_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_description": { + "name": "version_description", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_updated_at": { + "name": "version_updated_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version_created_at": { + "name": "version_created_at", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "version__status": { + "name": "version__status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false, + "default": "'draft'" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "snapshot": { + "name": "snapshot", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "published_locale": { + "name": "published_locale", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "latest": { + "name": "latest", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "_menus_v_parent_idx": { + "name": "_menus_v_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "_menus_v_version_version_updated_at_idx": { + "name": "_menus_v_version_version_updated_at_idx", + "columns": [ + "version_updated_at" + ], + "isUnique": false + }, + "_menus_v_version_version_created_at_idx": { + "name": "_menus_v_version_version_created_at_idx", + "columns": [ + "version_created_at" + ], + "isUnique": false + }, + "_menus_v_version_version__status_idx": { + "name": "_menus_v_version_version__status_idx", + "columns": [ + "version__status" + ], + "isUnique": false + }, + "_menus_v_created_at_idx": { + "name": "_menus_v_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + }, + "_menus_v_updated_at_idx": { + "name": "_menus_v_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "_menus_v_snapshot_idx": { + "name": "_menus_v_snapshot_idx", + "columns": [ + "snapshot" + ], + "isUnique": false + }, + "_menus_v_published_locale_idx": { + "name": "_menus_v_published_locale_idx", + "columns": [ + "published_locale" + ], + "isUnique": false + }, + "_menus_v_latest_idx": { + "name": "_menus_v_latest_idx", + "columns": [ + "latest" + ], + "isUnique": false + } + }, + "foreignKeys": { + "_menus_v_parent_id_menus_id_fk": { + "name": "_menus_v_parent_id_menus_id_fk", + "tableFrom": "_menus_v", + "tableTo": "menus", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "payload_kv": { + "name": "payload_kv", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "data": { + "name": "data", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "payload_kv_key_idx": { + "name": "payload_kv_key_idx", + "columns": [ + "key" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "payload_locked_documents": { + "name": "payload_locked_documents", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "global_slug": { + "name": "global_slug", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + } + }, + "indexes": { + "payload_locked_documents_global_slug_idx": { + "name": "payload_locked_documents_global_slug_idx", + "columns": [ + "global_slug" + ], + "isUnique": false + }, + "payload_locked_documents_updated_at_idx": { + "name": "payload_locked_documents_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "payload_locked_documents_created_at_idx": { + "name": "payload_locked_documents_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "payload_locked_documents_rels": { + "name": "payload_locked_documents_rels", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "users_id": { + "name": "users_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blog_id": { + "name": "blog_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "blog_categories_id": { + "name": "blog_categories_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "media_id": { + "name": "media_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_config_id": { + "name": "site_config_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "form_submissions_id": { + "name": "form_submissions_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "menus_id": { + "name": "menus_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "payload_locked_documents_rels_order_idx": { + "name": "payload_locked_documents_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "payload_locked_documents_rels_parent_idx": { + "name": "payload_locked_documents_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "payload_locked_documents_rels_path_idx": { + "name": "payload_locked_documents_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + }, + "payload_locked_documents_rels_users_id_idx": { + "name": "payload_locked_documents_rels_users_id_idx", + "columns": [ + "users_id" + ], + "isUnique": false + }, + "payload_locked_documents_rels_blog_id_idx": { + "name": "payload_locked_documents_rels_blog_id_idx", + "columns": [ + "blog_id" + ], + "isUnique": false + }, + "payload_locked_documents_rels_blog_categories_id_idx": { + "name": "payload_locked_documents_rels_blog_categories_id_idx", + "columns": [ + "blog_categories_id" + ], + "isUnique": false + }, + "payload_locked_documents_rels_media_id_idx": { + "name": "payload_locked_documents_rels_media_id_idx", + "columns": [ + "media_id" + ], + "isUnique": false + }, + "payload_locked_documents_rels_site_config_id_idx": { + "name": "payload_locked_documents_rels_site_config_id_idx", + "columns": [ + "site_config_id" + ], + "isUnique": false + }, + "payload_locked_documents_rels_form_submissions_id_idx": { + "name": "payload_locked_documents_rels_form_submissions_id_idx", + "columns": [ + "form_submissions_id" + ], + "isUnique": false + }, + "payload_locked_documents_rels_menus_id_idx": { + "name": "payload_locked_documents_rels_menus_id_idx", + "columns": [ + "menus_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "payload_locked_documents_rels_parent_fk": { + "name": "payload_locked_documents_rels_parent_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "payload_locked_documents", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_users_fk": { + "name": "payload_locked_documents_rels_users_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_blog_fk": { + "name": "payload_locked_documents_rels_blog_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "blog", + "columnsFrom": [ + "blog_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_blog_categories_fk": { + "name": "payload_locked_documents_rels_blog_categories_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "blog_categories", + "columnsFrom": [ + "blog_categories_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_media_fk": { + "name": "payload_locked_documents_rels_media_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "media", + "columnsFrom": [ + "media_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_site_config_fk": { + "name": "payload_locked_documents_rels_site_config_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "site_config", + "columnsFrom": [ + "site_config_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_form_submissions_fk": { + "name": "payload_locked_documents_rels_form_submissions_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "form_submissions", + "columnsFrom": [ + "form_submissions_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_locked_documents_rels_menus_fk": { + "name": "payload_locked_documents_rels_menus_fk", + "tableFrom": "payload_locked_documents_rels", + "tableTo": "menus", + "columnsFrom": [ + "menus_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "payload_preferences": { + "name": "payload_preferences", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + } + }, + "indexes": { + "payload_preferences_key_idx": { + "name": "payload_preferences_key_idx", + "columns": [ + "key" + ], + "isUnique": false + }, + "payload_preferences_updated_at_idx": { + "name": "payload_preferences_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "payload_preferences_created_at_idx": { + "name": "payload_preferences_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "payload_preferences_rels": { + "name": "payload_preferences_rels", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "text(36)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "users_id": { + "name": "users_id", + "type": "text(36)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "payload_preferences_rels_order_idx": { + "name": "payload_preferences_rels_order_idx", + "columns": [ + "order" + ], + "isUnique": false + }, + "payload_preferences_rels_parent_idx": { + "name": "payload_preferences_rels_parent_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + }, + "payload_preferences_rels_path_idx": { + "name": "payload_preferences_rels_path_idx", + "columns": [ + "path" + ], + "isUnique": false + }, + "payload_preferences_rels_users_id_idx": { + "name": "payload_preferences_rels_users_id_idx", + "columns": [ + "users_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "payload_preferences_rels_parent_fk": { + "name": "payload_preferences_rels_parent_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "payload_preferences", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "payload_preferences_rels_users_fk": { + "name": "payload_preferences_rels_users_fk", + "tableFrom": "payload_preferences_rels", + "tableTo": "users", + "columnsFrom": [ + "users_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "payload_migrations": { + "name": "payload_migrations", + "columns": { + "id": { + "name": "id", + "type": "text(36)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "batch": { + "name": "batch", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + }, + "created_at": { + "name": "created_at", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" + } + }, + "indexes": { + "payload_migrations_updated_at_idx": { + "name": "payload_migrations_updated_at_idx", + "columns": [ + "updated_at" + ], + "isUnique": false + }, + "payload_migrations_created_at_idx": { + "name": "payload_migrations_created_at_idx", + "columns": [ + "created_at" + ], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + }, + "id": "237d52dd-1a35-4b29-a1ca-79bb809a8d20", + "prevId": "00000000-0000-0000-0000-000000000000" +} \ No newline at end of file diff --git a/src/migrations/20260802_002150_media_prefix.ts b/src/migrations/20260802_002150_media_prefix.ts new file mode 100644 index 0000000..e1cde12 --- /dev/null +++ b/src/migrations/20260802_002150_media_prefix.ts @@ -0,0 +1,9 @@ +import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-sqlite' + +export async function up({ db, payload, req }: MigrateUpArgs): Promise { + await db.run(sql`ALTER TABLE \`media\` ADD \`prefix\` text;`) +} + +export async function down({ db, payload, req }: MigrateDownArgs): Promise { + await db.run(sql`ALTER TABLE \`media\` DROP COLUMN \`prefix\`;`) +} diff --git a/src/migrations/index.ts b/src/migrations/index.ts index 01206e3..072acb4 100644 --- a/src/migrations/index.ts +++ b/src/migrations/index.ts @@ -1,9 +1,15 @@ import * as migration_20260724_153838_initial from './20260724_153838_initial'; +import * as migration_20260802_002150_media_prefix from './20260802_002150_media_prefix'; export const migrations = [ { up: migration_20260724_153838_initial.up, down: migration_20260724_153838_initial.down, - name: '20260724_153838_initial' + name: '20260724_153838_initial', + }, + { + up: migration_20260802_002150_media_prefix.up, + down: migration_20260802_002150_media_prefix.down, + name: '20260802_002150_media_prefix' }, ]; diff --git a/src/payload-types.ts b/src/payload-types.ts index 8e9f3a9..2a69cf1 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -213,6 +213,7 @@ export interface Media { alt: string; deletedAt?: string | null; deletedBy?: string | null; + prefix?: string | null; updatedAt: string; createdAt: string; url?: string | null; @@ -531,6 +532,7 @@ export interface MediaSelect { alt?: T; deletedAt?: T; deletedBy?: T; + prefix?: T; updatedAt?: T; createdAt?: T; url?: T; diff --git a/src/payload.config.ts b/src/payload.config.ts index 9c198c7..6cad1e2 100644 --- a/src/payload.config.ts +++ b/src/payload.config.ts @@ -15,7 +15,7 @@ import { SiteConfig } from './collections/SiteConfig' import { Users } from './collections/Users' import { getAdminRoute } from '@/utilities/adminRoute' -import { getAppStoragePrefix } from '@/utilities/getAppStoragePrefix' +import { getMediaStoragePrefix } from '@/utilities/getAppStoragePrefix' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) @@ -72,6 +72,7 @@ export function resolveDatabase( export function buildPayloadConfig(overrides: PayloadConfigOverrides = {}) { const { url: databaseUrl, authToken: databaseAuthToken } = resolveDatabase(overrides.database) const secret = overrides.secret || process.env.PAYLOAD_SECRET || PLACEHOLDER_SECRET + const mediaStoragePrefix = getMediaStoragePrefix() return buildConfig({ routes: { @@ -167,12 +168,13 @@ export function buildPayloadConfig(overrides: PayloadConfigOverrides = {}) { }), // Local disk uploads do not survive a redeploy on serverless hosts, so S3 // is registered whenever the bucket credentials are present. The app key - // is required too, since the storage prefix is derived from it. - ...(mediaStorageActive && process.env.CHAIBUILDER_APP_KEY + // is required too, since the storage prefix is derived from it — an empty + // prefix means one of the two is missing. + ...(mediaStoragePrefix ? [ s3Storage({ collections: { - media: { prefix: getAppStoragePrefix() }, + media: { prefix: mediaStoragePrefix }, }, bucket: process.env.BUCKET_NAME!, config: { diff --git a/src/utilities/getAppStoragePrefix.ts b/src/utilities/getAppStoragePrefix.ts index 76f4481..c04362f 100644 --- a/src/utilities/getAppStoragePrefix.ts +++ b/src/utilities/getAppStoragePrefix.ts @@ -41,3 +41,21 @@ export function getAppStoragePrefix(appId?: string): string { } return uuidV5(appKey, MEDIA_STORAGE_NAMESPACE) } + +/** + * The prefix media files are actually stored under, or `''` when uploads go to + * local disk. Bucket credentials and the app key are both required: without + * either one, `s3Storage` is not registered and nothing is prefixed. + * + * Resolved per call rather than at module load so it stays a runtime value — + * baking it into the database schema as a column default would make the schema + * differ between deployments and between build and run. + */ +export function getMediaStoragePrefix(): string { + const configured = + process.env.BUCKET_NAME && + process.env.AWS_ACCESS_KEY_ID && + process.env.AWS_SECRET_ACCESS_KEY && + process.env.CHAIBUILDER_APP_KEY + return configured ? getAppStoragePrefix() : '' +} diff --git a/tests/int/app-storage-prefix.int.spec.ts b/tests/int/app-storage-prefix.int.spec.ts index 31b510c..461c23e 100644 --- a/tests/int/app-storage-prefix.int.spec.ts +++ b/tests/int/app-storage-prefix.int.spec.ts @@ -1,5 +1,5 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest' -import { getAppStoragePrefix } from '../../src/utilities/getAppStoragePrefix' +import { getAppStoragePrefix, getMediaStoragePrefix } from '../../src/utilities/getAppStoragePrefix' const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i @@ -57,3 +57,34 @@ describe('getAppStoragePrefix', () => { ) }) }) + +describe('getMediaStoragePrefix', () => { + const env = process.env + + beforeEach(() => { + process.env = { ...env } + process.env.CHAIBUILDER_APP_KEY = '00000000-0000-4000-8000-000000000001' + process.env.BUCKET_NAME = 'media' + process.env.AWS_ACCESS_KEY_ID = 'key' + process.env.AWS_SECRET_ACCESS_KEY = 'secret' + }) + + afterEach(() => { + process.env = env + }) + + it('returns the app storage prefix when the bucket is fully configured', () => { + expect(getMediaStoragePrefix()).toBe(getAppStoragePrefix()) + }) + + // Each of these leaves `s3Storage` unregistered, so uploads go to local disk + // and carry no prefix. Throwing instead would break booting an unconfigured + // deployment far enough to serve `/setup`. + it.each(['BUCKET_NAME', 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'CHAIBUILDER_APP_KEY'])( + 'returns an empty prefix when %s is missing', + (missing) => { + delete process.env[missing] + expect(getMediaStoragePrefix()).toBe('') + }, + ) +}) From d8d3eb95e99da45d6424600c4bfb5c168a8461f0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 2 Aug 2026 04:09:26 +0000 Subject: [PATCH 2/8] fix: shorten the media storage prefix so no UUID appears in object paths The prefix is part of every stored object's path, so its shape is public. Strip the hyphens from the derived UUID and drop its final group, leaving a 20-character hex token: still deterministic from CHAIBUILDER_APP_KEY, still 80 bits against collisions, but nothing in the path reads as a UUID and no complete UUID is published. Only new uploads are affected. Reads resolve the prefix from each document's stored `prefix` value, so files already in the bucket keep resolving under the prefix they were written with. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01ApeAUnBTvGojDTftDGqTYu --- src/utilities/getAppStoragePrefix.ts | 21 ++++++++++++++---- tests/int/app-storage-prefix.int.spec.ts | 27 +++++++++++++++++------- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/utilities/getAppStoragePrefix.ts b/src/utilities/getAppStoragePrefix.ts index c04362f..8612f24 100644 --- a/src/utilities/getAppStoragePrefix.ts +++ b/src/utilities/getAppStoragePrefix.ts @@ -2,8 +2,9 @@ import { createHash } from 'node:crypto' /** * Project-specific UUID v5 namespace. Fixed constant — do not change after - * deploy (would change every app's R2 prefix). Not secret; obscures app UUID - * in bucket paths when combined with v5(appKey). + * deploy (would change every app's R2 prefix, orphaning already-uploaded + * files). Not secret; obscures app UUID in bucket paths when combined with + * v5(appKey). */ const MEDIA_STORAGE_NAMESPACE = 'a3f2c891-4e7b-5d2a-9c18-6f0e1b3d5a72' @@ -30,16 +31,28 @@ function uuidV5(name: string, namespaceUuid: string): string { return formatUuid(bytes) } +/** + * Number of hex characters kept from the derived UUID. A UUID is 32 hex + * characters in five groups; dropping the final 12-character group and the + * hyphens leaves a 20-character token — 80 bits, far more than enough to keep + * app folders from colliding, while nothing in the path still reads as a UUID. + */ +const PREFIX_LENGTH = 20 + /** * Opaque, deterministic R2 folder id for the current app. - * UUID v5(CHAIBUILDER_APP_KEY) under a fixed project namespace. + * + * UUID v5(CHAIBUILDER_APP_KEY) under a fixed project namespace, then stripped + * of hyphens and truncated. Storage prefixes appear in object paths, so the + * value is doubly removed from the app key: the v5 hash is not reversible, and + * the truncation means the derived UUID is not published in full either. */ export function getAppStoragePrefix(appId?: string): string { const appKey = appId ?? process.env.CHAIBUILDER_APP_KEY if (!appKey) { throw new Error('CHAIBUILDER_APP_KEY is required to compute storage prefix') } - return uuidV5(appKey, MEDIA_STORAGE_NAMESPACE) + return uuidV5(appKey, MEDIA_STORAGE_NAMESPACE).replace(/-/g, '').slice(0, PREFIX_LENGTH) } /** diff --git a/tests/int/app-storage-prefix.int.spec.ts b/tests/int/app-storage-prefix.int.spec.ts index 461c23e..b9aff8b 100644 --- a/tests/int/app-storage-prefix.int.spec.ts +++ b/tests/int/app-storage-prefix.int.spec.ts @@ -1,8 +1,7 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest' import { getAppStoragePrefix, getMediaStoragePrefix } from '../../src/utilities/getAppStoragePrefix' -const UUID_RE = - /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i +const PREFIX_RE = /^[0-9a-f]{20}$/ describe('getAppStoragePrefix', () => { const env = process.env @@ -16,10 +15,21 @@ describe('getAppStoragePrefix', () => { process.env = env }) - it('returns a UUID-shaped string different from the app key', () => { + // The prefix shows up in object paths, so it must not read as a UUID: no + // hyphens, and short enough that no complete UUID is published. + it('returns 20 hex characters with no hyphens', () => { const prefix = getAppStoragePrefix() - expect(prefix).toMatch(UUID_RE) - expect(prefix).not.toBe(process.env.CHAIBUILDER_APP_KEY) + expect(prefix).toMatch(PREFIX_RE) + expect(prefix).not.toContain('-') + }) + + it('leaks neither the app key nor the full derived UUID', () => { + const appKey = process.env.CHAIBUILDER_APP_KEY! + const prefix = getAppStoragePrefix() + expect(prefix).not.toBe(appKey) + expect(prefix).not.toContain(appKey.replace(/-/g, '')) + // 20 of the derived UUID's 32 hex characters — the last group is dropped. + expect(prefix).toHaveLength(20) }) it('is stable for the same app key', () => { @@ -50,10 +60,11 @@ describe('getAppStoragePrefix', () => { expect(() => getAppStoragePrefix()).toThrow(/CHAIBUILDER_APP_KEY/) }) - // Pin expected output so accidental namespace constant changes are caught - it('matches pinned v5 output for a fixture app key', () => { + // Pin expected output so accidental namespace or truncation changes are + // caught — either would orphan every file already in the bucket. + it('matches pinned output for a fixture app key', () => { expect(getAppStoragePrefix('00000000-0000-4000-8000-000000000001')).toBe( - '56e6552e-e274-526d-85a9-c4107865b7ca', + '56e6552ee274526d85a9', ) }) }) From f81da53f1373aaf6f2712de7a909022be4a819f2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 2 Aug 2026 04:18:20 +0000 Subject: [PATCH 3/8] fix: derive the storage prefix from the app key alone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prefix was a UUID v5 of the app key under a fixed namespace constant. That constant was a second input to a value that must never move: editing it would leave every existing file under the old prefix while new uploads went to a new folder, since Payload resolves reads, deletes and URLs from each document's stored `prefix` and only falls back to the configured value. Derive the prefix from the app key and nothing else — hyphens removed, final group dropped, 20 hex characters. One folder per app, fixed for the life of the app, with no constant anyone can change to split it in two. The dropped group keeps the whole app key out of object paths. A non-UUID app key now throws rather than being truncated into a prefix short enough to collide with another app or to land files at the bucket root. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01ApeAUnBTvGojDTftDGqTYu --- src/utilities/getAppStoragePrefix.ts | 62 ++++++++---------------- tests/int/app-storage-prefix.int.spec.ts | 46 ++++++++++++------ 2 files changed, 52 insertions(+), 56 deletions(-) diff --git a/src/utilities/getAppStoragePrefix.ts b/src/utilities/getAppStoragePrefix.ts index 8612f24..9418740 100644 --- a/src/utilities/getAppStoragePrefix.ts +++ b/src/utilities/getAppStoragePrefix.ts @@ -1,58 +1,36 @@ -import { createHash } from 'node:crypto' - /** - * Project-specific UUID v5 namespace. Fixed constant — do not change after - * deploy (would change every app's R2 prefix, orphaning already-uploaded - * files). Not secret; obscures app UUID in bucket paths when combined with - * v5(appKey). - */ -const MEDIA_STORAGE_NAMESPACE = 'a3f2c891-4e7b-5d2a-9c18-6f0e1b3d5a72' - -function parseUuidToBytes(uuid: string): Buffer { - const hex = uuid.replace(/-/g, '') - if (hex.length !== 32) { - throw new Error('Invalid namespace UUID') - } - return Buffer.from(hex, 'hex') -} - -function formatUuid(bytes: Buffer): string { - const hex = bytes.toString('hex') - return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20, 32)}` -} - -/** RFC 4122 UUID v5 — deterministic from namespace + name. */ -function uuidV5(name: string, namespaceUuid: string): string { - const namespace = parseUuidToBytes(namespaceUuid) - const hash = createHash('sha1').update(namespace).update(name, 'utf8').digest() - const bytes = Buffer.from(hash.subarray(0, 16)) - bytes[6] = (bytes[6]! & 0x0f) | 0x50 // version 5 - bytes[8] = (bytes[8]! & 0x3f) | 0x80 // variant RFC 4122 - return formatUuid(bytes) -} - -/** - * Number of hex characters kept from the derived UUID. A UUID is 32 hex - * characters in five groups; dropping the final 12-character group and the - * hyphens leaves a 20-character token — 80 bits, far more than enough to keep - * app folders from colliding, while nothing in the path still reads as a UUID. + * Number of hex characters kept from the app key. A UUID is 32 hex characters + * in five groups; dropping the final 12-character group and the hyphens leaves + * a 20-character token — 80 bits, far more than enough to keep app folders from + * colliding, while the app key is never published in full. */ const PREFIX_LENGTH = 20 /** * Opaque, deterministic R2 folder id for the current app. * - * UUID v5(CHAIBUILDER_APP_KEY) under a fixed project namespace, then stripped - * of hyphens and truncated. Storage prefixes appear in object paths, so the - * value is doubly removed from the app key: the v5 hash is not reversible, and - * the truncation means the derived UUID is not published in full either. + * The app key with its hyphens removed, truncated to the first + * {@link PREFIX_LENGTH} hex characters. Deliberately a pure function of the app + * key and nothing else: an app's folder is fixed for the life of the app, and + * there is no constant here that anyone can change to send new uploads to a + * second folder while old files stay behind in the first. + * + * The dropped group keeps the whole app key out of object paths — those 48 bits + * cannot be recovered from the prefix. */ export function getAppStoragePrefix(appId?: string): string { const appKey = appId ?? process.env.CHAIBUILDER_APP_KEY if (!appKey) { throw new Error('CHAIBUILDER_APP_KEY is required to compute storage prefix') } - return uuidV5(appKey, MEDIA_STORAGE_NAMESPACE).replace(/-/g, '').slice(0, PREFIX_LENGTH) + const hex = appKey.replace(/-/g, '').toLowerCase() + // `/setup` always writes a `randomUUID()`. Anything else is a hand-edited key, + // and truncating it would put files at the bucket root or under a prefix + // short enough to collide with another app — fail loudly instead. + if (!/^[0-9a-f]{32}$/.test(hex)) { + throw new Error('CHAIBUILDER_APP_KEY must be a UUID to compute storage prefix') + } + return hex.slice(0, PREFIX_LENGTH) } /** diff --git a/tests/int/app-storage-prefix.int.spec.ts b/tests/int/app-storage-prefix.int.spec.ts index b9aff8b..2d58150 100644 --- a/tests/int/app-storage-prefix.int.spec.ts +++ b/tests/int/app-storage-prefix.int.spec.ts @@ -3,12 +3,15 @@ import { getAppStoragePrefix, getMediaStoragePrefix } from '../../src/utilities/ const PREFIX_RE = /^[0-9a-f]{20}$/ +const APP_KEY = '926e3219-b756-4b17-856b-ad17c4fe139c' +const OTHER_APP_KEY = '3f5a1c88-2d94-4e07-b1aa-6c3e9f2d7b41' + describe('getAppStoragePrefix', () => { const env = process.env beforeEach(() => { process.env = { ...env } - process.env.CHAIBUILDER_APP_KEY = '00000000-0000-4000-8000-000000000001' + process.env.CHAIBUILDER_APP_KEY = APP_KEY }) afterEach(() => { @@ -23,13 +26,12 @@ describe('getAppStoragePrefix', () => { expect(prefix).not.toContain('-') }) - it('leaks neither the app key nor the full derived UUID', () => { - const appKey = process.env.CHAIBUILDER_APP_KEY! + it('does not publish the app key in full', () => { const prefix = getAppStoragePrefix() - expect(prefix).not.toBe(appKey) - expect(prefix).not.toContain(appKey.replace(/-/g, '')) - // 20 of the derived UUID's 32 hex characters — the last group is dropped. - expect(prefix).toHaveLength(20) + expect(prefix).not.toBe(APP_KEY) + expect(prefix).not.toContain(APP_KEY.replace(/-/g, '')) + // The final group is dropped, so those 48 bits are absent from the path. + expect(prefix).not.toContain(APP_KEY.split('-').at(-1)) }) it('is stable for the same app key', () => { @@ -38,11 +40,20 @@ describe('getAppStoragePrefix', () => { it('changes when app key changes', () => { const a = getAppStoragePrefix() - process.env.CHAIBUILDER_APP_KEY = '00000000-0000-4000-8000-000000000002' + process.env.CHAIBUILDER_APP_KEY = OTHER_APP_KEY const b = getAppStoragePrefix() expect(a).not.toBe(b) }) + // Only the leading 20 hex characters are significant. Harmless for the + // `randomUUID()` keys `/setup` writes, but hand-picked sequential keys that + // differ only in the last group will share a folder. + it('ignores everything after the 20th hex character', () => { + expect(getAppStoragePrefix('00000000-0000-4000-8000-000000000001')).toBe( + getAppStoragePrefix('00000000-0000-4000-8000-000000000002'), + ) + }) + it('is unaffected by PAYLOAD_SECRET', () => { const before = getAppStoragePrefix() process.env.PAYLOAD_SECRET = 'totally-different-secret' @@ -51,7 +62,7 @@ describe('getAppStoragePrefix', () => { it('accepts explicit appId override', () => { const fromEnv = getAppStoragePrefix() - const fromArg = getAppStoragePrefix('00000000-0000-4000-8000-000000000001') + const fromArg = getAppStoragePrefix(APP_KEY) expect(fromArg).toBe(fromEnv) }) @@ -60,12 +71,19 @@ describe('getAppStoragePrefix', () => { expect(() => getAppStoragePrefix()).toThrow(/CHAIBUILDER_APP_KEY/) }) - // Pin expected output so accidental namespace or truncation changes are - // caught — either would orphan every file already in the bucket. + // Truncating a non-UUID key would put files at the bucket root or under a + // prefix short enough to collide with another app. + it.each(['my-site', 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz', '926e3219b756'])( + 'throws for a non-UUID app key (%j)', + (key) => { + expect(() => getAppStoragePrefix(key)).toThrow(/CHAIBUILDER_APP_KEY/) + }, + ) + + // Pin expected output so an accidental change to the derivation is caught — + // it would send new uploads to a different folder than every existing file. it('matches pinned output for a fixture app key', () => { - expect(getAppStoragePrefix('00000000-0000-4000-8000-000000000001')).toBe( - '56e6552ee274526d85a9', - ) + expect(getAppStoragePrefix(APP_KEY)).toBe('926e3219b7564b17856b') }) }) From b594cf4d50d46ba82a0e01af49a6c6c20da6dde5 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 2 Aug 2026 04:27:03 +0000 Subject: [PATCH 4/8] fix: reverse the surviving app key groups in the storage prefix Taking the leading characters of the app key made the folder name read as a truncated app key. Drop the final group and join the remaining four in reverse order instead: 926e3219-b756-4b17-856b-ad17c4fe139c -> 856b4b17b756926e3219 Still 20 hex characters, still a pure function of the app key with no other input, still withholding the final group's 48 bits. Validation is now shape-based rather than character-based, since dropping a group off a value that has none would leave an empty prefix: a hyphen-less key carrying all 32 hex characters is rejected where it previously passed. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01ApeAUnBTvGojDTftDGqTYu --- src/utilities/getAppStoragePrefix.ts | 36 +++++++++++----------- tests/int/app-storage-prefix.int.spec.ts | 39 ++++++++++++++++-------- 2 files changed, 44 insertions(+), 31 deletions(-) diff --git a/src/utilities/getAppStoragePrefix.ts b/src/utilities/getAppStoragePrefix.ts index 9418740..67f148f 100644 --- a/src/utilities/getAppStoragePrefix.ts +++ b/src/utilities/getAppStoragePrefix.ts @@ -1,36 +1,36 @@ -/** - * Number of hex characters kept from the app key. A UUID is 32 hex characters - * in five groups; dropping the final 12-character group and the hyphens leaves - * a 20-character token — 80 bits, far more than enough to keep app folders from - * colliding, while the app key is never published in full. - */ -const PREFIX_LENGTH = 20 +/** Canonical UUID: five hex groups of 8-4-4-4-12 characters. */ +const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ /** * Opaque, deterministic R2 folder id for the current app. * - * The app key with its hyphens removed, truncated to the first - * {@link PREFIX_LENGTH} hex characters. Deliberately a pure function of the app - * key and nothing else: an app's folder is fixed for the life of the app, and - * there is no constant here that anyone can change to send new uploads to a - * second folder while old files stay behind in the first. + * The app key's final group is dropped and the remaining four are joined in + * reverse order, giving 20 hex characters: + * + * 926e3219-b756-4b17-856b-ad17c4fe139c -> 856b4b17b756926e3219 + * + * Deliberately a pure function of the app key and nothing else: an app's folder + * is fixed for the life of the app, and there is no constant here that anyone + * can change to send new uploads to a second folder while old files stay behind + * in the first. * * The dropped group keeps the whole app key out of object paths — those 48 bits - * cannot be recovered from the prefix. + * cannot be recovered from the prefix — and the reversal stops the remainder + * from reading as the head of a UUID. */ export function getAppStoragePrefix(appId?: string): string { const appKey = appId ?? process.env.CHAIBUILDER_APP_KEY if (!appKey) { throw new Error('CHAIBUILDER_APP_KEY is required to compute storage prefix') } - const hex = appKey.replace(/-/g, '').toLowerCase() + const normalized = appKey.toLowerCase() // `/setup` always writes a `randomUUID()`. Anything else is a hand-edited key, - // and truncating it would put files at the bucket root or under a prefix - // short enough to collide with another app — fail loudly instead. - if (!/^[0-9a-f]{32}$/.test(hex)) { + // and dropping a group off a value that has none would put files at the bucket + // root or under a prefix short enough to collide — fail loudly instead. + if (!UUID_RE.test(normalized)) { throw new Error('CHAIBUILDER_APP_KEY must be a UUID to compute storage prefix') } - return hex.slice(0, PREFIX_LENGTH) + return normalized.split('-').slice(0, -1).reverse().join('') } /** diff --git a/tests/int/app-storage-prefix.int.spec.ts b/tests/int/app-storage-prefix.int.spec.ts index 2d58150..b25334e 100644 --- a/tests/int/app-storage-prefix.int.spec.ts +++ b/tests/int/app-storage-prefix.int.spec.ts @@ -34,6 +34,11 @@ describe('getAppStoragePrefix', () => { expect(prefix).not.toContain(APP_KEY.split('-').at(-1)) }) + it('joins the surviving groups in reverse order', () => { + const [first, second, third, fourth] = APP_KEY.split('-') + expect(getAppStoragePrefix()).toBe(`${fourth}${third}${second}${first}`) + }) + it('is stable for the same app key', () => { expect(getAppStoragePrefix()).toBe(getAppStoragePrefix()) }) @@ -45,10 +50,10 @@ describe('getAppStoragePrefix', () => { expect(a).not.toBe(b) }) - // Only the leading 20 hex characters are significant. Harmless for the - // `randomUUID()` keys `/setup` writes, but hand-picked sequential keys that - // differ only in the last group will share a folder. - it('ignores everything after the 20th hex character', () => { + // The final group is dropped, so it cannot affect the folder. Harmless for + // the `randomUUID()` keys `/setup` writes, but hand-picked sequential keys + // that differ only in that group will share a folder. + it("ignores the app key's final group", () => { expect(getAppStoragePrefix('00000000-0000-4000-8000-000000000001')).toBe( getAppStoragePrefix('00000000-0000-4000-8000-000000000002'), ) @@ -71,19 +76,27 @@ describe('getAppStoragePrefix', () => { expect(() => getAppStoragePrefix()).toThrow(/CHAIBUILDER_APP_KEY/) }) - // Truncating a non-UUID key would put files at the bucket root or under a - // prefix short enough to collide with another app. - it.each(['my-site', 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz', '926e3219b756'])( - 'throws for a non-UUID app key (%j)', - (key) => { - expect(() => getAppStoragePrefix(key)).toThrow(/CHAIBUILDER_APP_KEY/) - }, - ) + // Dropping a group off a key that has none would leave an empty prefix, so + // anything not UUID-shaped has to be rejected — including a hyphen-less key + // that carries all 32 hex characters. + it.each([ + 'my-site', + 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz', + '926e3219b756', + '926e3219b7564b17856bad17c4fe139c', + '926e3219-b756-4b17-856b', + ])('throws for a non-UUID app key (%j)', (key) => { + expect(() => getAppStoragePrefix(key)).toThrow(/CHAIBUILDER_APP_KEY/) + }) // Pin expected output so an accidental change to the derivation is caught — // it would send new uploads to a different folder than every existing file. it('matches pinned output for a fixture app key', () => { - expect(getAppStoragePrefix(APP_KEY)).toBe('926e3219b7564b17856b') + expect(getAppStoragePrefix(APP_KEY)).toBe('856b4b17b756926e3219') + }) + + it('accepts an uppercase app key', () => { + expect(getAppStoragePrefix(APP_KEY.toUpperCase())).toBe(getAppStoragePrefix(APP_KEY)) }) }) From d6e4245ea11ea1f9a42b0a3584f018bee3dd740f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Aug 2026 05:13:17 +0000 Subject: [PATCH 5/8] fix: make media prefix migration idempotent --- src/migrations/20260802_002150_media_prefix.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/migrations/20260802_002150_media_prefix.ts b/src/migrations/20260802_002150_media_prefix.ts index e1cde12..326a782 100644 --- a/src/migrations/20260802_002150_media_prefix.ts +++ b/src/migrations/20260802_002150_media_prefix.ts @@ -1,7 +1,15 @@ import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-sqlite' export async function up({ db, payload, req }: MigrateUpArgs): Promise { - await db.run(sql`ALTER TABLE \`media\` ADD \`prefix\` text;`) + try { + await db.run(sql`ALTER TABLE \`media\` ADD \`prefix\` text;`) + } catch (error) { + if (error instanceof Error && error.message.includes('duplicate column name: prefix')) { + return + } + + throw error + } } export async function down({ db, payload, req }: MigrateDownArgs): Promise { From ce9ef38adb8939cbd9f9b2e783f5526104b455fc Mon Sep 17 00:00:00 2001 From: Suraj Air Date: Sun, 2 Aug 2026 15:15:20 +0530 Subject: [PATCH 6/8] chore: recreate initial migration --- package.json | 2 +- pnpm-lock.yaml | 10 +- pnpm-workspace.yaml | 2 +- src/chaibuilder.config.ts | 58 +- src/migrations/20260724_153838_initial.json | 7019 ----------------- .../20260802_002150_media_prefix.ts | 17 - ...efix.json => 20260802_094413_initial.json} | 2 +- ..._initial.ts => 20260802_094413_initial.ts} | 1 + src/migrations/index.ts | 14 +- 9 files changed, 14 insertions(+), 7111 deletions(-) delete mode 100644 src/migrations/20260724_153838_initial.json delete mode 100644 src/migrations/20260802_002150_media_prefix.ts rename src/migrations/{20260802_002150_media_prefix.json => 20260802_094413_initial.json} (99%) rename src/migrations/{20260724_153838_initial.ts => 20260802_094413_initial.ts} (99%) diff --git a/package.json b/package.json index 7851063..19beef9 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@payloadcms/ui": "3.85.1", "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/forms": "^0.5.11", - "chaipro": "^0.2.6", + "chaipro": "^0.3.0", "cnfast": "^0.0.8", "cross-env": "^7.0.3", "dotenv": "16.4.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e881eb..750a161 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,8 +47,8 @@ importers: specifier: ^0.5.11 version: 0.5.11(tailwindcss@4.3.3) chaipro: - specifier: ^0.2.6 - version: 0.2.6(1b462b3377e3eb2a68b9fbf2b0a240be) + specifier: ^0.3.0 + version: 0.3.0(1b462b3377e3eb2a68b9fbf2b0a240be) cnfast: specifier: ^0.0.8 version: 0.0.8 @@ -3835,8 +3835,8 @@ packages: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} - chaipro@0.2.6: - resolution: {integrity: sha512-0PBy/E93nceScQGgwvdsK3/E5pECtlCHeqn4ufM2PSoKdTKsFGeY+a66RTbvIGcTRF8WlUczt78SVRPshQEQKQ==} + chaipro@0.3.0: + resolution: {integrity: sha512-TfMshz6w3MN44JPxjOnvurj3ogVA07acmuVP5Sx5HDKq8gBl5SQDGskB12+B2WrgvONZze3MC6mXyM9VLwmiFQ==} hasBin: true peerDependencies: '@ai-sdk/openai-compatible': '>=2.0.0' @@ -11003,7 +11003,7 @@ snapshots: chai@6.2.2: {} - chaipro@0.2.6(1b462b3377e3eb2a68b9fbf2b0a240be): + chaipro@0.3.0(1b462b3377e3eb2a68b9fbf2b0a240be): dependencies: '@ai-sdk/react': 3.0.221(react@19.2.6)(zod@4.3.5) '@floating-ui/dom': 1.7.4 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c5f9dda..bc44a68 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -9,7 +9,7 @@ allowBuilds: unrs-resolver: true minimumReleaseAgeExclude: - - chaipro@0.1.0 || 0.1.13 || 0.1.14 || 0.2.1 || 0.2.3 || 0.2.4 || 0.2.6 + - chaipro@0.1.0 || 0.1.13 || 0.1.14 || 0.2.1 || 0.2.3 || 0.2.4 || 0.2.6 || 0.3.0 overrides: "framer-motion@12.23.20>motion-dom": "12.23.20" diff --git a/src/chaibuilder.config.ts b/src/chaibuilder.config.ts index 9dcbdab..0ceac36 100644 --- a/src/chaibuilder.config.ts +++ b/src/chaibuilder.config.ts @@ -13,7 +13,6 @@ import { } from 'chaipro/payload' import { aiPlugin } from 'chaipro/plugins/ai-pro/server' import { animationPlugin } from 'chaipro/plugins/animation/server' -import { mediaSearchPlugin } from 'chaipro/plugins/media-search/server' import { redirectsPlugin } from 'chaipro/plugins/redirects/server' import { revisionsPlugin } from 'chaipro/plugins/revisions/server' import { trashPlugin } from 'chaipro/plugins/trash/server' @@ -27,67 +26,12 @@ const chaiConfig: Readonly = buildChaiBuilderCo url: process.env.DATABASE_URL || 'file:/tmp/chai-placeholder.db', authToken: process.env.DATABASE_AUTH_TOKEN || undefined, }), - // Registering a plugin enables its feature; options carry the feature's config. - // Plugin tables are NOT gated here — `chaiBuilderSchemaHookSqlite` injects the - // full ChaiBuilder schema, so every plugin's tables exist (empty when - // unregistered) and enabling a plugin later needs no migration. - // Not registered: aiCreditsPlugin (credit billing), multilingualPlugin, - // tenancyPlugin (core pins a single app), plansPlugin, licensingPlugin, - // rolesPlugin (DB-backed roles), layoutPlugin, formSubmissionsPlugin (this - // starter writes submissions to its own Payload collection). plugins: [ // Payload-backed DAM (asset actions + media trash entity). Non-Payload // hosts would register mediaPlugin({ storage }) instead. payloadMediaPlugin(), redirectsPlugin(), trashPlugin(), - mediaSearchPlugin({ - providers: [ - { - id: 'pexels', - filters: { - orientation: ['default', 'landscape', 'portrait', 'square'], - size: ['default', 'large', 'medium', 'small'], - color: [ - 'default', - 'red', - 'orange', - 'yellow', - 'green', - 'turquoise', - 'blue', - 'violet', - 'pink', - 'brown', - 'black', - 'gray', - 'white', - ], - }, - }, - { - id: 'unsplash', - filters: { - orientation: ['default', 'landscape', 'portrait', 'squarish'], - color: [ - 'default', - 'black_and_white', - 'black', - 'white', - 'yellow', - 'orange', - 'red', - 'purple', - 'magenta', - 'green', - 'teal', - 'blue', - ], - order_by: ['default', 'relevant', 'latest'], - }, - }, - ], - }), aiPlugin(), revisionsPlugin({ drafts: true, maxRevisions: 10 }), animationPlugin(), @@ -95,7 +39,7 @@ const chaiConfig: Readonly = buildChaiBuilderCo ai: { models: [ { - id: 'zai/glm-5.2', + id: 'zai/glm-5.2', // for openrouter, the id is z-ai/glm-5.2 name: 'GLM 5.2', provider: 'zai', multiplier: 3, diff --git a/src/migrations/20260724_153838_initial.json b/src/migrations/20260724_153838_initial.json deleted file mode 100644 index d46ddf6..0000000 --- a/src/migrations/20260724_153838_initial.json +++ /dev/null @@ -1,7019 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "tables": { - "ai_addon_purchases": { - "name": "ai_addon_purchases", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "addonId": { - "name": "addonId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "credits": { - "name": "credits", - "type": "real", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "amount": { - "name": "amount", - "type": "real", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "currency": { - "name": "currency", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'USD'" - }, - "paymentProvider": { - "name": "paymentProvider", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "paymentId": { - "name": "paymentId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'pending'" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - } - }, - "indexes": { - "ai_addon_purchases_user_idx": { - "name": "ai_addon_purchases_user_idx", - "columns": [ - "user" - ], - "isUnique": false - } - }, - "foreignKeys": { - "ai_addon_purchases_client_fkey": { - "name": "ai_addon_purchases_client_fkey", - "tableFrom": "ai_addon_purchases", - "tableTo": "clients", - "columnsFrom": [ - "client" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "ai_credit_addons": { - "name": "ai_credit_addons", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "creditsTotal": { - "name": "creditsTotal", - "type": "real", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "creditsUsed": { - "name": "creditsUsed", - "type": "real", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "purchaseId": { - "name": "purchaseId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'active'" - } - }, - "indexes": { - "ai_credit_addons_status_idx": { - "name": "ai_credit_addons_status_idx", - "columns": [ - "status" - ], - "isUnique": false - }, - "ai_credit_addons_user_idx": { - "name": "ai_credit_addons_user_idx", - "columns": [ - "user" - ], - "isUnique": false - } - }, - "foreignKeys": { - "ai_credit_addons_client_fkey": { - "name": "ai_credit_addons_client_fkey", - "tableFrom": "ai_credit_addons", - "tableTo": "clients", - "columnsFrom": [ - "client" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "ai_logs": { - "name": "ai_logs", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "totalDuration": { - "name": "totalDuration", - "type": "real", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "totalTokens": { - "name": "totalTokens", - "type": "real", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tokenUsage": { - "name": "tokenUsage", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "cost": { - "name": "cost", - "type": "real", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": 0 - }, - "prompt": { - "name": "prompt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "creditSource": { - "name": "creditSource", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'monthly'" - }, - "addonId": { - "name": "addonId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "ai_logs_addon_id_idx": { - "name": "ai_logs_addon_id_idx", - "columns": [ - "addonId" - ], - "isUnique": false - }, - "ai_logs_credit_source_idx": { - "name": "ai_logs_credit_source_idx", - "columns": [ - "creditSource" - ], - "isUnique": false - } - }, - "foreignKeys": { - "ai_logs_app_fkey": { - "name": "ai_logs_app_fkey", - "tableFrom": "ai_logs", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "ai_logs_client_fkey": { - "name": "ai_logs_client_fkey", - "tableFrom": "ai_logs", - "tableTo": "clients", - "columnsFrom": [ - "client" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_api_keys": { - "name": "app_api_keys", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'ACTIVE'" - } - }, - "indexes": {}, - "foreignKeys": { - "app_api_keys_app_fkey": { - "name": "app_api_keys_app_fkey", - "tableFrom": "app_api_keys", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_assets": { - "name": "app_assets", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "size": { - "name": "size", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "folderId": { - "name": "folderId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "thumbnailUrl": { - "name": "thumbnailUrl", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "duration": { - "name": "duration", - "type": "real", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "width": { - "name": "width", - "type": "real", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "height": { - "name": "height", - "type": "real", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "createdBy": { - "name": "createdBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updatedAt": { - "name": "updatedAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "deletedAt": { - "name": "deletedAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedBy": { - "name": "deletedBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "app_assets_app_fkey": { - "name": "app_assets_app_fkey", - "tableFrom": "app_assets", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_domains": { - "name": "app_domains", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "hosting": { - "name": "hosting", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'vercel'" - }, - "hostingProjectId": { - "name": "hostingProjectId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'env'" - }, - "subdomain": { - "name": "subdomain", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "domainConfigured": { - "name": "domainConfigured", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "app_domains_app_fkey": { - "name": "app_domains_app_fkey", - "tableFrom": "app_domains", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_form_submissions": { - "name": "app_form_submissions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "formData": { - "name": "formData", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "additionalData": { - "name": "additionalData", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "formName": { - "name": "formName", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "pageUrl": { - "name": "pageUrl", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "app_form_submissions_app_fkey": { - "name": "app_form_submissions_app_fkey", - "tableFrom": "app_form_submissions", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_pages": { - "name": "app_pages", - "columns": { - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "lang": { - "name": "lang", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "''" - }, - "seo": { - "name": "seo", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "primaryPage": { - "name": "primaryPage", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "blocks": { - "name": "blocks", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "currentEditor": { - "name": "currentEditor", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changes": { - "name": "changes", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "online": { - "name": "online", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - }, - "parent": { - "name": "parent", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "pageType": { - "name": "pageType", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "lastSaved": { - "name": "lastSaved", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dynamic": { - "name": "dynamic", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - }, - "libRefId": { - "name": "libRefId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dynamicSlugCustom": { - "name": "dynamicSlugCustom", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "jsonld": { - "name": "jsonld", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "globalJsonLds": { - "name": "globalJsonLds", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "links": { - "name": "links", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "partialBlocks": { - "name": "partialBlocks", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "designTokens": { - "name": "designTokens", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "ai": { - "name": "ai", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "deletedAt": { - "name": "deletedAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedBy": { - "name": "deletedBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "createdBy": { - "name": "createdBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tracking": { - "name": "tracking", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - } - }, - "indexes": { - "idx_app_pages_app_slug": { - "name": "idx_app_pages_app_slug", - "columns": [ - "app", - "slug" - ], - "isUnique": false - } - }, - "foreignKeys": { - "app_pages_app_fkey": { - "name": "app_pages_app_fkey", - "tableFrom": "app_pages", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "app_pages_parent_fkey": { - "name": "app_pages_parent_fkey", - "tableFrom": "app_pages", - "tableTo": "app_pages", - "columnsFrom": [ - "parent" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_pages_online": { - "name": "app_pages_online", - "columns": { - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "lang": { - "name": "lang", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "''" - }, - "seo": { - "name": "seo", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "primaryPage": { - "name": "primaryPage", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "blocks": { - "name": "blocks", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "currentEditor": { - "name": "currentEditor", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changes": { - "name": "changes", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "partialBlocks": { - "name": "partialBlocks", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "links": { - "name": "links", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "online": { - "name": "online", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": true - }, - "pageType": { - "name": "pageType", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent": { - "name": "parent", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "lastSaved": { - "name": "lastSaved", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dynamic": { - "name": "dynamic", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - }, - "libRefId": { - "name": "libRefId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dynamicSlugCustom": { - "name": "dynamicSlugCustom", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "jsonld": { - "name": "jsonld", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "globalJsonLds": { - "name": "globalJsonLds", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "designTokens": { - "name": "designTokens", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "ai": { - "name": "ai", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "createdBy": { - "name": "createdBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "deletedAt": { - "name": "deletedAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedBy": { - "name": "deletedBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tracking": { - "name": "tracking", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - } - }, - "indexes": { - "idx_app_pages_online_app_slug": { - "name": "idx_app_pages_online_app_slug", - "columns": [ - "app", - "slug" - ], - "isUnique": false - } - }, - "foreignKeys": { - "app_pages_online_app_fkey": { - "name": "app_pages_online_app_fkey", - "tableFrom": "app_pages_online", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_pages_revisions": { - "name": "app_pages_revisions", - "columns": { - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "lang": { - "name": "lang", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "''" - }, - "seo": { - "name": "seo", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "primaryPage": { - "name": "primaryPage", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "blocks": { - "name": "blocks", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "currentEditor": { - "name": "currentEditor", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "changes": { - "name": "changes", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "partialBlocks": { - "name": "partialBlocks", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "links": { - "name": "links", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "online": { - "name": "online", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": true - }, - "pageType": { - "name": "pageType", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent": { - "name": "parent", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "lastSaved": { - "name": "lastSaved", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dynamic": { - "name": "dynamic", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - }, - "uid": { - "name": "uid", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "libRefId": { - "name": "libRefId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "dynamicSlugCustom": { - "name": "dynamicSlugCustom", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "jsonld": { - "name": "jsonld", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "globalJsonLds": { - "name": "globalJsonLds", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "designTokens": { - "name": "designTokens", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "ai": { - "name": "ai", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "createdBy": { - "name": "createdBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedBy": { - "name": "deletedBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedAt": { - "name": "deletedAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tracking": { - "name": "tracking", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - } - }, - "indexes": {}, - "foreignKeys": { - "app_pages_revisions_app_fkey": { - "name": "app_pages_revisions_app_fkey", - "tableFrom": "app_pages_revisions", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_redirects": { - "name": "app_redirects", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "updatedAt": { - "name": "updatedAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "fromPath": { - "name": "fromPath", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "toPath": { - "name": "toPath", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permanent": { - "name": "permanent", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "active": { - "name": "active", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "createdBy": { - "name": "createdBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "idx_app_redirects_app_toPath": { - "name": "idx_app_redirects_app_toPath", - "columns": [ - "app", - "toPath" - ], - "isUnique": false - }, - "app_redirects_app_fromPath_unique": { - "name": "app_redirects_app_fromPath_unique", - "columns": [ - "app", - "fromPath" - ], - "isUnique": true - } - }, - "foreignKeys": { - "app_redirects_app_fkey": { - "name": "app_redirects_app_fkey", - "tableFrom": "app_redirects", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_trash": { - "name": "app_trash", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "deletedAt": { - "name": "deletedAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "deletedBy": { - "name": "deletedBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "entityType": { - "name": "entityType", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "entityId": { - "name": "entityId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "trash_app_fkey": { - "name": "trash_app_fkey", - "tableFrom": "app_trash", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_user_addons": { - "name": "app_user_addons", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "addonId": { - "name": "addonId", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'active'" - } - }, - "indexes": {}, - "foreignKeys": { - "app_user_addons_client_fkey": { - "name": "app_user_addons_client_fkey", - "tableFrom": "app_user_addons", - "tableTo": "clients", - "columnsFrom": [ - "client" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_user_plans": { - "name": "app_user_plans", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "planId": { - "name": "planId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'FREE'" - }, - "nextBilledAt": { - "name": "nextBilledAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "subscriptionId": { - "name": "subscriptionId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "scheduledForCancellation": { - "name": "scheduledForCancellation", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "app_user_plans_client_fkey": { - "name": "app_user_plans_client_fkey", - "tableFrom": "app_user_plans", - "tableTo": "clients", - "columnsFrom": [ - "client" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app_users": { - "name": "app_users", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "permissions": { - "name": "permissions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'active'" - } - }, - "indexes": {}, - "foreignKeys": { - "app_users_app_fkey": { - "name": "app_users_app_fkey", - "tableFrom": "app_users", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "apps": { - "name": "apps", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "settings": { - "name": "settings", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "theme": { - "name": "theme", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "fallbackLang": { - "name": "fallbackLang", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'en'" - }, - "languages": { - "name": "languages", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "changes": { - "name": "changes", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedAt": { - "name": "deletedAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "designTokens": { - "name": "designTokens", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "ai": { - "name": "ai", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "configData": { - "name": "configData", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "consentConfig": { - "name": "consentConfig", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - } - }, - "indexes": {}, - "foreignKeys": { - "apps_client_fkey": { - "name": "apps_client_fkey", - "tableFrom": "apps", - "tableTo": "clients", - "columnsFrom": [ - "client" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "apps_online": { - "name": "apps_online", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "settings": { - "name": "settings", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "theme": { - "name": "theme", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "fallbackLang": { - "name": "fallbackLang", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'en'" - }, - "languages": { - "name": "languages", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "changes": { - "name": "changes", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedAt": { - "name": "deletedAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "designTokens": { - "name": "designTokens", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "ai": { - "name": "ai", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "configData": { - "name": "configData", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "consentConfig": { - "name": "consentConfig", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - } - }, - "indexes": {}, - "foreignKeys": { - "apps_online_client_fkey": { - "name": "apps_online_client_fkey", - "tableFrom": "apps_online", - "tableTo": "clients", - "columnsFrom": [ - "client" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "client_users": { - "name": "client_users", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "data": { - "name": "data", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - } - }, - "indexes": { - "client_users_user_client_unique": { - "name": "client_users_user_client_unique", - "columns": [ - "user", - "client" - ], - "isUnique": true - } - }, - "foreignKeys": { - "client_users_client_fkey": { - "name": "client_users_client_fkey", - "tableFrom": "client_users", - "tableTo": "clients", - "columnsFrom": [ - "client" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "clients": { - "name": "clients", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'active'" - }, - "billingStartDate": { - "name": "billingStartDate", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "startDate": { - "name": "startDate", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "settings": { - "name": "settings", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "loginHtml": { - "name": "loginHtml", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "features": { - "name": "features", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "paymentConfig": { - "name": "paymentConfig", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{}'" - }, - "theme": { - "name": "theme", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "helpHtml": { - "name": "helpHtml", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "madeWithBadge": { - "name": "madeWithBadge", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "superAdmins": { - "name": "superAdmins", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "ai": { - "name": "ai", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{\"models\":[]}'" - }, - "plansAndAddOns": { - "name": "plansAndAddOns", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{\"plans\":[],\"addOns\":[],\"provider\":\"DODO\",\"paymentEnv\":\"sandbox\"}'" - }, - "rolesAndPermissions": { - "name": "rolesAndPermissions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{\"admin\":{\"permissions\":{\"*\":true}},\"editor\":{\"permissions\":{\"*\":false}},\"designer\":{\"permissions\":{\"*\":false}}}'" - }, - "coreFeatures": { - "name": "coreFeatures", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{\"ai\":true,\"email\":false,\"api_access\":false,\"multi_user\":false,\"export_code\":true,\"import_html\":true,\"multilingual\":false,\"revision_and_restore\":false}'" - }, - "envs": { - "name": "envs", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{\"payment\":{\"live\":{\"client\":\"\",\"server\":\"\"},\"sandbox\":{\"client\":\"\",\"server\":\"\"}}}'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "invited_users": { - "name": "invited_users", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'invited'" - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "invited_users_app_fkey": { - "name": "invited_users_app_fkey", - "tableFrom": "invited_users", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "invited_users_client_fkey": { - "name": "invited_users_client_fkey", - "tableFrom": "invited_users", - "tableTo": "clients", - "columnsFrom": [ - "client" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "libraries": { - "name": "libraries", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'active'" - }, - "client": { - "name": "client", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "libraries_app_fkey": { - "name": "libraries_app_fkey", - "tableFrom": "libraries", - "tableTo": "apps", - "columnsFrom": [ - "app" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "library_items": { - "name": "library_items", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "library": { - "name": "library", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "blocks": { - "name": "blocks", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "preview": { - "name": "preview", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "group": { - "name": "group", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'general'" - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "html": { - "name": "html", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedAt": { - "name": "deletedAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedBy": { - "name": "deletedBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "createdBy": { - "name": "createdBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "library_items_library_fkey": { - "name": "library_items_library_fkey", - "tableFrom": "library_items", - "tableTo": "libraries", - "columnsFrom": [ - "library" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "library_templates": { - "name": "library_templates", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "user": { - "name": "user", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "pageId": { - "name": "pageId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "pageType": { - "name": "pageType", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "library": { - "name": "library", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "preview": { - "name": "preview", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedAt": { - "name": "deletedAt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "createdBy": { - "name": "createdBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deletedBy": { - "name": "deletedBy", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "library_templates_library_fkey": { - "name": "library_templates_library_fkey", - "tableFrom": "library_templates", - "tableTo": "libraries", - "columnsFrom": [ - "library" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "roles": { - "name": "roles", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "permissions": { - "name": "permissions", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'[]'" - }, - "isSystem": { - "name": "isSystem", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": { - "roles_name_unique": { - "name": "roles_name_unique", - "columns": [ - "name" - ], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "webhook_events": { - "name": "webhook_events", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "createdAt": { - "name": "createdAt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(datetime('now'))" - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "eventType": { - "name": "eventType", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "payload": { - "name": "payload", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "userId": { - "name": "userId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "clientId": { - "name": "clientId", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "webhook_events_clientId_fkey": { - "name": "webhook_events_clientId_fkey", - "tableFrom": "webhook_events", - "tableTo": "clients", - "columnsFrom": [ - "clientId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "users_sessions": { - "name": "users_sessions", - "columns": { - "_order": { - "name": "_order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "expires_at": { - "name": "expires_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "users_sessions_order_idx": { - "name": "users_sessions_order_idx", - "columns": [ - "_order" - ], - "isUnique": false - }, - "users_sessions_parent_id_idx": { - "name": "users_sessions_parent_id_idx", - "columns": [ - "_parent_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "users_sessions_parent_id_fk": { - "name": "users_sessions_parent_id_fk", - "tableFrom": "users_sessions", - "tableTo": "users", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "users": { - "name": "users", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "first_name": { - "name": "first_name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_name": { - "name": "last_name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'none'" - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "reset_password_token": { - "name": "reset_password_token", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "reset_password_expiration": { - "name": "reset_password_expiration", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "salt": { - "name": "salt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "login_attempts": { - "name": "login_attempts", - "type": "numeric", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": 0 - }, - "lock_until": { - "name": "lock_until", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "users_updated_at_idx": { - "name": "users_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "users_created_at_idx": { - "name": "users_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "users_email_idx": { - "name": "users_email_idx", - "columns": [ - "email" - ], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "blog": { - "name": "blog", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "hero_image_id": { - "name": "hero_image_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "published_at": { - "name": "published_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "_status": { - "name": "_status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'draft'" - } - }, - "indexes": { - "blog_hero_image_idx": { - "name": "blog_hero_image_idx", - "columns": [ - "hero_image_id" - ], - "isUnique": false - }, - "blog_updated_at_idx": { - "name": "blog_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "blog_created_at_idx": { - "name": "blog_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "blog__status_idx": { - "name": "blog__status_idx", - "columns": [ - "_status" - ], - "isUnique": false - } - }, - "foreignKeys": { - "blog_hero_image_id_media_id_fk": { - "name": "blog_hero_image_id_media_id_fk", - "tableFrom": "blog", - "tableTo": "media", - "columnsFrom": [ - "hero_image_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "blog_locales": { - "name": "blog_locales", - "columns": { - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{\"root\":{\"type\":\"root\",\"children\":[{\"type\":\"paragraph\",\"children\":[{\"type\":\"text\",\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"\",\"version\":1}],\"direction\":null,\"format\":\"\",\"indent\":0,\"textFormat\":0,\"textStyle\":\"\",\"version\":1}],\"direction\":null,\"format\":\"\",\"indent\":0,\"version\":1}}'" - }, - "excerpt": { - "name": "excerpt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "meta_title": { - "name": "meta_title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "meta_description": { - "name": "meta_description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "meta_image_id": { - "name": "meta_image_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "blog_slug_idx": { - "name": "blog_slug_idx", - "columns": [ - "slug", - "_locale" - ], - "isUnique": true - }, - "blog_meta_meta_image_idx": { - "name": "blog_meta_meta_image_idx", - "columns": [ - "meta_image_id", - "_locale" - ], - "isUnique": false - }, - "blog_locales_locale_parent_id_unique": { - "name": "blog_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "blog_locales_meta_image_id_media_id_fk": { - "name": "blog_locales_meta_image_id_media_id_fk", - "tableFrom": "blog_locales", - "tableTo": "media", - "columnsFrom": [ - "meta_image_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "blog_locales_parent_id_fk": { - "name": "blog_locales_parent_id_fk", - "tableFrom": "blog_locales", - "tableTo": "blog", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "blog_rels": { - "name": "blog_rels", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "blog_categories_id": { - "name": "blog_categories_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "users_id": { - "name": "users_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "blog_rels_order_idx": { - "name": "blog_rels_order_idx", - "columns": [ - "order" - ], - "isUnique": false - }, - "blog_rels_parent_idx": { - "name": "blog_rels_parent_idx", - "columns": [ - "parent_id" - ], - "isUnique": false - }, - "blog_rels_path_idx": { - "name": "blog_rels_path_idx", - "columns": [ - "path" - ], - "isUnique": false - }, - "blog_rels_blog_categories_id_idx": { - "name": "blog_rels_blog_categories_id_idx", - "columns": [ - "blog_categories_id" - ], - "isUnique": false - }, - "blog_rels_users_id_idx": { - "name": "blog_rels_users_id_idx", - "columns": [ - "users_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "blog_rels_parent_fk": { - "name": "blog_rels_parent_fk", - "tableFrom": "blog_rels", - "tableTo": "blog", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "blog_rels_blog_categories_fk": { - "name": "blog_rels_blog_categories_fk", - "tableFrom": "blog_rels", - "tableTo": "blog_categories", - "columnsFrom": [ - "blog_categories_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "blog_rels_users_fk": { - "name": "blog_rels_users_fk", - "tableFrom": "blog_rels", - "tableTo": "users", - "columnsFrom": [ - "users_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_blog_v": { - "name": "_blog_v", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_app": { - "name": "version_app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_hero_image_id": { - "name": "version_hero_image_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_published_at": { - "name": "version_published_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_updated_at": { - "name": "version_updated_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_created_at": { - "name": "version_created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version__status": { - "name": "version__status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'draft'" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "snapshot": { - "name": "snapshot", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "published_locale": { - "name": "published_locale", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "latest": { - "name": "latest", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "_blog_v_parent_idx": { - "name": "_blog_v_parent_idx", - "columns": [ - "parent_id" - ], - "isUnique": false - }, - "_blog_v_version_version_hero_image_idx": { - "name": "_blog_v_version_version_hero_image_idx", - "columns": [ - "version_hero_image_id" - ], - "isUnique": false - }, - "_blog_v_version_version_updated_at_idx": { - "name": "_blog_v_version_version_updated_at_idx", - "columns": [ - "version_updated_at" - ], - "isUnique": false - }, - "_blog_v_version_version_created_at_idx": { - "name": "_blog_v_version_version_created_at_idx", - "columns": [ - "version_created_at" - ], - "isUnique": false - }, - "_blog_v_version_version__status_idx": { - "name": "_blog_v_version_version__status_idx", - "columns": [ - "version__status" - ], - "isUnique": false - }, - "_blog_v_created_at_idx": { - "name": "_blog_v_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "_blog_v_updated_at_idx": { - "name": "_blog_v_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "_blog_v_snapshot_idx": { - "name": "_blog_v_snapshot_idx", - "columns": [ - "snapshot" - ], - "isUnique": false - }, - "_blog_v_published_locale_idx": { - "name": "_blog_v_published_locale_idx", - "columns": [ - "published_locale" - ], - "isUnique": false - }, - "_blog_v_latest_idx": { - "name": "_blog_v_latest_idx", - "columns": [ - "latest" - ], - "isUnique": false - } - }, - "foreignKeys": { - "_blog_v_parent_id_blog_id_fk": { - "name": "_blog_v_parent_id_blog_id_fk", - "tableFrom": "_blog_v", - "tableTo": "blog", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "_blog_v_version_hero_image_id_media_id_fk": { - "name": "_blog_v_version_hero_image_id_media_id_fk", - "tableFrom": "_blog_v", - "tableTo": "media", - "columnsFrom": [ - "version_hero_image_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_blog_v_locales": { - "name": "_blog_v_locales", - "columns": { - "version_title": { - "name": "version_title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_slug": { - "name": "version_slug", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_content": { - "name": "version_content", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{\"root\":{\"type\":\"root\",\"children\":[{\"type\":\"paragraph\",\"children\":[{\"type\":\"text\",\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"\",\"version\":1}],\"direction\":null,\"format\":\"\",\"indent\":0,\"textFormat\":0,\"textStyle\":\"\",\"version\":1}],\"direction\":null,\"format\":\"\",\"indent\":0,\"version\":1}}'" - }, - "version_excerpt": { - "name": "version_excerpt", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_meta_title": { - "name": "version_meta_title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_meta_description": { - "name": "version_meta_description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_meta_image_id": { - "name": "version_meta_image_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "_blog_v_version_version_slug_idx": { - "name": "_blog_v_version_version_slug_idx", - "columns": [ - "version_slug", - "_locale" - ], - "isUnique": false - }, - "_blog_v_version_meta_version_meta_image_idx": { - "name": "_blog_v_version_meta_version_meta_image_idx", - "columns": [ - "version_meta_image_id", - "_locale" - ], - "isUnique": false - }, - "_blog_v_locales_locale_parent_id_unique": { - "name": "_blog_v_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "_blog_v_locales_version_meta_image_id_media_id_fk": { - "name": "_blog_v_locales_version_meta_image_id_media_id_fk", - "tableFrom": "_blog_v_locales", - "tableTo": "media", - "columnsFrom": [ - "version_meta_image_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "_blog_v_locales_parent_id_fk": { - "name": "_blog_v_locales_parent_id_fk", - "tableFrom": "_blog_v_locales", - "tableTo": "_blog_v", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_blog_v_rels": { - "name": "_blog_v_rels", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "blog_categories_id": { - "name": "blog_categories_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "users_id": { - "name": "users_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "_blog_v_rels_order_idx": { - "name": "_blog_v_rels_order_idx", - "columns": [ - "order" - ], - "isUnique": false - }, - "_blog_v_rels_parent_idx": { - "name": "_blog_v_rels_parent_idx", - "columns": [ - "parent_id" - ], - "isUnique": false - }, - "_blog_v_rels_path_idx": { - "name": "_blog_v_rels_path_idx", - "columns": [ - "path" - ], - "isUnique": false - }, - "_blog_v_rels_blog_categories_id_idx": { - "name": "_blog_v_rels_blog_categories_id_idx", - "columns": [ - "blog_categories_id" - ], - "isUnique": false - }, - "_blog_v_rels_users_id_idx": { - "name": "_blog_v_rels_users_id_idx", - "columns": [ - "users_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "_blog_v_rels_parent_fk": { - "name": "_blog_v_rels_parent_fk", - "tableFrom": "_blog_v_rels", - "tableTo": "_blog_v", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "_blog_v_rels_blog_categories_fk": { - "name": "_blog_v_rels_blog_categories_fk", - "tableFrom": "_blog_v_rels", - "tableTo": "blog_categories", - "columnsFrom": [ - "blog_categories_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "_blog_v_rels_users_fk": { - "name": "_blog_v_rels_users_fk", - "tableFrom": "_blog_v_rels", - "tableTo": "users", - "columnsFrom": [ - "users_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "blog_categories": { - "name": "blog_categories", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "_status": { - "name": "_status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'draft'" - } - }, - "indexes": { - "blog_categories_updated_at_idx": { - "name": "blog_categories_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "blog_categories_created_at_idx": { - "name": "blog_categories_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "blog_categories__status_idx": { - "name": "blog_categories__status_idx", - "columns": [ - "_status" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "blog_categories_locales": { - "name": "blog_categories_locales", - "columns": { - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "blog_categories_slug_idx": { - "name": "blog_categories_slug_idx", - "columns": [ - "slug", - "_locale" - ], - "isUnique": true - }, - "blog_categories_locales_locale_parent_id_unique": { - "name": "blog_categories_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "blog_categories_locales_parent_id_fk": { - "name": "blog_categories_locales_parent_id_fk", - "tableFrom": "blog_categories_locales", - "tableTo": "blog_categories", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_blog_categories_v": { - "name": "_blog_categories_v", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_app": { - "name": "version_app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_updated_at": { - "name": "version_updated_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_created_at": { - "name": "version_created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version__status": { - "name": "version__status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'draft'" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "snapshot": { - "name": "snapshot", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "published_locale": { - "name": "published_locale", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "latest": { - "name": "latest", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "_blog_categories_v_parent_idx": { - "name": "_blog_categories_v_parent_idx", - "columns": [ - "parent_id" - ], - "isUnique": false - }, - "_blog_categories_v_version_version_updated_at_idx": { - "name": "_blog_categories_v_version_version_updated_at_idx", - "columns": [ - "version_updated_at" - ], - "isUnique": false - }, - "_blog_categories_v_version_version_created_at_idx": { - "name": "_blog_categories_v_version_version_created_at_idx", - "columns": [ - "version_created_at" - ], - "isUnique": false - }, - "_blog_categories_v_version_version__status_idx": { - "name": "_blog_categories_v_version_version__status_idx", - "columns": [ - "version__status" - ], - "isUnique": false - }, - "_blog_categories_v_created_at_idx": { - "name": "_blog_categories_v_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "_blog_categories_v_updated_at_idx": { - "name": "_blog_categories_v_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "_blog_categories_v_snapshot_idx": { - "name": "_blog_categories_v_snapshot_idx", - "columns": [ - "snapshot" - ], - "isUnique": false - }, - "_blog_categories_v_published_locale_idx": { - "name": "_blog_categories_v_published_locale_idx", - "columns": [ - "published_locale" - ], - "isUnique": false - }, - "_blog_categories_v_latest_idx": { - "name": "_blog_categories_v_latest_idx", - "columns": [ - "latest" - ], - "isUnique": false - } - }, - "foreignKeys": { - "_blog_categories_v_parent_id_blog_categories_id_fk": { - "name": "_blog_categories_v_parent_id_blog_categories_id_fk", - "tableFrom": "_blog_categories_v", - "tableTo": "blog_categories", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_blog_categories_v_locales": { - "name": "_blog_categories_v_locales", - "columns": { - "version_name": { - "name": "version_name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_slug": { - "name": "version_slug", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_description": { - "name": "version_description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "_blog_categories_v_version_version_slug_idx": { - "name": "_blog_categories_v_version_version_slug_idx", - "columns": [ - "version_slug", - "_locale" - ], - "isUnique": false - }, - "_blog_categories_v_locales_locale_parent_id_unique": { - "name": "_blog_categories_v_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "_blog_categories_v_locales_parent_id_fk": { - "name": "_blog_categories_v_locales_parent_id_fk", - "tableFrom": "_blog_categories_v_locales", - "tableTo": "_blog_categories_v", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "media": { - "name": "media", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "deleted_by": { - "name": "deleted_by", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "thumbnail_u_r_l": { - "name": "thumbnail_u_r_l", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "filename": { - "name": "filename", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mime_type": { - "name": "mime_type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "filesize": { - "name": "filesize", - "type": "numeric", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "width": { - "name": "width", - "type": "numeric", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "height": { - "name": "height", - "type": "numeric", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "focal_x": { - "name": "focal_x", - "type": "numeric", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "focal_y": { - "name": "focal_y", - "type": "numeric", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "media_updated_at_idx": { - "name": "media_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "media_created_at_idx": { - "name": "media_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "media_filename_idx": { - "name": "media_filename_idx", - "columns": [ - "filename" - ], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "media_locales": { - "name": "media_locales", - "columns": { - "alt": { - "name": "alt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "media_locales_locale_parent_id_unique": { - "name": "media_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "media_locales_parent_id_fk": { - "name": "media_locales_parent_id_fk", - "tableFrom": "media_locales", - "tableTo": "media", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "site_config_social_links": { - "name": "site_config_social_links", - "columns": { - "_order": { - "name": "_order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "platform": { - "name": "platform", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "site_config_social_links_order_idx": { - "name": "site_config_social_links_order_idx", - "columns": [ - "_order" - ], - "isUnique": false - }, - "site_config_social_links_parent_id_idx": { - "name": "site_config_social_links_parent_id_idx", - "columns": [ - "_parent_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "site_config_social_links_parent_id_fk": { - "name": "site_config_social_links_parent_id_fk", - "tableFrom": "site_config_social_links", - "tableTo": "site_config", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "site_config": { - "name": "site_config", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "logo_id": { - "name": "logo_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "favicon_id": { - "name": "favicon_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "contact_email": { - "name": "contact_email", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "contact_phone": { - "name": "contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "physical_address_zip": { - "name": "physical_address_zip", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "physical_address_location": { - "name": "physical_address_location", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "_status": { - "name": "_status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'draft'" - } - }, - "indexes": { - "site_config_logo_idx": { - "name": "site_config_logo_idx", - "columns": [ - "logo_id" - ], - "isUnique": false - }, - "site_config_favicon_idx": { - "name": "site_config_favicon_idx", - "columns": [ - "favicon_id" - ], - "isUnique": false - }, - "site_config_updated_at_idx": { - "name": "site_config_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "site_config_created_at_idx": { - "name": "site_config_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "site_config__status_idx": { - "name": "site_config__status_idx", - "columns": [ - "_status" - ], - "isUnique": false - } - }, - "foreignKeys": { - "site_config_logo_id_media_id_fk": { - "name": "site_config_logo_id_media_id_fk", - "tableFrom": "site_config", - "tableTo": "media", - "columnsFrom": [ - "logo_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "site_config_favicon_id_media_id_fk": { - "name": "site_config_favicon_id_media_id_fk", - "tableFrom": "site_config", - "tableTo": "media", - "columnsFrom": [ - "favicon_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "site_config_locales": { - "name": "site_config_locales", - "columns": { - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tagline": { - "name": "tagline", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "physical_address_address_line1": { - "name": "physical_address_address_line1", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "physical_address_address_line2": { - "name": "physical_address_address_line2", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "physical_address_city": { - "name": "physical_address_city", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "physical_address_state": { - "name": "physical_address_state", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "privacy_policy_page": { - "name": "privacy_policy_page", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "terms_of_services_page": { - "name": "terms_of_services_page", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "meta_title": { - "name": "meta_title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "meta_description": { - "name": "meta_description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "meta_image_id": { - "name": "meta_image_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "site_config_meta_meta_image_idx": { - "name": "site_config_meta_meta_image_idx", - "columns": [ - "meta_image_id", - "_locale" - ], - "isUnique": false - }, - "site_config_locales_locale_parent_id_unique": { - "name": "site_config_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "site_config_locales_meta_image_id_media_id_fk": { - "name": "site_config_locales_meta_image_id_media_id_fk", - "tableFrom": "site_config_locales", - "tableTo": "media", - "columnsFrom": [ - "meta_image_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "site_config_locales_parent_id_fk": { - "name": "site_config_locales_parent_id_fk", - "tableFrom": "site_config_locales", - "tableTo": "site_config", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_site_config_v_version_social_links": { - "name": "_site_config_v_version_social_links", - "columns": { - "_order": { - "name": "_order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "platform": { - "name": "platform", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "_uuid": { - "name": "_uuid", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "_site_config_v_version_social_links_order_idx": { - "name": "_site_config_v_version_social_links_order_idx", - "columns": [ - "_order" - ], - "isUnique": false - }, - "_site_config_v_version_social_links_parent_id_idx": { - "name": "_site_config_v_version_social_links_parent_id_idx", - "columns": [ - "_parent_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "_site_config_v_version_social_links_parent_id_fk": { - "name": "_site_config_v_version_social_links_parent_id_fk", - "tableFrom": "_site_config_v_version_social_links", - "tableTo": "_site_config_v", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_site_config_v": { - "name": "_site_config_v", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_app": { - "name": "version_app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_logo_id": { - "name": "version_logo_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_favicon_id": { - "name": "version_favicon_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_contact_email": { - "name": "version_contact_email", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_contact_phone": { - "name": "version_contact_phone", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_physical_address_zip": { - "name": "version_physical_address_zip", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_physical_address_location": { - "name": "version_physical_address_location", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_updated_at": { - "name": "version_updated_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_created_at": { - "name": "version_created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version__status": { - "name": "version__status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'draft'" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "snapshot": { - "name": "snapshot", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "published_locale": { - "name": "published_locale", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "latest": { - "name": "latest", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "_site_config_v_parent_idx": { - "name": "_site_config_v_parent_idx", - "columns": [ - "parent_id" - ], - "isUnique": false - }, - "_site_config_v_version_version_logo_idx": { - "name": "_site_config_v_version_version_logo_idx", - "columns": [ - "version_logo_id" - ], - "isUnique": false - }, - "_site_config_v_version_version_favicon_idx": { - "name": "_site_config_v_version_version_favicon_idx", - "columns": [ - "version_favicon_id" - ], - "isUnique": false - }, - "_site_config_v_version_version_updated_at_idx": { - "name": "_site_config_v_version_version_updated_at_idx", - "columns": [ - "version_updated_at" - ], - "isUnique": false - }, - "_site_config_v_version_version_created_at_idx": { - "name": "_site_config_v_version_version_created_at_idx", - "columns": [ - "version_created_at" - ], - "isUnique": false - }, - "_site_config_v_version_version__status_idx": { - "name": "_site_config_v_version_version__status_idx", - "columns": [ - "version__status" - ], - "isUnique": false - }, - "_site_config_v_created_at_idx": { - "name": "_site_config_v_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "_site_config_v_updated_at_idx": { - "name": "_site_config_v_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "_site_config_v_snapshot_idx": { - "name": "_site_config_v_snapshot_idx", - "columns": [ - "snapshot" - ], - "isUnique": false - }, - "_site_config_v_published_locale_idx": { - "name": "_site_config_v_published_locale_idx", - "columns": [ - "published_locale" - ], - "isUnique": false - }, - "_site_config_v_latest_idx": { - "name": "_site_config_v_latest_idx", - "columns": [ - "latest" - ], - "isUnique": false - } - }, - "foreignKeys": { - "_site_config_v_parent_id_site_config_id_fk": { - "name": "_site_config_v_parent_id_site_config_id_fk", - "tableFrom": "_site_config_v", - "tableTo": "site_config", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "_site_config_v_version_logo_id_media_id_fk": { - "name": "_site_config_v_version_logo_id_media_id_fk", - "tableFrom": "_site_config_v", - "tableTo": "media", - "columnsFrom": [ - "version_logo_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "_site_config_v_version_favicon_id_media_id_fk": { - "name": "_site_config_v_version_favicon_id_media_id_fk", - "tableFrom": "_site_config_v", - "tableTo": "media", - "columnsFrom": [ - "version_favicon_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_site_config_v_locales": { - "name": "_site_config_v_locales", - "columns": { - "version_name": { - "name": "version_name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_tagline": { - "name": "version_tagline", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_physical_address_address_line1": { - "name": "version_physical_address_address_line1", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_physical_address_address_line2": { - "name": "version_physical_address_address_line2", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_physical_address_city": { - "name": "version_physical_address_city", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_physical_address_state": { - "name": "version_physical_address_state", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_privacy_policy_page": { - "name": "version_privacy_policy_page", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_terms_of_services_page": { - "name": "version_terms_of_services_page", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_meta_title": { - "name": "version_meta_title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_meta_description": { - "name": "version_meta_description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_meta_image_id": { - "name": "version_meta_image_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "_site_config_v_version_meta_version_meta_image_idx": { - "name": "_site_config_v_version_meta_version_meta_image_idx", - "columns": [ - "version_meta_image_id", - "_locale" - ], - "isUnique": false - }, - "_site_config_v_locales_locale_parent_id_unique": { - "name": "_site_config_v_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "_site_config_v_locales_version_meta_image_id_media_id_fk": { - "name": "_site_config_v_locales_version_meta_image_id_media_id_fk", - "tableFrom": "_site_config_v_locales", - "tableTo": "media", - "columnsFrom": [ - "version_meta_image_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "_site_config_v_locales_parent_id_fk": { - "name": "_site_config_v_locales_parent_id_fk", - "tableFrom": "_site_config_v_locales", - "tableTo": "_site_config_v", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "form_submissions": { - "name": "form_submissions", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "form_name": { - "name": "form_name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "page_url": { - "name": "page_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "form_data": { - "name": "form_data", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "additional_data": { - "name": "additional_data", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - } - }, - "indexes": { - "form_submissions_updated_at_idx": { - "name": "form_submissions_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "form_submissions_created_at_idx": { - "name": "form_submissions_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "menus_items_children": { - "name": "menus_items_children", - "columns": { - "_order": { - "name": "_order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'page'" - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "open_in_new_tab": { - "name": "open_in_new_tab", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "menus_items_children_order_idx": { - "name": "menus_items_children_order_idx", - "columns": [ - "_order" - ], - "isUnique": false - }, - "menus_items_children_parent_id_idx": { - "name": "menus_items_children_parent_id_idx", - "columns": [ - "_parent_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "menus_items_children_parent_id_fk": { - "name": "menus_items_children_parent_id_fk", - "tableFrom": "menus_items_children", - "tableTo": "menus_items", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "menus_items_children_locales": { - "name": "menus_items_children_locales", - "columns": { - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "menus_items_children_locales_locale_parent_id_unique": { - "name": "menus_items_children_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "menus_items_children_locales_parent_id_fk": { - "name": "menus_items_children_locales_parent_id_fk", - "tableFrom": "menus_items_children_locales", - "tableTo": "menus_items_children", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "menus_items": { - "name": "menus_items", - "columns": { - "_order": { - "name": "_order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'page'" - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "open_in_new_tab": { - "name": "open_in_new_tab", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "menus_items_order_idx": { - "name": "menus_items_order_idx", - "columns": [ - "_order" - ], - "isUnique": false - }, - "menus_items_parent_id_idx": { - "name": "menus_items_parent_id_idx", - "columns": [ - "_parent_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "menus_items_parent_id_fk": { - "name": "menus_items_parent_id_fk", - "tableFrom": "menus_items", - "tableTo": "menus", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "menus_items_locales": { - "name": "menus_items_locales", - "columns": { - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "menus_items_locales_locale_parent_id_unique": { - "name": "menus_items_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "menus_items_locales_parent_id_fk": { - "name": "menus_items_locales_parent_id_fk", - "tableFrom": "menus_items_locales", - "tableTo": "menus_items", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "menus": { - "name": "menus", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "app": { - "name": "app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "_status": { - "name": "_status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'draft'" - } - }, - "indexes": { - "menus_updated_at_idx": { - "name": "menus_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "menus_created_at_idx": { - "name": "menus_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "menus__status_idx": { - "name": "menus__status_idx", - "columns": [ - "_status" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_menus_v_version_items_children": { - "name": "_menus_v_version_items_children", - "columns": { - "_order": { - "name": "_order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'page'" - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "open_in_new_tab": { - "name": "open_in_new_tab", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "_uuid": { - "name": "_uuid", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "_menus_v_version_items_children_order_idx": { - "name": "_menus_v_version_items_children_order_idx", - "columns": [ - "_order" - ], - "isUnique": false - }, - "_menus_v_version_items_children_parent_id_idx": { - "name": "_menus_v_version_items_children_parent_id_idx", - "columns": [ - "_parent_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "_menus_v_version_items_children_parent_id_fk": { - "name": "_menus_v_version_items_children_parent_id_fk", - "tableFrom": "_menus_v_version_items_children", - "tableTo": "_menus_v_version_items", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_menus_v_version_items_children_locales": { - "name": "_menus_v_version_items_children_locales", - "columns": { - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "_menus_v_version_items_children_locales_locale_parent_id_uni": { - "name": "_menus_v_version_items_children_locales_locale_parent_id_uni", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "_menus_v_version_items_children_locales_parent_id_fk": { - "name": "_menus_v_version_items_children_locales_parent_id_fk", - "tableFrom": "_menus_v_version_items_children_locales", - "tableTo": "_menus_v_version_items_children", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_menus_v_version_items": { - "name": "_menus_v_version_items", - "columns": { - "_order": { - "name": "_order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'page'" - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "open_in_new_tab": { - "name": "open_in_new_tab", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "_uuid": { - "name": "_uuid", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "_menus_v_version_items_order_idx": { - "name": "_menus_v_version_items_order_idx", - "columns": [ - "_order" - ], - "isUnique": false - }, - "_menus_v_version_items_parent_id_idx": { - "name": "_menus_v_version_items_parent_id_idx", - "columns": [ - "_parent_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "_menus_v_version_items_parent_id_fk": { - "name": "_menus_v_version_items_parent_id_fk", - "tableFrom": "_menus_v_version_items", - "tableTo": "_menus_v", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_menus_v_version_items_locales": { - "name": "_menus_v_version_items_locales", - "columns": { - "label": { - "name": "label", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "_locale": { - "name": "_locale", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "_parent_id": { - "name": "_parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "_menus_v_version_items_locales_locale_parent_id_unique": { - "name": "_menus_v_version_items_locales_locale_parent_id_unique", - "columns": [ - "_locale", - "_parent_id" - ], - "isUnique": true - } - }, - "foreignKeys": { - "_menus_v_version_items_locales_parent_id_fk": { - "name": "_menus_v_version_items_locales_parent_id_fk", - "tableFrom": "_menus_v_version_items_locales", - "tableTo": "_menus_v_version_items", - "columnsFrom": [ - "_parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "_menus_v": { - "name": "_menus_v", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_app": { - "name": "version_app", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_name": { - "name": "version_name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_description": { - "name": "version_description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_updated_at": { - "name": "version_updated_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version_created_at": { - "name": "version_created_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "version__status": { - "name": "version__status", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'draft'" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "snapshot": { - "name": "snapshot", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "published_locale": { - "name": "published_locale", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "latest": { - "name": "latest", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "_menus_v_parent_idx": { - "name": "_menus_v_parent_idx", - "columns": [ - "parent_id" - ], - "isUnique": false - }, - "_menus_v_version_version_updated_at_idx": { - "name": "_menus_v_version_version_updated_at_idx", - "columns": [ - "version_updated_at" - ], - "isUnique": false - }, - "_menus_v_version_version_created_at_idx": { - "name": "_menus_v_version_version_created_at_idx", - "columns": [ - "version_created_at" - ], - "isUnique": false - }, - "_menus_v_version_version__status_idx": { - "name": "_menus_v_version_version__status_idx", - "columns": [ - "version__status" - ], - "isUnique": false - }, - "_menus_v_created_at_idx": { - "name": "_menus_v_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - }, - "_menus_v_updated_at_idx": { - "name": "_menus_v_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "_menus_v_snapshot_idx": { - "name": "_menus_v_snapshot_idx", - "columns": [ - "snapshot" - ], - "isUnique": false - }, - "_menus_v_published_locale_idx": { - "name": "_menus_v_published_locale_idx", - "columns": [ - "published_locale" - ], - "isUnique": false - }, - "_menus_v_latest_idx": { - "name": "_menus_v_latest_idx", - "columns": [ - "latest" - ], - "isUnique": false - } - }, - "foreignKeys": { - "_menus_v_parent_id_menus_id_fk": { - "name": "_menus_v_parent_id_menus_id_fk", - "tableFrom": "_menus_v", - "tableTo": "menus", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "payload_kv": { - "name": "payload_kv", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "data": { - "name": "data", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "payload_kv_key_idx": { - "name": "payload_kv_key_idx", - "columns": [ - "key" - ], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "payload_locked_documents": { - "name": "payload_locked_documents", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "global_slug": { - "name": "global_slug", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - } - }, - "indexes": { - "payload_locked_documents_global_slug_idx": { - "name": "payload_locked_documents_global_slug_idx", - "columns": [ - "global_slug" - ], - "isUnique": false - }, - "payload_locked_documents_updated_at_idx": { - "name": "payload_locked_documents_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "payload_locked_documents_created_at_idx": { - "name": "payload_locked_documents_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "payload_locked_documents_rels": { - "name": "payload_locked_documents_rels", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "users_id": { - "name": "users_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "blog_id": { - "name": "blog_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "blog_categories_id": { - "name": "blog_categories_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "media_id": { - "name": "media_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "site_config_id": { - "name": "site_config_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "form_submissions_id": { - "name": "form_submissions_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "menus_id": { - "name": "menus_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "payload_locked_documents_rels_order_idx": { - "name": "payload_locked_documents_rels_order_idx", - "columns": [ - "order" - ], - "isUnique": false - }, - "payload_locked_documents_rels_parent_idx": { - "name": "payload_locked_documents_rels_parent_idx", - "columns": [ - "parent_id" - ], - "isUnique": false - }, - "payload_locked_documents_rels_path_idx": { - "name": "payload_locked_documents_rels_path_idx", - "columns": [ - "path" - ], - "isUnique": false - }, - "payload_locked_documents_rels_users_id_idx": { - "name": "payload_locked_documents_rels_users_id_idx", - "columns": [ - "users_id" - ], - "isUnique": false - }, - "payload_locked_documents_rels_blog_id_idx": { - "name": "payload_locked_documents_rels_blog_id_idx", - "columns": [ - "blog_id" - ], - "isUnique": false - }, - "payload_locked_documents_rels_blog_categories_id_idx": { - "name": "payload_locked_documents_rels_blog_categories_id_idx", - "columns": [ - "blog_categories_id" - ], - "isUnique": false - }, - "payload_locked_documents_rels_media_id_idx": { - "name": "payload_locked_documents_rels_media_id_idx", - "columns": [ - "media_id" - ], - "isUnique": false - }, - "payload_locked_documents_rels_site_config_id_idx": { - "name": "payload_locked_documents_rels_site_config_id_idx", - "columns": [ - "site_config_id" - ], - "isUnique": false - }, - "payload_locked_documents_rels_form_submissions_id_idx": { - "name": "payload_locked_documents_rels_form_submissions_id_idx", - "columns": [ - "form_submissions_id" - ], - "isUnique": false - }, - "payload_locked_documents_rels_menus_id_idx": { - "name": "payload_locked_documents_rels_menus_id_idx", - "columns": [ - "menus_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "payload_locked_documents_rels_parent_fk": { - "name": "payload_locked_documents_rels_parent_fk", - "tableFrom": "payload_locked_documents_rels", - "tableTo": "payload_locked_documents", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "payload_locked_documents_rels_users_fk": { - "name": "payload_locked_documents_rels_users_fk", - "tableFrom": "payload_locked_documents_rels", - "tableTo": "users", - "columnsFrom": [ - "users_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "payload_locked_documents_rels_blog_fk": { - "name": "payload_locked_documents_rels_blog_fk", - "tableFrom": "payload_locked_documents_rels", - "tableTo": "blog", - "columnsFrom": [ - "blog_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "payload_locked_documents_rels_blog_categories_fk": { - "name": "payload_locked_documents_rels_blog_categories_fk", - "tableFrom": "payload_locked_documents_rels", - "tableTo": "blog_categories", - "columnsFrom": [ - "blog_categories_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "payload_locked_documents_rels_media_fk": { - "name": "payload_locked_documents_rels_media_fk", - "tableFrom": "payload_locked_documents_rels", - "tableTo": "media", - "columnsFrom": [ - "media_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "payload_locked_documents_rels_site_config_fk": { - "name": "payload_locked_documents_rels_site_config_fk", - "tableFrom": "payload_locked_documents_rels", - "tableTo": "site_config", - "columnsFrom": [ - "site_config_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "payload_locked_documents_rels_form_submissions_fk": { - "name": "payload_locked_documents_rels_form_submissions_fk", - "tableFrom": "payload_locked_documents_rels", - "tableTo": "form_submissions", - "columnsFrom": [ - "form_submissions_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "payload_locked_documents_rels_menus_fk": { - "name": "payload_locked_documents_rels_menus_fk", - "tableFrom": "payload_locked_documents_rels", - "tableTo": "menus", - "columnsFrom": [ - "menus_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "payload_preferences": { - "name": "payload_preferences", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - } - }, - "indexes": { - "payload_preferences_key_idx": { - "name": "payload_preferences_key_idx", - "columns": [ - "key" - ], - "isUnique": false - }, - "payload_preferences_updated_at_idx": { - "name": "payload_preferences_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "payload_preferences_created_at_idx": { - "name": "payload_preferences_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "payload_preferences_rels": { - "name": "payload_preferences_rels", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text(36)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "path": { - "name": "path", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "users_id": { - "name": "users_id", - "type": "text(36)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "payload_preferences_rels_order_idx": { - "name": "payload_preferences_rels_order_idx", - "columns": [ - "order" - ], - "isUnique": false - }, - "payload_preferences_rels_parent_idx": { - "name": "payload_preferences_rels_parent_idx", - "columns": [ - "parent_id" - ], - "isUnique": false - }, - "payload_preferences_rels_path_idx": { - "name": "payload_preferences_rels_path_idx", - "columns": [ - "path" - ], - "isUnique": false - }, - "payload_preferences_rels_users_id_idx": { - "name": "payload_preferences_rels_users_id_idx", - "columns": [ - "users_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "payload_preferences_rels_parent_fk": { - "name": "payload_preferences_rels_parent_fk", - "tableFrom": "payload_preferences_rels", - "tableTo": "payload_preferences", - "columnsFrom": [ - "parent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "payload_preferences_rels_users_fk": { - "name": "payload_preferences_rels_users_fk", - "tableFrom": "payload_preferences_rels", - "tableTo": "users", - "columnsFrom": [ - "users_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "payload_migrations": { - "name": "payload_migrations", - "columns": { - "id": { - "name": "id", - "type": "text(36)", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "batch": { - "name": "batch", - "type": "numeric", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" - } - }, - "indexes": { - "payload_migrations_updated_at_idx": { - "name": "payload_migrations_updated_at_idx", - "columns": [ - "updated_at" - ], - "isUnique": false - }, - "payload_migrations_created_at_idx": { - "name": "payload_migrations_created_at_idx", - "columns": [ - "created_at" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - }, - "id": "17015411-10be-4111-9c84-5b83a421acb9", - "prevId": "00000000-0000-0000-0000-000000000000" -} \ No newline at end of file diff --git a/src/migrations/20260802_002150_media_prefix.ts b/src/migrations/20260802_002150_media_prefix.ts deleted file mode 100644 index 326a782..0000000 --- a/src/migrations/20260802_002150_media_prefix.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-sqlite' - -export async function up({ db, payload, req }: MigrateUpArgs): Promise { - try { - await db.run(sql`ALTER TABLE \`media\` ADD \`prefix\` text;`) - } catch (error) { - if (error instanceof Error && error.message.includes('duplicate column name: prefix')) { - return - } - - throw error - } -} - -export async function down({ db, payload, req }: MigrateDownArgs): Promise { - await db.run(sql`ALTER TABLE \`media\` DROP COLUMN \`prefix\`;`) -} diff --git a/src/migrations/20260802_002150_media_prefix.json b/src/migrations/20260802_094413_initial.json similarity index 99% rename from src/migrations/20260802_002150_media_prefix.json rename to src/migrations/20260802_094413_initial.json index aa77915..46eb247 100644 --- a/src/migrations/20260802_002150_media_prefix.json +++ b/src/migrations/20260802_094413_initial.json @@ -7021,6 +7021,6 @@ "internal": { "indexes": {} }, - "id": "237d52dd-1a35-4b29-a1ca-79bb809a8d20", + "id": "af3746aa-04f8-4378-aeee-4d1efb570876", "prevId": "00000000-0000-0000-0000-000000000000" } \ No newline at end of file diff --git a/src/migrations/20260724_153838_initial.ts b/src/migrations/20260802_094413_initial.ts similarity index 99% rename from src/migrations/20260724_153838_initial.ts rename to src/migrations/20260802_094413_initial.ts index 1b4a986..2dcaee5 100644 --- a/src/migrations/20260724_153838_initial.ts +++ b/src/migrations/20260802_094413_initial.ts @@ -624,6 +624,7 @@ export async function up({ db, payload, req }: MigrateUpArgs): Promise { \`app\` text NOT NULL, \`deleted_at\` text, \`deleted_by\` text, + \`prefix\` text, \`updated_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL, \`created_at\` text DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) NOT NULL, \`url\` text, diff --git a/src/migrations/index.ts b/src/migrations/index.ts index 072acb4..53f006e 100644 --- a/src/migrations/index.ts +++ b/src/migrations/index.ts @@ -1,15 +1,9 @@ -import * as migration_20260724_153838_initial from './20260724_153838_initial'; -import * as migration_20260802_002150_media_prefix from './20260802_002150_media_prefix'; +import * as migration_20260802_094413_initial from './20260802_094413_initial'; export const migrations = [ { - up: migration_20260724_153838_initial.up, - down: migration_20260724_153838_initial.down, - name: '20260724_153838_initial', - }, - { - up: migration_20260802_002150_media_prefix.up, - down: migration_20260802_002150_media_prefix.down, - name: '20260802_002150_media_prefix' + up: migration_20260802_094413_initial.up, + down: migration_20260802_094413_initial.down, + name: '20260802_094413_initial' }, ]; From 0df60b3ebde11a793db0f320121adf40cf454e47 Mon Sep 17 00:00:00 2001 From: Suraj Air Date: Sun, 2 Aug 2026 15:35:52 +0530 Subject: [PATCH 7/8] chore: updated ai models --- package.json | 1 + pnpm-lock.yaml | 44 ++++++++++++++- src/chaibuilder.config.ts | 114 +++++++++++++++++++++++++++++--------- 3 files changed, 131 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 19beef9..510e46c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "dependencies": { "@libsql/client": "^0.17.4", "@next/third-parties": "^16.2.10", + "@openrouter/ai-sdk-provider": "^3.0.0", "@payloadcms/db-sqlite": "3.85.1", "@payloadcms/next": "3.85.1", "@payloadcms/plugin-seo": "3.85.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 750a161..32facec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,6 +22,9 @@ importers: '@next/third-parties': specifier: ^16.2.10 version: 16.2.10(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(react@19.2.6) + '@openrouter/ai-sdk-provider': + specifier: ^3.0.0 + version: 3.0.0(ai@6.0.219(zod@4.4.3))(zod@4.4.3) '@payloadcms/db-sqlite': specifier: 3.85.1 version: 3.85.1(@opentelemetry/api@1.9.1)(payload@3.85.1(graphql@16.14.2)(typescript@5.7.3))(supports-color@8.1.1) @@ -48,7 +51,7 @@ importers: version: 0.5.11(tailwindcss@4.3.3) chaipro: specifier: ^0.3.0 - version: 0.3.0(1b462b3377e3eb2a68b9fbf2b0a240be) + version: 0.3.0(a4eb67664d5a3a6e7045729bc54d7dd3) cnfast: specifier: ^0.0.8 version: 0.0.8 @@ -1851,6 +1854,13 @@ packages: resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} engines: {node: '>=12.4.0'} + '@openrouter/ai-sdk-provider@3.0.0': + resolution: {integrity: sha512-m9XTSWoODH2RM5OsZpaGiN7QRR8cdP5paBWq699Tu3JVmGPBKT8xF8XwV0ZBVVsjikD/JgWfak4VSsTR4wAVbg==} + engines: {node: '>=22'} + peerDependencies: + ai: ^7.0.0 + zod: ^3.25.76 || ^4.1.8 + '@opentelemetry/api@1.9.1': resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==} engines: {node: '>=8.0.0'} @@ -7352,6 +7362,13 @@ snapshots: '@vercel/oidc': 3.2.0 zod: 4.3.5 + '@ai-sdk/gateway@3.0.143(zod@4.4.3)': + dependencies: + '@ai-sdk/provider': 3.0.13 + '@ai-sdk/provider-utils': 4.0.35(zod@4.4.3) + '@vercel/oidc': 3.2.0 + zod: 4.4.3 + '@ai-sdk/provider-utils@4.0.35(zod@4.3.5)': dependencies: '@ai-sdk/provider': 3.0.13 @@ -7359,6 +7376,13 @@ snapshots: eventsource-parser: 3.1.0 zod: 4.3.5 + '@ai-sdk/provider-utils@4.0.35(zod@4.4.3)': + dependencies: + '@ai-sdk/provider': 3.0.13 + '@standard-schema/spec': 1.1.0 + eventsource-parser: 3.1.0 + zod: 4.4.3 + '@ai-sdk/provider@3.0.13': dependencies: json-schema: 0.4.0 @@ -8845,6 +8869,11 @@ snapshots: '@nolyfill/is-core-module@1.0.39': {} + '@openrouter/ai-sdk-provider@3.0.0(ai@6.0.219(zod@4.4.3))(zod@4.4.3)': + dependencies: + ai: 6.0.219(zod@4.4.3) + zod: 4.4.3 + '@opentelemetry/api@1.9.1': {} '@payloadcms/db-sqlite@3.85.1(@opentelemetry/api@1.9.1)(payload@3.85.1(graphql@16.14.2)(typescript@5.7.3))(supports-color@8.1.1)': @@ -10777,6 +10806,14 @@ snapshots: '@opentelemetry/api': 1.9.1 zod: 4.3.5 + ai@6.0.219(zod@4.4.3): + dependencies: + '@ai-sdk/gateway': 3.0.143(zod@4.4.3) + '@ai-sdk/provider': 3.0.13 + '@ai-sdk/provider-utils': 4.0.35(zod@4.4.3) + '@opentelemetry/api': 1.9.1 + zod: 4.4.3 + ajv-formats@2.1.1(ajv@8.20.0): optionalDependencies: ajv: 8.20.0 @@ -11003,7 +11040,7 @@ snapshots: chai@6.2.2: {} - chaipro@0.3.0(1b462b3377e3eb2a68b9fbf2b0a240be): + chaipro@0.3.0(a4eb67664d5a3a6e7045729bc54d7dd3): dependencies: '@ai-sdk/react': 3.0.221(react@19.2.6)(zod@4.3.5) '@floating-ui/dom': 1.7.4 @@ -11091,10 +11128,11 @@ snapshots: optionalDependencies: '@libsql/client': 0.17.4 '@next/third-parties': 16.2.10(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(react@19.2.6) + '@openrouter/ai-sdk-provider': 3.0.0(ai@6.0.219(zod@4.4.3))(zod@4.4.3) '@payloadcms/richtext-lexical': 3.85.1(@faceless-ui/modal@3.0.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(@faceless-ui/scroll-info@2.0.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(@payloadcms/next@3.85.1(@types/react@19.2.14)(graphql@16.14.2)(monaco-editor@0.55.1)(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(payload@3.85.1(graphql@16.14.2)(typescript@5.7.3))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(supports-color@8.1.1)(typescript@5.7.3))(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(payload@3.85.1(graphql@16.14.2)(typescript@5.7.3))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.7.3)(yjs@13.6.31) '@payloadcms/ui': 3.85.1(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(payload@3.85.1(graphql@16.14.2)(typescript@5.7.3))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.7.3) '@tailwindcss/postcss': 4.3.3 - ai: 6.0.219(zod@4.3.5) + ai: 6.0.219(zod@4.4.3) drizzle-orm: 0.45.2(@libsql/client@0.17.4)(@opentelemetry/api@1.9.1) next: 16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4) payload: 3.85.1(graphql@16.14.2)(typescript@5.7.3) diff --git a/src/chaibuilder.config.ts b/src/chaibuilder.config.ts index 0ceac36..b7909c8 100644 --- a/src/chaibuilder.config.ts +++ b/src/chaibuilder.config.ts @@ -18,6 +18,94 @@ import { revisionsPlugin } from 'chaipro/plugins/revisions/server' import { trashPlugin } from 'chaipro/plugins/trash/server' import type { ResolvedChaiBuilderServerConfig } from 'chaipro/types' +/** + * The eight models the editor offers, picked for web design and front-end work. + * Most take images too, so a screenshot or mockup can be attached to the prompt; + * the text-only ones say so via `allowedFileTypes: []`. Each model is described + * once and mapped to the provider's own slug — Vercel AI Gateway and OpenRouter + * disagree on some vendor prefixes (`xai` vs `x-ai`, `zai` vs `z-ai`), so the id + * has to follow whichever provider is wired up. + */ +const AI_MODELS = [ + { + gateway: 'anthropic/claude-opus-5', + openrouter: 'anthropic/claude-opus-5', + name: 'Claude Opus 5', + provider: 'anthropic', + multiplier: 5, + description: '5x Credits', + }, + { + gateway: 'anthropic/claude-sonnet-5', + openrouter: 'anthropic/claude-sonnet-5', + name: 'Claude Sonnet 5', + provider: 'anthropic', + multiplier: 3, + description: '3x Credits', + }, + { + gateway: 'openai/gpt-5.5', + openrouter: 'openai/gpt-5.5', + name: 'GPT-5.5', + provider: 'openai', + multiplier: 5, + description: '5x Credits', + }, + { + gateway: 'google/gemini-3.6-flash', + openrouter: 'google/gemini-3.6-flash', + name: 'Gemini 3.6 Flash', + provider: 'google', + multiplier: 2, + description: '2x Credits', + }, + { + gateway: 'xai/grok-4.5', + openrouter: 'x-ai/grok-4.5', + name: 'Grok 4.5', + provider: 'xai', + multiplier: 3, + description: '3x Credits', + }, + { + gateway: 'moonshotai/kimi-k3', + openrouter: 'moonshotai/kimi-k3', + name: 'Kimi K3', + provider: 'moonshotai', + multiplier: 3, + description: '3x Credits', + }, + { + gateway: 'zai/glm-5.2', + openrouter: 'z-ai/glm-5.2', + name: 'GLM 5.2', + provider: 'zai', + multiplier: 1, + description: '1x Credits', + // text-only model — it cannot read images/files + allowedFileTypes: [], + }, + { + gateway: 'deepseek/deepseek-v4-pro', + openrouter: 'deepseek/deepseek-v4-pro', + name: 'DeepSeek V4 Pro', + provider: 'deepseek', + multiplier: 1, + description: '1x Credits', + // text-only model — it cannot read images/files + allowedFileTypes: [], + }, +] + +/** + * Mirrors chaipro's own provider resolution: an `OPENROUTER_API_KEY` wins, + * otherwise requests go through the Vercel AI Gateway (`AI_GATEWAY_API_KEY`). + */ +const aiModels = AI_MODELS.map(({ gateway, openrouter, ...model }) => ({ + ...model, + id: process.env.OPENROUTER_API_KEY ? openrouter : gateway, +})) + const chaiConfig: Readonly = buildChaiBuilderConfig({ payloadConfig: config, db: createLibsqlDB({ @@ -37,31 +125,7 @@ const chaiConfig: Readonly = buildChaiBuilderCo animationPlugin(), ], ai: { - models: [ - { - id: 'zai/glm-5.2', // for openrouter, the id is z-ai/glm-5.2 - name: 'GLM 5.2', - provider: 'zai', - multiplier: 3, - description: '3x Credits', - // text-only model — it cannot read images/files - allowedFileTypes: [], - }, - { - id: 'google/gemini-3.5-flash', - name: 'Gemini 3.5 Flash', - provider: 'google', - multiplier: 3, - description: '3x Credits', - }, - { - id: 'google/gemini-3-flash', - name: 'Gemini 3 Flash', - provider: 'google', - multiplier: 1, - description: '1x Credits', - }, - ], + models: aiModels, }, globalDataProvider: asChaiBuilderGlobalProvider({ slug: 'site-config' }), pageTypes: [ From 2f9dabdd46c98500c7605bc3c11de95e563978a7 Mon Sep 17 00:00:00 2001 From: Suraj Air Date: Sun, 2 Aug 2026 16:05:10 +0530 Subject: [PATCH 8/8] fix: downgrade openrouter sdk --- package.json | 2 +- pnpm-lock.yaml | 22 +++++++++++----------- src/chaibuilder.config.ts | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 510e46c..5382268 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dependencies": { "@libsql/client": "^0.17.4", "@next/third-parties": "^16.2.10", - "@openrouter/ai-sdk-provider": "^3.0.0", + "@openrouter/ai-sdk-provider": "^2.10.0", "@payloadcms/db-sqlite": "3.85.1", "@payloadcms/next": "3.85.1", "@payloadcms/plugin-seo": "3.85.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32facec..ce747c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,8 +23,8 @@ importers: specifier: ^16.2.10 version: 16.2.10(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(react@19.2.6) '@openrouter/ai-sdk-provider': - specifier: ^3.0.0 - version: 3.0.0(ai@6.0.219(zod@4.4.3))(zod@4.4.3) + specifier: ^2.10.0 + version: 2.10.0(ai@6.0.219(zod@4.4.3))(zod@4.4.3) '@payloadcms/db-sqlite': specifier: 3.85.1 version: 3.85.1(@opentelemetry/api@1.9.1)(payload@3.85.1(graphql@16.14.2)(typescript@5.7.3))(supports-color@8.1.1) @@ -51,7 +51,7 @@ importers: version: 0.5.11(tailwindcss@4.3.3) chaipro: specifier: ^0.3.0 - version: 0.3.0(a4eb67664d5a3a6e7045729bc54d7dd3) + version: 0.3.0(0a9275dfd3343f1dea1ef8265e506048) cnfast: specifier: ^0.0.8 version: 0.0.8 @@ -1854,12 +1854,12 @@ packages: resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} engines: {node: '>=12.4.0'} - '@openrouter/ai-sdk-provider@3.0.0': - resolution: {integrity: sha512-m9XTSWoODH2RM5OsZpaGiN7QRR8cdP5paBWq699Tu3JVmGPBKT8xF8XwV0ZBVVsjikD/JgWfak4VSsTR4wAVbg==} - engines: {node: '>=22'} + '@openrouter/ai-sdk-provider@2.10.0': + resolution: {integrity: sha512-FMsAEjLUt5pWuRE2LDC/LCvVrFjLlrEzUITH5+5SZtfq7KZ2wrOHjQVxzz92sju8S9ltpzW87CLW8/b0oBXVCw==} + engines: {node: '>=18'} peerDependencies: - ai: ^7.0.0 - zod: ^3.25.76 || ^4.1.8 + ai: ^6.0.0 + zod: ^3.25.0 || ^4.0.0 '@opentelemetry/api@1.9.1': resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==} @@ -8869,7 +8869,7 @@ snapshots: '@nolyfill/is-core-module@1.0.39': {} - '@openrouter/ai-sdk-provider@3.0.0(ai@6.0.219(zod@4.4.3))(zod@4.4.3)': + '@openrouter/ai-sdk-provider@2.10.0(ai@6.0.219(zod@4.4.3))(zod@4.4.3)': dependencies: ai: 6.0.219(zod@4.4.3) zod: 4.4.3 @@ -11040,7 +11040,7 @@ snapshots: chai@6.2.2: {} - chaipro@0.3.0(a4eb67664d5a3a6e7045729bc54d7dd3): + chaipro@0.3.0(0a9275dfd3343f1dea1ef8265e506048): dependencies: '@ai-sdk/react': 3.0.221(react@19.2.6)(zod@4.3.5) '@floating-ui/dom': 1.7.4 @@ -11128,7 +11128,7 @@ snapshots: optionalDependencies: '@libsql/client': 0.17.4 '@next/third-parties': 16.2.10(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(react@19.2.6) - '@openrouter/ai-sdk-provider': 3.0.0(ai@6.0.219(zod@4.4.3))(zod@4.4.3) + '@openrouter/ai-sdk-provider': 2.10.0(ai@6.0.219(zod@4.4.3))(zod@4.4.3) '@payloadcms/richtext-lexical': 3.85.1(@faceless-ui/modal@3.0.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(@faceless-ui/scroll-info@2.0.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(@payloadcms/next@3.85.1(@types/react@19.2.14)(graphql@16.14.2)(monaco-editor@0.55.1)(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(payload@3.85.1(graphql@16.14.2)(typescript@5.7.3))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(supports-color@8.1.1)(typescript@5.7.3))(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(payload@3.85.1(graphql@16.14.2)(typescript@5.7.3))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.7.3)(yjs@13.6.31) '@payloadcms/ui': 3.85.1(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.2.9(@babel/core@7.29.7)(@opentelemetry/api@1.9.1)(@playwright/test@1.58.2)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(sass@1.77.4))(payload@3.85.1(graphql@16.14.2)(typescript@5.7.3))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.7.3) '@tailwindcss/postcss': 4.3.3 diff --git a/src/chaibuilder.config.ts b/src/chaibuilder.config.ts index b7909c8..5931546 100644 --- a/src/chaibuilder.config.ts +++ b/src/chaibuilder.config.ts @@ -7,9 +7,9 @@ import { Blog } from '@/collections/Blog' import config from '@payload-config' import { createLibsqlDB } from 'chaipro/db/libsql' import { - asChaiBuilderGlobalProvider, - buildChaiBuilderConfig, - payloadMediaPlugin, + asChaiBuilderGlobalProvider, + buildChaiBuilderConfig, + payloadMediaPlugin, } from 'chaipro/payload' import { aiPlugin } from 'chaipro/plugins/ai-pro/server' import { animationPlugin } from 'chaipro/plugins/animation/server'