spine-framework 0.3.125 → 0.3.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.framework/cli/commands/agents.ts +35 -37
- package/.framework/cli/commands/auth.ts +35 -34
- package/.framework/cli/commands/create-app.ts +104 -40
- package/.framework/cli/commands/dev.ts +104 -69
- package/.framework/cli/commands/doctor.ts +169 -97
- package/.framework/cli/commands/generate.ts +82 -161
- package/.framework/cli/commands/init.ts +72 -34
- package/.framework/cli/commands/install-app.ts +260 -125
- package/.framework/cli/commands/items.ts +33 -44
- package/.framework/cli/commands/migrate.ts +122 -40
- package/.framework/cli/commands/migrations.ts +33 -40
- package/.framework/cli/commands/pipelines.ts +31 -39
- package/.framework/cli/commands/status.ts +47 -23
- package/.framework/cli/commands/system.ts +47 -37
- package/.framework/cli/commands/test.ts +112 -68
- package/.framework/cli/commands/validate-app.ts +215 -121
- package/.framework/cli/context.ts +112 -130
- package/.framework/cli/env-loader.ts +47 -18
- package/.framework/cli/index.ts +81 -42
- package/.framework/docs/runtime-types.md +1024 -0
- package/.framework/functions/_shared/agent-runner.ts +1296 -961
- package/.framework/functions/_shared/app-manifest.ts +82 -68
- package/.framework/functions/_shared/audit.ts +135 -83
- package/.framework/functions/_shared/{cil-state.ts → cil.ts} +147 -54
- package/.framework/functions/_shared/db.ts +80 -126
- package/.framework/functions/_shared/hash-api-key.ts +63 -0
- package/.framework/functions/_shared/index.ts +222 -347
- package/.framework/functions/_shared/kb.ts +319 -0
- package/.framework/functions/_shared/llm.ts +92 -0
- package/.framework/functions/_shared/logging.ts +288 -0
- package/.framework/functions/_shared/middleware.ts +329 -365
- package/.framework/functions/_shared/outcomes.ts +36 -0
- package/.framework/functions/_shared/permissions.ts +359 -643
- package/.framework/functions/_shared/pipeline-runner.ts +243 -316
- package/.framework/functions/_shared/principal.ts +376 -468
- package/.framework/functions/_shared/resolve-credentials.ts +102 -0
- package/.framework/functions/_shared/resolve-ids.ts +162 -14
- package/.framework/functions/_shared/retry-deliveries.ts +104 -0
- package/.framework/functions/_shared/schema-utils.ts +611 -373
- package/.framework/functions/_shared/testing.ts +207 -137
- package/.framework/functions/_shared/tracing.ts +276 -0
- package/.framework/functions/_shared/trigger-engine.ts +159 -211
- package/.framework/functions/_shared/webhook-registration.ts +95 -81
- package/.framework/functions/_shared/webhook-registry.ts +153 -75
- package/.framework/functions/account-nodes.ts +31 -53
- package/.framework/functions/adapters/generic-webhook-inbound.ts +56 -0
- package/.framework/functions/adapters/generic-webhook-outbound.ts +43 -0
- package/.framework/functions/adapters/openai-outbound.ts +40 -0
- package/.framework/functions/admin-data.ts +687 -533
- package/.framework/functions/admin-funnel.ts +31 -20
- package/.framework/functions/admin-install-funnel.ts +47 -28
- package/.framework/functions/admin-signals.ts +47 -29
- package/.framework/functions/ai-agents.ts +122 -147
- package/.framework/functions/ai-interactions.ts +180 -90
- package/.framework/functions/api-keys.ts +250 -192
- package/.framework/functions/apps.ts +203 -197
- package/.framework/functions/auth.ts +98 -91
- package/.framework/functions/cil-agent-ingest.ts +773 -0
- package/.framework/functions/cil-agent.ts +592 -0
- package/.framework/functions/cil-callmap.ts +1227 -0
- package/.framework/functions/cil-config.ts +583 -0
- package/.framework/functions/cil-context.ts +445 -0
- package/.framework/functions/cil-doc.ts +1752 -0
- package/.framework/functions/cil-embeddings.ts +1202 -0
- package/.framework/functions/cil-graph.ts +585 -0
- package/.framework/functions/cil-ingest.ts +2416 -0
- package/.framework/functions/cil-pipeline.ts +318 -0
- package/.framework/functions/cil-project.ts +499 -0
- package/.framework/functions/cil-validate.ts +469 -0
- package/.framework/functions/debug-auth.ts +73 -53
- package/.framework/functions/deliveries.ts +117 -0
- package/.framework/functions/embeddings.ts +528 -516
- package/.framework/functions/eval-harness.ts +158 -106
- package/.framework/functions/integration-outbound.ts +311 -0
- package/.framework/functions/integration-routes.ts +240 -466
- package/.framework/functions/integrations.ts +132 -140
- package/.framework/functions/invites.ts +401 -201
- package/.framework/functions/item-progress.ts +113 -53
- package/.framework/functions/kb.ts +28 -0
- package/.framework/functions/logs.ts +239 -222
- package/.framework/functions/observability.ts +308 -259
- package/.framework/functions/pipeline-executions.ts +179 -235
- package/.framework/functions/pipelines.ts +163 -205
- package/.framework/functions/prompt-configs.ts +109 -156
- package/.framework/functions/roles.ts +97 -147
- package/.framework/functions/system-cron.ts +132 -218
- package/.framework/functions/system.ts +112 -52
- package/.framework/functions/tests.ts +32 -28
- package/.framework/functions/timers.ts +162 -210
- package/.framework/functions/triggers.ts +282 -346
- package/.framework/functions/types.ts +283 -400
- package/.framework/migrations/001_core_schema.sql +630 -0
- package/.framework/migrations/002_core_rls_and_functions.sql +532 -0
- package/.framework/migrations/{003_system_data.sql → 003_core_system_data.sql} +26 -153
- package/.framework/migrations/004_core_rpc_and_broker.sql +421 -0
- package/.framework/migrations/005_core_observability.sql +598 -0
- package/.framework/migrations/006_security_hardening_rls.sql +97 -0
- package/.framework/migrations/007_kb_article_list.sql +237 -0
- package/.framework/migrations/008_items_target.sql +8 -0
- package/.framework/migrations/009_roles_slug_unique.sql +11 -0
- package/.framework/public/spine.config.json +91 -0
- package/.framework/scripts/app-install-cli.ts +112 -98
- package/.framework/src/App.tsx +67 -20
- package/.framework/src/apps/admin/index.tsx +97 -27
- package/.framework/src/components/AppWrapper.tsx +50 -11
- package/.framework/src/components/CustomAppLoader.tsx +131 -22
- package/.framework/src/components/admin/AdminListPage.tsx +75 -8
- package/.framework/src/components/admin/AdminSidebar.tsx +148 -36
- package/.framework/src/components/admin/AdminStatsCard.tsx +48 -29
- package/.framework/src/components/admin/PageInstructions.tsx +49 -0
- package/.framework/src/components/admin/SortableTableHeader.tsx +49 -2
- package/.framework/src/components/app-shell/GenericAppShell.tsx +69 -11
- package/.framework/src/components/app-shell/GenericDetailPage.tsx +55 -10
- package/.framework/src/components/app-shell/GenericListPage.tsx +76 -9
- package/.framework/src/components/app-sidebar.tsx +50 -3
- package/.framework/src/components/auth/ProtectedRoute.tsx +53 -45
- package/.framework/src/components/kb/KBArticleEditor.tsx +409 -0
- package/.framework/src/components/kb/KBArticleList.tsx +557 -0
- package/.framework/src/components/layout/AppShell.tsx +54 -16
- package/.framework/src/components/layout/Header.tsx +50 -38
- package/.framework/src/components/layout/Layout.tsx +48 -32
- package/.framework/src/components/layout/Sidebar.tsx +167 -16
- package/.framework/src/components/runtime/DataDetailHeader.tsx +33 -1
- package/.framework/src/components/runtime/DataDetailPage.tsx +289 -4
- package/.framework/src/components/runtime/DataFilters.tsx +78 -1
- package/.framework/src/components/runtime/DataHeader.tsx +32 -29
- package/.framework/src/components/runtime/DataListPage.tsx +161 -2
- package/.framework/src/components/runtime/DataStats.tsx +48 -1
- package/.framework/src/components/runtime/DataTable.tsx +153 -1
- package/.framework/src/components/runtime/SchemaDetailForm.tsx +77 -46
- package/.framework/src/components/runtime/index.ts +16 -9
- package/.framework/src/components/search-form.tsx +33 -1
- package/.framework/src/components/shared/AgentView.tsx +48 -51
- package/.framework/src/components/shared/FieldRenderer.tsx +84 -67
- package/.framework/src/components/shared/InviteManager.tsx +113 -52
- package/.framework/src/components/shared/MemberList.tsx +182 -0
- package/.framework/src/components/shared/SchemaFields.tsx +96 -78
- package/.framework/src/components/ui/DataTable.tsx +86 -56
- package/.framework/src/components/ui/Form.tsx +188 -109
- package/.framework/src/components/ui/ItemCard.tsx +86 -58
- package/.framework/src/components/ui/ItemListView.tsx +88 -61
- package/.framework/src/components/ui/LoadingSpinner.tsx +52 -27
- package/.framework/src/components/ui/Modal.tsx +81 -4
- package/.framework/src/components/ui/RichTextEditor.tsx +101 -9
- package/.framework/src/components/ui/accordion.tsx +97 -5
- package/.framework/src/components/ui/alert-dialog.tsx +225 -13
- package/.framework/src/components/ui/alert.tsx +113 -6
- package/.framework/src/components/ui/aspect-ratio.tsx +49 -2
- package/.framework/src/components/ui/avatar.tsx +129 -7
- package/.framework/src/components/ui/badge.tsx +65 -3
- package/.framework/src/components/ui/breadcrumb.tsx +145 -8
- package/.framework/src/components/ui/button-group.tsx +81 -4
- package/.framework/src/components/ui/button.tsx +49 -2
- package/.framework/src/components/ui/calendar.tsx +65 -3
- package/.framework/src/components/ui/card.tsx +145 -8
- package/.framework/src/components/ui/carousel.tsx +129 -7
- package/.framework/src/components/ui/chart.tsx +161 -10
- package/.framework/src/components/ui/checkbox.tsx +49 -2
- package/.framework/src/components/ui/collapsible.tsx +81 -5
- package/.framework/src/components/ui/combobox.tsx +305 -20
- package/.framework/src/components/ui/command.tsx +177 -11
- package/.framework/src/components/ui/context-menu.tsx +273 -17
- package/.framework/src/components/ui/dialog.tsx +209 -27
- package/.framework/src/components/ui/direction.tsx +64 -4
- package/.framework/src/components/ui/drawer.tsx +193 -12
- package/.framework/src/components/ui/dropdown-menu.tsx +273 -18
- package/.framework/src/components/ui/empty.tsx +145 -9
- package/.framework/src/components/ui/field.tsx +209 -14
- package/.framework/src/components/ui/hover-card.tsx +81 -4
- package/.framework/src/components/ui/input-group.tsx +162 -10
- package/.framework/src/components/ui/input-otp.tsx +98 -5
- package/.framework/src/components/ui/input.tsx +49 -2
- package/.framework/src/components/ui/item.tsx +225 -13
- package/.framework/src/components/ui/kbd.tsx +65 -3
- package/.framework/src/components/ui/label.tsx +49 -2
- package/.framework/src/components/ui/menubar.tsx +289 -17
- package/.framework/src/components/ui/native-select.tsx +97 -5
- package/.framework/src/components/ui/navigation-menu.tsx +177 -10
- package/.framework/src/components/ui/pagination.tsx +161 -9
- package/.framework/src/components/ui/popover.tsx +145 -8
- package/.framework/src/components/ui/progress.tsx +49 -2
- package/.framework/src/components/ui/radio-group.tsx +65 -3
- package/.framework/src/components/ui/resizable.tsx +82 -4
- package/.framework/src/components/ui/scroll-area.tsx +65 -3
- package/.framework/src/components/ui/select.tsx +193 -11
- package/.framework/src/components/ui/separator.tsx +49 -2
- package/.framework/src/components/ui/sheet.tsx +193 -11
- package/.framework/src/components/ui/sidebar.tsx +481 -38
- package/.framework/src/components/ui/skeleton.tsx +49 -2
- package/.framework/src/components/ui/slider.tsx +49 -2
- package/.framework/src/components/ui/sonner.tsx +49 -2
- package/.framework/src/components/ui/spinner.tsx +49 -2
- package/.framework/src/components/ui/switch.tsx +49 -2
- package/.framework/src/components/ui/table-primitives.tsx +160 -33
- package/.framework/src/components/ui/table.tsx +161 -9
- package/.framework/src/components/ui/tabs.tsx +113 -6
- package/.framework/src/components/ui/textarea.tsx +49 -2
- package/.framework/src/components/ui/toggle-group.tsx +81 -4
- package/.framework/src/components/ui/toggle.tsx +65 -3
- package/.framework/src/components/ui/tooltip.tsx +97 -5
- package/.framework/src/contexts/AppContext.tsx +129 -45
- package/.framework/src/contexts/AuthContext.tsx +173 -145
- package/.framework/src/hooks/use-mobile.ts +48 -2
- package/.framework/src/hooks/useApi.ts +208 -159
- package/.framework/src/hooks/useAppPath.ts +32 -23
- package/.framework/src/hooks/useApps.ts +51 -20
- package/.framework/src/hooks/useEntityList.ts +32 -78
- package/.framework/src/hooks/useEntityRecord.ts +35 -96
- package/.framework/src/hooks/useForm.ts +32 -92
- package/.framework/src/hooks/useListSchema.ts +49 -78
- package/.framework/src/hooks/useSchemaRecord.ts +114 -105
- package/.framework/src/lib/api.ts +192 -115
- package/.framework/src/lib/supabase.ts +98 -64
- package/.framework/src/lib/utils.ts +287 -151
- package/.framework/src/main.tsx +49 -3
- package/.framework/src/pages/DashboardPage.tsx +52 -29
- package/.framework/src/pages/NotFoundPage.tsx +32 -10
- package/.framework/src/pages/SetupPage.tsx +32 -12
- package/.framework/src/pages/admin/AIAgentDetailPage.tsx +119 -10
- package/.framework/src/pages/admin/AIAgentsPage.tsx +48 -19
- package/.framework/src/pages/admin/APIKeyDetailPage.tsx +187 -17
- package/.framework/src/pages/admin/APIKeysPage.tsx +98 -22
- package/.framework/src/pages/admin/AlertsConfigPage.tsx +113 -26
- package/.framework/src/pages/admin/AppDetailPage.tsx +125 -8
- package/.framework/src/pages/admin/AppsPage.tsx +49 -2
- package/.framework/src/pages/admin/DeliveriesPage.tsx +196 -0
- package/.framework/src/pages/admin/DesignedPage.tsx +32 -18
- package/.framework/src/pages/admin/EmbeddingDetailPage.tsx +215 -484
- package/.framework/src/pages/admin/EmbeddingsPage.tsx +116 -319
- package/.framework/src/pages/admin/ExtendedShadcnTestPage.tsx +34 -9
- package/.framework/src/pages/admin/IncrementalShadcnTestPage.tsx +34 -9
- package/.framework/src/pages/admin/IntegratedDashboard.tsx +32 -16
- package/.framework/src/pages/admin/IntegrationDetailPage.tsx +183 -26
- package/.framework/src/pages/admin/IntegrationsPage.tsx +48 -19
- package/.framework/src/pages/admin/InvitesPage.tsx +48 -14
- package/.framework/src/pages/admin/LogsPage.tsx +422 -75
- package/.framework/src/pages/admin/MinimalShadcnTestPage.tsx +34 -9
- package/.framework/src/pages/admin/ObservabilityDashboard.tsx +113 -24
- package/.framework/src/pages/admin/PipelineDetailPage.tsx +206 -34
- package/.framework/src/pages/admin/PipelineExecutionsPage.tsx +50 -17
- package/.framework/src/pages/admin/PipelinesPage.tsx +160 -21
- package/.framework/src/pages/admin/PromptConfigDetailPage.tsx +378 -88
- package/.framework/src/pages/admin/PromptConfigsPage.tsx +125 -16
- package/.framework/src/pages/admin/ProperlyDesignedPage.tsx +49 -10
- package/.framework/src/pages/admin/RoleDetailPage.tsx +130 -10
- package/.framework/src/pages/admin/RolesPage.tsx +171 -18
- package/.framework/src/pages/admin/SelectTestPage.tsx +34 -9
- package/.framework/src/pages/admin/ShadcnTestPage.tsx +49 -11
- package/.framework/src/pages/admin/SimpleDashboard.tsx +49 -10
- package/.framework/src/pages/admin/TestRunDetailPage.tsx +49 -4
- package/.framework/src/pages/admin/TestingDashboard.tsx +98 -28
- package/.framework/src/pages/admin/TimerDetailPage.tsx +143 -33
- package/.framework/src/pages/admin/TimersPage.tsx +48 -20
- package/.framework/src/pages/admin/TriggerDetailPage.tsx +118 -30
- package/.framework/src/pages/admin/TriggersPage.tsx +64 -19
- package/.framework/src/pages/admin/TypeDetailPage.tsx +138 -15
- package/.framework/src/pages/admin/TypesPage.tsx +48 -20
- package/.framework/src/pages/admin/cil/CILAgentPage.tsx +465 -0
- package/.framework/src/pages/admin/cil/CILChunkDetailPage.tsx +787 -0
- package/.framework/src/pages/admin/cil/CILDashboardPage.tsx +699 -0
- package/.framework/src/pages/admin/cil/CILFileListPage.tsx +647 -0
- package/.framework/src/pages/admin/cil/CILGraphPage.tsx +616 -0
- package/.framework/src/pages/admin/cil/CILIngestionPage.tsx +1402 -0
- package/.framework/src/pages/admin/cil/CILProjectsPage.tsx +614 -0
- package/.framework/src/pages/admin/cil/CILSearchPage.tsx +571 -0
- package/.framework/src/pages/admin/cil/FlexiblePipelinePage.tsx +731 -0
- package/.framework/src/pages/admin/kb/KBAdminPage.tsx +64 -0
- package/.framework/src/pages/auth/AuthConfirmPage.tsx +52 -51
- package/.framework/src/pages/auth/ForgotPasswordPage.tsx +31 -22
- package/.framework/src/pages/auth/LoginPage.tsx +50 -23
- package/.framework/src/pages/auth/PendingApprovalPage.tsx +31 -15
- package/.framework/src/pages/auth/RegisterPage.tsx +281 -317
- package/.framework/src/pages/spine-framework/APIPage.tsx +33 -0
- package/.framework/src/pages/spine-framework/CLIPage.tsx +33 -0
- package/.framework/src/types/auth.ts +128 -71
- package/.framework/src/types/types.ts +373 -157
- package/custom/.devin/skills/spine-workbench-discovery/SKILL.md +39 -0
- package/custom/.devin/skills/spine-workbench-idea/SKILL.md +36 -0
- package/custom/.devin/skills/spine-workbench-implement/SKILL.md +46 -0
- package/custom/.devin/skills/spine-workbench-initiative/SKILL.md +28 -0
- package/custom/.devin/skills/spine-workbench-plan/SKILL.md +38 -0
- package/docs/README.md +9 -130
- package/netlify.toml +3 -3
- package/package.json +13 -25
- package/scripts/kb-ingest-docs.ts +203 -0
- package/spine.config.json +65 -4
- package/.framework/migrations/001_schema.sql +0 -425
- package/.framework/migrations/002_rls_and_functions.sql +0 -763
- package/.framework/migrations/004_enhancements.sql +0 -43
- package/.framework/migrations/005_auth_user_trigger.sql +0 -105
- package/.framework/migrations/006_fix_current_actor_id.sql +0 -21
- package/.framework/migrations/016_invites.sql +0 -27
- package/.framework/migrations/017_fix_get_account_apps.sql +0 -78
- package/.framework/migrations/018_apps_required_roles.sql +0 -17
- package/.framework/migrations/019_triggers_unique_constraint.sql +0 -13
- package/.framework/migrations/020_get_account_apps_role_filter.sql +0 -117
- package/.framework/migrations/021_app_domains.sql +0 -112
- package/.framework/migrations/022_route_prefix_domain_unique.sql +0 -21
- package/.framework/migrations/023_match_embeddings_rpc.sql +0 -78
- package/.framework/migrations/024_messages_account_id.sql +0 -9
- package/.framework/migrations/025_retype_threads_messages.sql +0 -240
- package/.framework/migrations/026_fix_rls_policies.sql +0 -47
- package/.framework/migrations/027_embedding_lifecycle.sql +0 -176
- package/.framework/migrations/028_fix_message_data_permissions.sql +0 -49
- package/.framework/migrations/029_tighten_support_triage_prompt.sql +0 -41
- package/.framework/migrations/030_messages_updated_by.sql +0 -6
- package/.framework/migrations/031_seed_upsert_constraints.sql +0 -35
- package/docs/APPS.md +0 -232
- package/docs/ARCHITECTURE.md +0 -246
- package/docs/INSTALL.md +0 -155
- package/docs/design-schema-spec.md +0 -1837
- package/docs/dev-guides/01-create-an-app.md +0 -183
- package/docs/dev-guides/02-create-a-function.md +0 -178
- package/docs/dev-guides/03-create-a-component.md +0 -178
- package/docs/dev-guides/04-webhook-handlers.md +0 -129
- package/docs/dev-guides/05-testing.md +0 -168
- package/docs/dev-guides/README.md +0 -40
- package/docs/npm-packages-plan.md +0 -288
- package/docs/spine-core--api-reference.md +0 -822
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
-- Spine v2 consolidated core schema
|
|
2
|
+
-- Base tables, extensions, indexes, triggers, and RLS enablements.
|
|
3
|
+
|
|
4
|
+
COMMENT ON SCHEMA public IS 'Spine v2 consolidated schema - runtime entities foundation';
|
|
5
|
+
|
|
6
|
+
CREATE EXTENSION IF NOT EXISTS vector;
|
|
7
|
+
CREATE TABLE IF NOT EXISTS public.accounts (
|
|
8
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
9
|
+
parent_id uuid, type_id uuid NOT NULL, slug text NOT NULL UNIQUE,
|
|
10
|
+
display_name text NOT NULL, description text,
|
|
11
|
+
data jsonb DEFAULT '{}', is_active boolean DEFAULT true,
|
|
12
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
13
|
+
design_schema jsonb DEFAULT '{}', validation_schema jsonb DEFAULT '{}',
|
|
14
|
+
app_id uuid, created_by uuid, updated_by uuid,
|
|
15
|
+
logs_retention_days int DEFAULT 30,
|
|
16
|
+
observability_retention_days int DEFAULT 90
|
|
17
|
+
);
|
|
18
|
+
CREATE TABLE IF NOT EXISTS public.people (
|
|
19
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
20
|
+
auth_uid uuid UNIQUE, email text UNIQUE NOT NULL, full_name text NOT NULL,
|
|
21
|
+
avatar_url text, phone text, status text DEFAULT 'active',
|
|
22
|
+
data jsonb DEFAULT '{}', is_active boolean DEFAULT true, account_id uuid NOT NULL,
|
|
23
|
+
app_id uuid, role_id uuid, type_id uuid NOT NULL,
|
|
24
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
25
|
+
design_schema jsonb DEFAULT '{}', validation_schema jsonb DEFAULT '{}',
|
|
26
|
+
created_by uuid
|
|
27
|
+
);
|
|
28
|
+
CREATE TABLE IF NOT EXISTS public.types (
|
|
29
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
30
|
+
app_id uuid, kind text NOT NULL, slug text NOT NULL, name text NOT NULL,
|
|
31
|
+
description text, icon text, color text,
|
|
32
|
+
design_schema jsonb DEFAULT '{}', validation_schema jsonb DEFAULT '{}',
|
|
33
|
+
ownership text DEFAULT 'tenant', is_active boolean DEFAULT true,
|
|
34
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
35
|
+
UNIQUE(app_id, kind, slug)
|
|
36
|
+
);
|
|
37
|
+
CREATE TABLE IF NOT EXISTS public.apps (
|
|
38
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
39
|
+
slug text NOT NULL UNIQUE, name text NOT NULL, description text,
|
|
40
|
+
icon text, color text, version text DEFAULT '1.0.0',
|
|
41
|
+
app_type text DEFAULT 'system', source text DEFAULT 'builtin',
|
|
42
|
+
config jsonb DEFAULT '{}', nav_items jsonb DEFAULT '[]',
|
|
43
|
+
min_role text, integration_deps jsonb DEFAULT '[]', metadata jsonb DEFAULT '{}',
|
|
44
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
45
|
+
account_id uuid, owner_account_id uuid,
|
|
46
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
47
|
+
route_prefix text,
|
|
48
|
+
preview_domain text,
|
|
49
|
+
prod_domain text,
|
|
50
|
+
renderer text NOT NULL DEFAULT 'generic',
|
|
51
|
+
CONSTRAINT chk_apps_renderer CHECK (renderer IN ('generic', 'custom', 'none'))
|
|
52
|
+
);
|
|
53
|
+
CREATE TABLE IF NOT EXISTS public.roles (
|
|
54
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
55
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
56
|
+
permissions jsonb DEFAULT '[]', is_system boolean DEFAULT false,
|
|
57
|
+
is_active boolean DEFAULT true, is_protected boolean DEFAULT false,
|
|
58
|
+
app_id uuid, account_id uuid,
|
|
59
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
60
|
+
UNIQUE(slug)
|
|
61
|
+
);
|
|
62
|
+
CREATE TABLE IF NOT EXISTS public.items (
|
|
63
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
64
|
+
type_id uuid NOT NULL, account_id uuid NOT NULL, app_id uuid,
|
|
65
|
+
title text, description text, status text DEFAULT 'active',
|
|
66
|
+
data jsonb DEFAULT '{}', is_active boolean DEFAULT true,
|
|
67
|
+
design_schema jsonb DEFAULT '{}', validation_schema jsonb DEFAULT '{}',
|
|
68
|
+
created_by uuid, updated_by uuid,
|
|
69
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now()
|
|
70
|
+
);
|
|
71
|
+
CREATE TABLE IF NOT EXISTS public.threads (
|
|
72
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
73
|
+
type_id uuid NOT NULL, account_id uuid NOT NULL, app_id uuid,
|
|
74
|
+
title text, target_type text NOT NULL, target_id uuid NOT NULL,
|
|
75
|
+
visibility text DEFAULT 'internal', status text DEFAULT 'open',
|
|
76
|
+
data jsonb DEFAULT '{}', is_active boolean DEFAULT true,
|
|
77
|
+
design_schema jsonb DEFAULT '{}', validation_schema jsonb DEFAULT '{}',
|
|
78
|
+
created_by uuid, updated_by uuid,
|
|
79
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
80
|
+
CONSTRAINT threads_unique_target_visibility UNIQUE (target_type, target_id, visibility)
|
|
81
|
+
);
|
|
82
|
+
CREATE TABLE IF NOT EXISTS public.messages (
|
|
83
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
84
|
+
type_id uuid NOT NULL, thread_id uuid NOT NULL,
|
|
85
|
+
account_id uuid REFERENCES public.accounts(id),
|
|
86
|
+
content text NOT NULL, direction text DEFAULT 'outbound',
|
|
87
|
+
sequence integer NOT NULL, visibility text DEFAULT 'internal',
|
|
88
|
+
data jsonb DEFAULT '{}', is_active boolean DEFAULT true,
|
|
89
|
+
design_schema jsonb DEFAULT '{}', validation_schema jsonb DEFAULT '{}',
|
|
90
|
+
person_id uuid, created_by uuid,
|
|
91
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
92
|
+
UNIQUE(thread_id, sequence)
|
|
93
|
+
);
|
|
94
|
+
CREATE TABLE IF NOT EXISTS public.links (
|
|
95
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
96
|
+
type_id uuid NOT NULL, account_id uuid NOT NULL, link_type_id uuid,
|
|
97
|
+
source_type text NOT NULL, source_id uuid NOT NULL,
|
|
98
|
+
target_type text NOT NULL, target_id uuid NOT NULL,
|
|
99
|
+
link_type text, metadata jsonb DEFAULT '{}',
|
|
100
|
+
data jsonb DEFAULT '{}', design_schema jsonb DEFAULT '{}', validation_schema jsonb DEFAULT '{}',
|
|
101
|
+
created_by uuid, updated_by uuid,
|
|
102
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
103
|
+
UNIQUE(source_type, source_id, target_type, target_id, link_type_id)
|
|
104
|
+
);
|
|
105
|
+
CREATE TABLE IF NOT EXISTS public.attachments (
|
|
106
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
107
|
+
type_id uuid NOT NULL, account_id uuid NOT NULL,
|
|
108
|
+
filename text NOT NULL, file_size integer, mime_type text,
|
|
109
|
+
storage_path text, storage_provider text DEFAULT 'supabase',
|
|
110
|
+
metadata jsonb DEFAULT '{}', data jsonb DEFAULT '{}',
|
|
111
|
+
design_schema jsonb DEFAULT '{}', validation_schema jsonb DEFAULT '{}',
|
|
112
|
+
uploaded_by uuid, created_by uuid,
|
|
113
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now()
|
|
114
|
+
);
|
|
115
|
+
CREATE TABLE IF NOT EXISTS public.watchers (
|
|
116
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
117
|
+
type_id uuid NOT NULL, account_id uuid,
|
|
118
|
+
target_type text NOT NULL, target_id uuid NOT NULL, person_id uuid NOT NULL,
|
|
119
|
+
watch_type text DEFAULT 'all', notification_level text DEFAULT 'all',
|
|
120
|
+
metadata jsonb DEFAULT '{}', data jsonb DEFAULT '{}',
|
|
121
|
+
design_schema jsonb DEFAULT '{}', validation_schema jsonb DEFAULT '{}',
|
|
122
|
+
created_by uuid, created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
123
|
+
UNIQUE(target_type, target_id, person_id)
|
|
124
|
+
);
|
|
125
|
+
CREATE TABLE IF NOT EXISTS public.link_types (
|
|
126
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
127
|
+
app_id uuid, slug text NOT NULL, name text NOT NULL,
|
|
128
|
+
description text, icon text, color text,
|
|
129
|
+
config jsonb DEFAULT '{}', is_active boolean DEFAULT true,
|
|
130
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
131
|
+
UNIQUE(app_id, slug)
|
|
132
|
+
);
|
|
133
|
+
CREATE TABLE IF NOT EXISTS public.pipelines (
|
|
134
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
135
|
+
app_id uuid, account_id uuid, slug text NOT NULL,
|
|
136
|
+
name text NOT NULL, description text,
|
|
137
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
138
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
139
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
140
|
+
UNIQUE(app_id, slug)
|
|
141
|
+
);
|
|
142
|
+
CREATE TABLE IF NOT EXISTS public.pipeline_executions (
|
|
143
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
144
|
+
pipeline_id uuid NOT NULL, account_id uuid,
|
|
145
|
+
status text DEFAULT 'pending', started_at timestamptz,
|
|
146
|
+
completed_at timestamptz, error_message text,
|
|
147
|
+
input_data jsonb DEFAULT '{}', output_data jsonb DEFAULT '{}',
|
|
148
|
+
metadata jsonb DEFAULT '{}', created_by uuid,
|
|
149
|
+
created_at timestamptz DEFAULT now(),
|
|
150
|
+
CONSTRAINT fk_pipeline_executions_pipeline
|
|
151
|
+
FOREIGN KEY (pipeline_id) REFERENCES public.pipelines(id) ON DELETE CASCADE
|
|
152
|
+
);
|
|
153
|
+
CREATE TABLE IF NOT EXISTS public.triggers (
|
|
154
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
155
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
156
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
157
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
158
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
159
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
160
|
+
UNIQUE(app_id, slug)
|
|
161
|
+
);
|
|
162
|
+
CREATE TABLE IF NOT EXISTS public.timers (
|
|
163
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
164
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
165
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
166
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
167
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
168
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
169
|
+
UNIQUE(app_id, slug)
|
|
170
|
+
);
|
|
171
|
+
CREATE TABLE IF NOT EXISTS public.prompt_configs (
|
|
172
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
173
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
174
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
175
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
176
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
177
|
+
created_by uuid, updated_by uuid,
|
|
178
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
179
|
+
UNIQUE(app_id, slug)
|
|
180
|
+
);
|
|
181
|
+
CREATE TABLE IF NOT EXISTS public.integrations (
|
|
182
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
183
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
184
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
185
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
186
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
187
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
188
|
+
UNIQUE(app_id, slug)
|
|
189
|
+
);
|
|
190
|
+
CREATE TABLE IF NOT EXISTS public.integration_routes (
|
|
191
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
192
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
193
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
194
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
195
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
196
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
197
|
+
UNIQUE(app_id, slug)
|
|
198
|
+
);
|
|
199
|
+
CREATE TABLE IF NOT EXISTS public.logs (
|
|
200
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
201
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
202
|
+
level text, message text, context jsonb DEFAULT '{}',
|
|
203
|
+
metadata jsonb DEFAULT '{}', created_by uuid,
|
|
204
|
+
created_at timestamptz DEFAULT now()
|
|
205
|
+
);
|
|
206
|
+
CREATE TABLE IF NOT EXISTS public.observability (
|
|
207
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
208
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
209
|
+
metric_name text, metric_value numeric, metric_unit text,
|
|
210
|
+
context jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
211
|
+
created_at timestamptz DEFAULT now()
|
|
212
|
+
);
|
|
213
|
+
CREATE TABLE IF NOT EXISTS public.test_runs (
|
|
214
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
215
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
216
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
217
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
218
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
219
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
220
|
+
UNIQUE(app_id, slug)
|
|
221
|
+
);
|
|
222
|
+
CREATE TABLE IF NOT EXISTS public.test_cases (
|
|
223
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
224
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
225
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
226
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
227
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
228
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
229
|
+
UNIQUE(app_id, slug)
|
|
230
|
+
);
|
|
231
|
+
CREATE TABLE IF NOT EXISTS public.embeddings (
|
|
232
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
233
|
+
account_id uuid NOT NULL,
|
|
234
|
+
model_id text NOT NULL,
|
|
235
|
+
document_id text NOT NULL,
|
|
236
|
+
chunk_index integer NOT NULL DEFAULT 0,
|
|
237
|
+
content text NOT NULL,
|
|
238
|
+
embedding vector(1536),
|
|
239
|
+
metadata jsonb DEFAULT '{}',
|
|
240
|
+
approved_at timestamptz,
|
|
241
|
+
revoked_at timestamptz,
|
|
242
|
+
content_hash text,
|
|
243
|
+
created_at timestamptz DEFAULT now(),
|
|
244
|
+
updated_at timestamptz DEFAULT now(),
|
|
245
|
+
UNIQUE(model_id, document_id, chunk_index)
|
|
246
|
+
);
|
|
247
|
+
CREATE TABLE IF NOT EXISTS public.ai_agents (
|
|
248
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
249
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
250
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
251
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
252
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
253
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
254
|
+
UNIQUE(app_id, slug)
|
|
255
|
+
);
|
|
256
|
+
CREATE TABLE IF NOT EXISTS public.invites (
|
|
257
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
258
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
259
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
260
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
261
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
262
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
263
|
+
UNIQUE(app_id, slug)
|
|
264
|
+
);
|
|
265
|
+
CREATE TABLE IF NOT EXISTS public.api_keys (
|
|
266
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
267
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
268
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
269
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
270
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
271
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
272
|
+
UNIQUE(app_id, slug)
|
|
273
|
+
);
|
|
274
|
+
CREATE TABLE IF NOT EXISTS public.alerts (
|
|
275
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
276
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
277
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
278
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
279
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
280
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
281
|
+
UNIQUE(app_id, slug)
|
|
282
|
+
);
|
|
283
|
+
CREATE TABLE IF NOT EXISTS public.item_progress (
|
|
284
|
+
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
285
|
+
app_id uuid, account_id uuid, type_id uuid,
|
|
286
|
+
slug text NOT NULL, name text NOT NULL, description text,
|
|
287
|
+
config jsonb DEFAULT '{}', metadata jsonb DEFAULT '{}',
|
|
288
|
+
is_active boolean DEFAULT true, is_system boolean DEFAULT false,
|
|
289
|
+
created_at timestamptz DEFAULT now(), updated_at timestamptz DEFAULT now(),
|
|
290
|
+
UNIQUE(app_id, slug)
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
CREATE TABLE IF NOT EXISTS public.account_paths (
|
|
294
|
+
ancestor_id uuid NOT NULL REFERENCES public.accounts(id) ON DELETE CASCADE,
|
|
295
|
+
descendant_id uuid NOT NULL REFERENCES public.accounts(id) ON DELETE CASCADE,
|
|
296
|
+
depth integer NOT NULL,
|
|
297
|
+
PRIMARY KEY (ancestor_id, descendant_id),
|
|
298
|
+
CONSTRAINT chk_account_paths_no_self CHECK (ancestor_id != descendant_id)
|
|
299
|
+
);
|
|
300
|
+
CREATE INDEX IF NOT EXISTS idx_accounts_parent_id ON public.accounts(parent_id);
|
|
301
|
+
CREATE INDEX IF NOT EXISTS idx_accounts_type_id ON public.accounts(type_id);
|
|
302
|
+
CREATE INDEX IF NOT EXISTS idx_accounts_slug ON public.accounts(slug);
|
|
303
|
+
CREATE INDEX IF NOT EXISTS idx_accounts_app_id ON public.accounts(app_id);
|
|
304
|
+
CREATE INDEX IF NOT EXISTS idx_people_account_id ON public.people(account_id);
|
|
305
|
+
CREATE INDEX IF NOT EXISTS idx_people_auth_uid ON public.people(auth_uid);
|
|
306
|
+
CREATE INDEX IF NOT EXISTS idx_people_email ON public.people(email);
|
|
307
|
+
CREATE INDEX IF NOT EXISTS idx_people_app_id ON public.people(app_id);
|
|
308
|
+
CREATE INDEX IF NOT EXISTS idx_people_role_id ON public.people(role_id);
|
|
309
|
+
CREATE INDEX IF NOT EXISTS idx_people_type_id ON public.people(type_id);
|
|
310
|
+
CREATE INDEX IF NOT EXISTS idx_types_app_id ON public.types(app_id);
|
|
311
|
+
CREATE INDEX IF NOT EXISTS idx_types_kind ON public.types(kind);
|
|
312
|
+
CREATE INDEX IF NOT EXISTS idx_types_slug ON public.types(slug);
|
|
313
|
+
CREATE INDEX IF NOT EXISTS idx_apps_account_id ON public.apps(account_id);
|
|
314
|
+
CREATE INDEX IF NOT EXISTS idx_apps_slug ON public.apps(slug);
|
|
315
|
+
CREATE INDEX IF NOT EXISTS idx_apps_app_type ON public.apps(app_type);
|
|
316
|
+
CREATE INDEX IF NOT EXISTS idx_roles_app_id ON public.roles(app_id);
|
|
317
|
+
CREATE INDEX IF NOT EXISTS idx_roles_account_id ON public.roles(account_id);
|
|
318
|
+
CREATE INDEX IF NOT EXISTS idx_roles_slug ON public.roles(slug);
|
|
319
|
+
CREATE INDEX IF NOT EXISTS idx_items_type_id ON public.items(type_id);
|
|
320
|
+
CREATE INDEX IF NOT EXISTS idx_items_account_id ON public.items(account_id);
|
|
321
|
+
CREATE INDEX IF NOT EXISTS idx_items_app_id ON public.items(app_id);
|
|
322
|
+
CREATE INDEX IF NOT EXISTS idx_items_created_by ON public.items(created_by);
|
|
323
|
+
CREATE INDEX IF NOT EXISTS idx_items_updated_by ON public.items(updated_by);
|
|
324
|
+
CREATE INDEX IF NOT EXISTS idx_threads_type_id ON public.threads(type_id);
|
|
325
|
+
CREATE INDEX IF NOT EXISTS idx_threads_account_id ON public.threads(account_id);
|
|
326
|
+
CREATE INDEX IF NOT EXISTS idx_threads_app_id ON public.threads(app_id);
|
|
327
|
+
CREATE INDEX IF NOT EXISTS idx_threads_created_by ON public.threads(created_by);
|
|
328
|
+
CREATE INDEX IF NOT EXISTS idx_threads_updated_by ON public.threads(updated_by);
|
|
329
|
+
CREATE INDEX IF NOT EXISTS idx_messages_type_id ON public.messages(type_id);
|
|
330
|
+
CREATE INDEX IF NOT EXISTS idx_messages_thread_id ON public.messages(thread_id);
|
|
331
|
+
CREATE INDEX IF NOT EXISTS idx_messages_account_id ON public.messages(account_id);
|
|
332
|
+
CREATE INDEX IF NOT EXISTS idx_messages_person_id ON public.messages(person_id);
|
|
333
|
+
CREATE INDEX IF NOT EXISTS idx_messages_created_by ON public.messages(created_by);
|
|
334
|
+
CREATE INDEX IF NOT EXISTS idx_links_type_id ON public.links(type_id);
|
|
335
|
+
CREATE INDEX IF NOT EXISTS idx_links_account_id ON public.links(account_id);
|
|
336
|
+
CREATE INDEX IF NOT EXISTS idx_links_source ON public.links(source_type, source_id);
|
|
337
|
+
CREATE INDEX IF NOT EXISTS idx_links_target ON public.links(target_type, target_id);
|
|
338
|
+
CREATE INDEX IF NOT EXISTS idx_links_link_type_id ON public.links(link_type_id);
|
|
339
|
+
CREATE INDEX IF NOT EXISTS idx_links_created_by ON public.links(created_by);
|
|
340
|
+
CREATE INDEX IF NOT EXISTS idx_links_updated_by ON public.links(updated_by);
|
|
341
|
+
CREATE INDEX IF NOT EXISTS idx_attachments_type_id ON public.attachments(type_id);
|
|
342
|
+
CREATE INDEX IF NOT EXISTS idx_attachments_account_id ON public.attachments(account_id);
|
|
343
|
+
CREATE INDEX IF NOT EXISTS idx_attachments_uploaded_by ON public.attachments(uploaded_by);
|
|
344
|
+
CREATE INDEX IF NOT EXISTS idx_attachments_created_by ON public.attachments(created_by);
|
|
345
|
+
CREATE INDEX IF NOT EXISTS idx_watchers_type_id ON public.watchers(type_id);
|
|
346
|
+
CREATE INDEX IF NOT EXISTS idx_watchers_account_id ON public.watchers(account_id);
|
|
347
|
+
CREATE INDEX IF NOT EXISTS idx_watchers_target ON public.watchers(target_type, target_id);
|
|
348
|
+
CREATE INDEX IF NOT EXISTS idx_watchers_person_id ON public.watchers(person_id);
|
|
349
|
+
CREATE INDEX IF NOT EXISTS idx_watchers_created_by ON public.watchers(created_by);
|
|
350
|
+
CREATE INDEX IF NOT EXISTS idx_link_types_app_id ON public.link_types(app_id);
|
|
351
|
+
CREATE INDEX IF NOT EXISTS idx_link_types_slug ON public.link_types(slug);
|
|
352
|
+
CREATE INDEX IF NOT EXISTS idx_pipelines_app_id ON public.pipelines(app_id);
|
|
353
|
+
CREATE INDEX IF NOT EXISTS idx_pipelines_account_id ON public.pipelines(account_id);
|
|
354
|
+
CREATE INDEX IF NOT EXISTS idx_pipelines_slug ON public.pipelines(slug);
|
|
355
|
+
CREATE INDEX IF NOT EXISTS idx_pipeline_executions_pipeline_id ON public.pipeline_executions(pipeline_id);
|
|
356
|
+
CREATE INDEX IF NOT EXISTS idx_pipeline_executions_account_id ON public.pipeline_executions(account_id);
|
|
357
|
+
CREATE INDEX IF NOT EXISTS idx_pipeline_executions_status ON public.pipeline_executions(status);
|
|
358
|
+
CREATE INDEX IF NOT EXISTS idx_pipeline_executions_created_by ON public.pipeline_executions(created_by);
|
|
359
|
+
CREATE INDEX IF NOT EXISTS idx_triggers_app_id ON public.triggers(app_id);
|
|
360
|
+
CREATE INDEX IF NOT EXISTS idx_triggers_account_id ON public.triggers(account_id);
|
|
361
|
+
CREATE INDEX IF NOT EXISTS idx_triggers_type_id ON public.triggers(type_id);
|
|
362
|
+
CREATE INDEX IF NOT EXISTS idx_triggers_slug ON public.triggers(slug);
|
|
363
|
+
CREATE INDEX IF NOT EXISTS idx_timers_app_id ON public.timers(app_id);
|
|
364
|
+
CREATE INDEX IF NOT EXISTS idx_timers_account_id ON public.timers(account_id);
|
|
365
|
+
CREATE INDEX IF NOT EXISTS idx_timers_type_id ON public.timers(type_id);
|
|
366
|
+
CREATE INDEX IF NOT EXISTS idx_timers_slug ON public.timers(slug);
|
|
367
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_configs_app_id ON public.prompt_configs(app_id);
|
|
368
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_configs_account_id ON public.prompt_configs(account_id);
|
|
369
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_configs_type_id ON public.prompt_configs(type_id);
|
|
370
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_configs_slug ON public.prompt_configs(slug);
|
|
371
|
+
CREATE INDEX IF NOT EXISTS idx_integrations_app_id ON public.integrations(app_id);
|
|
372
|
+
CREATE INDEX IF NOT EXISTS idx_integrations_account_id ON public.integrations(account_id);
|
|
373
|
+
CREATE INDEX IF NOT EXISTS idx_integrations_type_id ON public.integrations(type_id);
|
|
374
|
+
CREATE INDEX IF NOT EXISTS idx_integrations_slug ON public.integrations(slug);
|
|
375
|
+
CREATE INDEX IF NOT EXISTS idx_integration_routes_app_id ON public.integration_routes(app_id);
|
|
376
|
+
CREATE INDEX IF NOT EXISTS idx_integration_routes_account_id ON public.integration_routes(account_id);
|
|
377
|
+
CREATE INDEX IF NOT EXISTS idx_integration_routes_type_id ON public.integration_routes(type_id);
|
|
378
|
+
CREATE INDEX IF NOT EXISTS idx_integration_routes_slug ON public.integration_routes(slug);
|
|
379
|
+
CREATE INDEX IF NOT EXISTS idx_logs_app_id ON public.logs(app_id);
|
|
380
|
+
CREATE INDEX IF NOT EXISTS idx_logs_account_id ON public.logs(account_id);
|
|
381
|
+
CREATE INDEX IF NOT EXISTS idx_logs_type_id ON public.logs(type_id);
|
|
382
|
+
CREATE INDEX IF NOT EXISTS idx_logs_level ON public.logs(level);
|
|
383
|
+
CREATE INDEX IF NOT EXISTS idx_logs_created_by ON public.logs(created_by);
|
|
384
|
+
CREATE INDEX IF NOT EXISTS idx_logs_created_at ON public.logs(created_at);
|
|
385
|
+
CREATE INDEX IF NOT EXISTS idx_observability_app_id ON public.observability(app_id);
|
|
386
|
+
CREATE INDEX IF NOT EXISTS idx_observability_account_id ON public.observability(account_id);
|
|
387
|
+
CREATE INDEX IF NOT EXISTS idx_observability_type_id ON public.observability(type_id);
|
|
388
|
+
CREATE INDEX IF NOT EXISTS idx_observability_metric_name ON public.observability(metric_name);
|
|
389
|
+
CREATE INDEX IF NOT EXISTS idx_observability_created_at ON public.observability(created_at);
|
|
390
|
+
CREATE INDEX IF NOT EXISTS idx_test_runs_app_id ON public.test_runs(app_id);
|
|
391
|
+
CREATE INDEX IF NOT EXISTS idx_test_runs_account_id ON public.test_runs(account_id);
|
|
392
|
+
CREATE INDEX IF NOT EXISTS idx_test_runs_type_id ON public.test_runs(type_id);
|
|
393
|
+
CREATE INDEX IF NOT EXISTS idx_test_runs_slug ON public.test_runs(slug);
|
|
394
|
+
CREATE INDEX IF NOT EXISTS idx_test_cases_app_id ON public.test_cases(app_id);
|
|
395
|
+
CREATE INDEX IF NOT EXISTS idx_test_cases_account_id ON public.test_cases(account_id);
|
|
396
|
+
CREATE INDEX IF NOT EXISTS idx_test_cases_type_id ON public.test_cases(type_id);
|
|
397
|
+
CREATE INDEX IF NOT EXISTS idx_test_cases_slug ON public.test_cases(slug);
|
|
398
|
+
CREATE INDEX IF NOT EXISTS idx_ai_agents_app_id ON public.ai_agents(app_id);
|
|
399
|
+
CREATE INDEX IF NOT EXISTS idx_ai_agents_account_id ON public.ai_agents(account_id);
|
|
400
|
+
CREATE INDEX IF NOT EXISTS idx_ai_agents_type_id ON public.ai_agents(type_id);
|
|
401
|
+
CREATE INDEX IF NOT EXISTS idx_ai_agents_slug ON public.ai_agents(slug);
|
|
402
|
+
CREATE INDEX IF NOT EXISTS idx_invites_app_id ON public.invites(app_id);
|
|
403
|
+
CREATE INDEX IF NOT EXISTS idx_invites_account_id ON public.invites(account_id);
|
|
404
|
+
CREATE INDEX IF NOT EXISTS idx_invites_type_id ON public.invites(type_id);
|
|
405
|
+
CREATE INDEX IF NOT EXISTS idx_invites_slug ON public.invites(slug);
|
|
406
|
+
CREATE INDEX IF NOT EXISTS idx_api_keys_app_id ON public.api_keys(app_id);
|
|
407
|
+
CREATE INDEX IF NOT EXISTS idx_api_keys_account_id ON public.api_keys(account_id);
|
|
408
|
+
CREATE INDEX IF NOT EXISTS idx_api_keys_type_id ON public.api_keys(type_id);
|
|
409
|
+
CREATE INDEX IF NOT EXISTS idx_api_keys_slug ON public.api_keys(slug);
|
|
410
|
+
CREATE INDEX IF NOT EXISTS idx_alerts_app_id ON public.alerts(app_id);
|
|
411
|
+
CREATE INDEX IF NOT EXISTS idx_alerts_account_id ON public.alerts(account_id);
|
|
412
|
+
CREATE INDEX IF NOT EXISTS idx_alerts_type_id ON public.alerts(type_id);
|
|
413
|
+
CREATE INDEX IF NOT EXISTS idx_alerts_slug ON public.alerts(slug);
|
|
414
|
+
CREATE INDEX IF NOT EXISTS idx_item_progress_app_id ON public.item_progress(app_id);
|
|
415
|
+
CREATE INDEX IF NOT EXISTS idx_item_progress_account_id ON public.item_progress(account_id);
|
|
416
|
+
CREATE INDEX IF NOT EXISTS idx_item_progress_type_id ON public.item_progress(type_id);
|
|
417
|
+
CREATE INDEX IF NOT EXISTS idx_item_progress_slug ON public.item_progress(slug);
|
|
418
|
+
|
|
419
|
+
CREATE INDEX IF NOT EXISTS idx_account_paths_ancestor ON public.account_paths(ancestor_id);
|
|
420
|
+
CREATE INDEX IF NOT EXISTS idx_account_paths_descendant ON public.account_paths(descendant_id);
|
|
421
|
+
CREATE OR REPLACE FUNCTION public.updated_at_column()
|
|
422
|
+
RETURNS TRIGGER AS $$
|
|
423
|
+
BEGIN
|
|
424
|
+
NEW.updated_at = now();
|
|
425
|
+
RETURN NEW;
|
|
426
|
+
END;
|
|
427
|
+
$$ LANGUAGE plpgsql;
|
|
428
|
+
CREATE TRIGGER set_accounts_updated_at
|
|
429
|
+
BEFORE UPDATE ON public.accounts
|
|
430
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
431
|
+
|
|
432
|
+
CREATE TRIGGER set_people_updated_at
|
|
433
|
+
BEFORE UPDATE ON public.people
|
|
434
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
435
|
+
|
|
436
|
+
CREATE TRIGGER set_types_updated_at
|
|
437
|
+
BEFORE UPDATE ON public.types
|
|
438
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
439
|
+
|
|
440
|
+
CREATE TRIGGER set_apps_updated_at
|
|
441
|
+
BEFORE UPDATE ON public.apps
|
|
442
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
443
|
+
|
|
444
|
+
CREATE TRIGGER set_roles_updated_at
|
|
445
|
+
BEFORE UPDATE ON public.roles
|
|
446
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
447
|
+
|
|
448
|
+
CREATE TRIGGER set_items_updated_at
|
|
449
|
+
BEFORE UPDATE ON public.items
|
|
450
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
451
|
+
|
|
452
|
+
CREATE TRIGGER set_threads_updated_at
|
|
453
|
+
BEFORE UPDATE ON public.threads
|
|
454
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
455
|
+
|
|
456
|
+
CREATE TRIGGER set_messages_updated_at
|
|
457
|
+
BEFORE UPDATE ON public.messages
|
|
458
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
459
|
+
|
|
460
|
+
CREATE TRIGGER set_links_updated_at
|
|
461
|
+
BEFORE UPDATE ON public.links
|
|
462
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
463
|
+
|
|
464
|
+
CREATE TRIGGER set_attachments_updated_at
|
|
465
|
+
BEFORE UPDATE ON public.attachments
|
|
466
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
467
|
+
|
|
468
|
+
CREATE TRIGGER set_watchers_updated_at
|
|
469
|
+
BEFORE UPDATE ON public.watchers
|
|
470
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
471
|
+
|
|
472
|
+
CREATE TRIGGER set_link_types_updated_at
|
|
473
|
+
BEFORE UPDATE ON public.link_types
|
|
474
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
475
|
+
|
|
476
|
+
CREATE TRIGGER set_pipelines_updated_at
|
|
477
|
+
BEFORE UPDATE ON public.pipelines
|
|
478
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
479
|
+
|
|
480
|
+
CREATE TRIGGER set_pipeline_executions_updated_at
|
|
481
|
+
BEFORE UPDATE ON public.pipeline_executions
|
|
482
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
483
|
+
|
|
484
|
+
CREATE TRIGGER set_triggers_updated_at
|
|
485
|
+
BEFORE UPDATE ON public.triggers
|
|
486
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
487
|
+
|
|
488
|
+
CREATE TRIGGER set_timers_updated_at
|
|
489
|
+
BEFORE UPDATE ON public.timers
|
|
490
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
491
|
+
|
|
492
|
+
CREATE TRIGGER set_prompt_configs_updated_at
|
|
493
|
+
BEFORE UPDATE ON public.prompt_configs
|
|
494
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
495
|
+
|
|
496
|
+
CREATE TRIGGER set_integrations_updated_at
|
|
497
|
+
BEFORE UPDATE ON public.integrations
|
|
498
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
499
|
+
|
|
500
|
+
CREATE TRIGGER set_integration_routes_updated_at
|
|
501
|
+
BEFORE UPDATE ON public.integration_routes
|
|
502
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
503
|
+
|
|
504
|
+
CREATE TRIGGER set_logs_updated_at
|
|
505
|
+
BEFORE UPDATE ON public.logs
|
|
506
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
507
|
+
|
|
508
|
+
CREATE TRIGGER set_observability_updated_at
|
|
509
|
+
BEFORE UPDATE ON public.observability
|
|
510
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
511
|
+
|
|
512
|
+
CREATE TRIGGER set_test_runs_updated_at
|
|
513
|
+
BEFORE UPDATE ON public.test_runs
|
|
514
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
515
|
+
|
|
516
|
+
CREATE TRIGGER set_test_cases_updated_at
|
|
517
|
+
BEFORE UPDATE ON public.test_cases
|
|
518
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
519
|
+
|
|
520
|
+
CREATE TRIGGER set_embeddings_updated_at
|
|
521
|
+
BEFORE UPDATE ON public.embeddings
|
|
522
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
523
|
+
|
|
524
|
+
CREATE TRIGGER set_ai_agents_updated_at
|
|
525
|
+
BEFORE UPDATE ON public.ai_agents
|
|
526
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
527
|
+
|
|
528
|
+
CREATE TRIGGER set_invites_updated_at
|
|
529
|
+
BEFORE UPDATE ON public.invites
|
|
530
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
531
|
+
|
|
532
|
+
CREATE TRIGGER set_api_keys_updated_at
|
|
533
|
+
BEFORE UPDATE ON public.api_keys
|
|
534
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
535
|
+
|
|
536
|
+
CREATE TRIGGER set_alerts_updated_at
|
|
537
|
+
BEFORE UPDATE ON public.alerts
|
|
538
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
539
|
+
|
|
540
|
+
CREATE TRIGGER set_item_progress_updated_at
|
|
541
|
+
BEFORE UPDATE ON public.item_progress
|
|
542
|
+
FOR EACH ROW EXECUTE FUNCTION public.updated_at_column();
|
|
543
|
+
|
|
544
|
+
INSERT INTO public.apps (id, slug, name, description, version, app_type, source, is_active, is_system, renderer, route_prefix)
|
|
545
|
+
VALUES (
|
|
546
|
+
gen_random_uuid(),
|
|
547
|
+
'spine-core',
|
|
548
|
+
'Spine Core',
|
|
549
|
+
'Core Spine runtime - provides accounts, people, items, threads, messages, links, attachments, watchers',
|
|
550
|
+
'1.0.0',
|
|
551
|
+
'system',
|
|
552
|
+
'builtin',
|
|
553
|
+
true,
|
|
554
|
+
true,
|
|
555
|
+
'none',
|
|
556
|
+
NULL
|
|
557
|
+
)
|
|
558
|
+
ON CONFLICT (slug) DO NOTHING;
|
|
559
|
+
INSERT INTO public.apps (
|
|
560
|
+
id, slug, name, description, icon, color, version,
|
|
561
|
+
app_type, source, config, nav_items, min_role,
|
|
562
|
+
is_active, is_system, route_prefix, renderer
|
|
563
|
+
)
|
|
564
|
+
VALUES (
|
|
565
|
+
gen_random_uuid(),
|
|
566
|
+
'admin',
|
|
567
|
+
'Admin',
|
|
568
|
+
'Spine system administration interface',
|
|
569
|
+
'settings',
|
|
570
|
+
'slate',
|
|
571
|
+
'1.0.0',
|
|
572
|
+
'system',
|
|
573
|
+
'builtin',
|
|
574
|
+
'{}'::jsonb,
|
|
575
|
+
'[]'::jsonb,
|
|
576
|
+
'system_admin',
|
|
577
|
+
true,
|
|
578
|
+
true,
|
|
579
|
+
'/admin',
|
|
580
|
+
'custom'
|
|
581
|
+
)
|
|
582
|
+
ON CONFLICT (slug) DO UPDATE SET
|
|
583
|
+
route_prefix = EXCLUDED.route_prefix,
|
|
584
|
+
renderer = EXCLUDED.renderer,
|
|
585
|
+
min_role = EXCLUDED.min_role,
|
|
586
|
+
is_system = EXCLUDED.is_system,
|
|
587
|
+
app_type = EXCLUDED.app_type;
|
|
588
|
+
CREATE INDEX IF NOT EXISTS idx_embeddings_account_id ON public.embeddings(account_id);
|
|
589
|
+
CREATE INDEX IF NOT EXISTS idx_embeddings_document_id ON public.embeddings(document_id);
|
|
590
|
+
CREATE INDEX IF NOT EXISTS idx_embeddings_model_doc ON public.embeddings(model_id, document_id);
|
|
591
|
+
CREATE INDEX IF NOT EXISTS idx_embeddings_active ON public.embeddings(account_id, document_id) WHERE approved_at IS NOT NULL AND revoked_at IS NULL;
|
|
592
|
+
CREATE INDEX IF NOT EXISTS idx_embeddings_embedding_hnsw_idx ON public.embeddings USING hnsw (embedding vector_cosine_ops) WITH (m = 16, ef_construction = 64);
|
|
593
|
+
|
|
594
|
+
-- Enable Row Level Security on all tenant tables
|
|
595
|
+
|
|
596
|
+
ALTER TABLE public.accounts ENABLE ROW LEVEL SECURITY;
|
|
597
|
+
ALTER TABLE public.people ENABLE ROW LEVEL SECURITY;
|
|
598
|
+
ALTER TABLE public.types ENABLE ROW LEVEL SECURITY;
|
|
599
|
+
ALTER TABLE public.apps ENABLE ROW LEVEL SECURITY;
|
|
600
|
+
ALTER TABLE public.roles ENABLE ROW LEVEL SECURITY;
|
|
601
|
+
ALTER TABLE public.items ENABLE ROW LEVEL SECURITY;
|
|
602
|
+
ALTER TABLE public.threads ENABLE ROW LEVEL SECURITY;
|
|
603
|
+
ALTER TABLE public.messages ENABLE ROW LEVEL SECURITY;
|
|
604
|
+
ALTER TABLE public.links ENABLE ROW LEVEL SECURITY;
|
|
605
|
+
ALTER TABLE public.attachments ENABLE ROW LEVEL SECURITY;
|
|
606
|
+
ALTER TABLE public.watchers ENABLE ROW LEVEL SECURITY;
|
|
607
|
+
ALTER TABLE public.link_types ENABLE ROW LEVEL SECURITY;
|
|
608
|
+
ALTER TABLE public.pipelines ENABLE ROW LEVEL SECURITY;
|
|
609
|
+
ALTER TABLE public.pipeline_executions ENABLE ROW LEVEL SECURITY;
|
|
610
|
+
ALTER TABLE public.triggers ENABLE ROW LEVEL SECURITY;
|
|
611
|
+
ALTER TABLE public.trigger_executions ENABLE ROW LEVEL SECURITY;
|
|
612
|
+
ALTER TABLE public.timers ENABLE ROW LEVEL SECURITY;
|
|
613
|
+
ALTER TABLE public.prompt_configs ENABLE ROW LEVEL SECURITY;
|
|
614
|
+
ALTER TABLE public.integrations ENABLE ROW LEVEL SECURITY;
|
|
615
|
+
ALTER TABLE public.integration_routes ENABLE ROW LEVEL SECURITY;
|
|
616
|
+
ALTER TABLE public.logs ENABLE ROW LEVEL SECURITY;
|
|
617
|
+
ALTER TABLE public.observability ENABLE ROW LEVEL SECURITY;
|
|
618
|
+
ALTER TABLE public.test_runs ENABLE ROW LEVEL SECURITY;
|
|
619
|
+
ALTER TABLE public.test_cases ENABLE ROW LEVEL SECURITY;
|
|
620
|
+
ALTER TABLE public.embeddings ENABLE ROW LEVEL SECURITY;
|
|
621
|
+
ALTER TABLE public.ai_agents ENABLE ROW LEVEL SECURITY;
|
|
622
|
+
ALTER TABLE public.invites ENABLE ROW LEVEL SECURITY;
|
|
623
|
+
ALTER TABLE public.api_keys ENABLE ROW LEVEL SECURITY;
|
|
624
|
+
ALTER TABLE public.alerts ENABLE ROW LEVEL SECURITY;
|
|
625
|
+
ALTER TABLE public.item_progress ENABLE ROW LEVEL SECURITY;
|
|
626
|
+
ALTER TABLE public.account_paths ENABLE ROW LEVEL SECURITY;
|
|
627
|
+
ALTER TABLE public.system_settings ENABLE ROW LEVEL SECURITY;
|
|
628
|
+
ALTER TABLE public.webhook_handlers ENABLE ROW LEVEL SECURITY;
|
|
629
|
+
ALTER TABLE public.webhook_deliveries ENABLE ROW LEVEL SECURITY;
|
|
630
|
+
ALTER TABLE public.api_key_usage_logs ENABLE ROW LEVEL SECURITY;
|