Files
Primora/apps/backend/db/migrations/00003_db_connections.sql
T
Tomas Dvorak 627bd89d5e feat: phase 2 databases via DBX (v0.3.0)
- dbx-mcp persistent stdio subprocess in Go backend (internal/dbx),
  lazy start + single retry, tool failures surface as 502
- core.db_connections registry: per-project connections, credentials
  server-side only, managed entries protected (409)
- platform-postgres + platform-dragonfly auto-register per project
- REST proxy: list/create/delete/test, databases, tables, describe,
  schema context, SQL query, redis command
- Databases page: connection list, schema/table browser, column
  inspector, SQL editor with result grid + row detail, redis console
- backend image moved to debian-slim for glibc; pinned dbx release
  with SHA256 verification

Authored By: TDvorak <[email protected]>
2026-09-16 14:54:33 +02:00

19 lines
648 B
SQL

-- +goose Up
CREATE TABLE core.db_connections (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
project_id UUID NOT NULL REFERENCES core.projects(id) ON DELETE CASCADE,
name TEXT NOT NULL,
db_type TEXT NOT NULL,
config JSONB NOT NULL DEFAULT '{}'::jsonb,
is_managed BOOLEAN NOT NULL DEFAULT FALSE,
created_by_user_id UUID REFERENCES core.users(id) ON DELETE SET NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE (project_id, name)
);
CREATE INDEX idx_db_connections_project_id ON core.db_connections(project_id);
-- +goose Down
DROP TABLE IF EXISTS core.db_connections;