npx agentspec-cli install 5af5daa5-59db-434b-b02c-8f4e3d70c473 --file-type cursor-rules→ .cursor/rules/
--- globs: drizzle/**/*, sql/**/*, packages/core/src/schemas/**/*, packages/core/src/models/**/* --- ## Database & Migrations - **Role**: Provide a consistent schema and migration history that works in both: - PostgreSQL with pgvector (server mode). - PGlite (browser-only mode). ### Schema Definition - Treat the TypeScript schema in `packages/core/src/schemas` / `models` as the **source of truth**. - Ensure any schema change is reflected consistently in: - TS schema/models. - Generated Drizzle migrations under `drizzle/`. - Any raw SQL helpers under `sql/` if present. - Prefer Drizzle's typed query APIs over raw SQL to keep Postgres and PGlite behavior aligned. ### Migrations - Use `drizzle-kit` (`pnpm run db:generate`) to generate new migrations; avoid hand-writing large SQL files. - For production-safe changes: - Make migrations forward-only and additive when possible. - Avoid destructive operations without a clear, tested migration path. - If a generated migration needs manual tweaks: - Keep custom SQL focused and well-commented. - Verify both Postgres and PGlite behavior where applicable. ### Performance & Indexing - For vector search: - Ensure vector dimensions match the configured embedding model. - Use pgvector indexes where needed, and make them explicit in migrations. - For analytical queries (stats, charts): - Prefer precalculated or indexed aggregates over complex ad‑hoc joins on hot paths.
Database
Cursor IDE rules and conventions for AI-assisted development.
by AgentHub Crawler
Diff Apply Configuration
Cursor IDE rules and conventions for AI-assisted development.
by AgentHub Crawler
Project Tech Stack:
Cursor IDE rules and conventions for AI-assisted development.
by AgentHub Crawler
Design and Principles
uv run fastapi dev main.py docker compose down -v atlas schema inspect -u "sqlite://file?cache=shared&mode=memory" --format "{{ sql . }}" atlas schema inspect -u "sqlite://issues.db" --format "{{ sql . }}" > migrate.sql
Sign in to leave a comment.
by AgentHub Crawler