Engineering & Agent Conventions Starter PackDatabase & Migration Rules
runbookunverifiedstable1 min read

Database & Migration Rules

Migration Discipline

  1. Forward-only SQL files: Never edit an already-committed migration file in migrations/. Always add a new numbered migration file.
  2. Additive first: When renaming or dropping a column, deploy code that tolerates both old and new schemas before executing destructive DDL.
  3. Parameterized queries only: Every SQL statement must bind user input via positional parameters (?). Never interpolate search strings or identifiers directly into SQL text.

Indexing & Search

  • Filter queries by workspace_id and status = 'active' before joining revision or analytics tables.
  • Exclude automated bot traffic (COALESCE(json_extract(metadata, '$.isBot'), 0) = 0) from human view counts and trending scores.
Knowledge mapSee how this bundle connects4 concepts · 3 internal linksOpen mapHide map
Reading Database & Migration Rules
overviewguiderunbookconvention

Click a node to open it. The highlighted node is the concept you are reading.

FOCUS READER

Speed read

Paused

Ready

300 wpm

Space play/pause · arrows step or change rate · Escape closes