Scripts
The @frame/models package centralizes PostgreSQL interaction through Drizzle ORM. The package.json scripts cover schemas, migrations, seeds, and utilities.
Always run with the workspace filter:
pnpm -F @frame/models <script>Database Operations (Drizzle)
Section titled “Database Operations (Drizzle)”pnpm db:push: Syncs the Drizzle schema with the local database. Useful for fast iteration.pnpm db:generate: Generates SQL migrations from the schemas insrc/.pnpm db:migrate: Applies pending migrations.pnpm db:seed: Runs the seed pipeline by environment profile (see below).pnpm db:studio: Opens Drizzle Studio in the browser.
Seed profiles and provisioning
Section titled “Seed profiles and provisioning”packages/models/scripts/seed/ organizes persistence modules by execution profile. Every
module is registered in the index.ts belonging to its directory.
| Directory | Execution profile |
|---|---|
shared/ | Every environment |
development/ | Local and test environments |
production/ | Staging and production environments |
Folder placement is the source of truth for execution. Individual modules do not declare their own profiles.
Seed modules perform authentication-independent persistence operations and converge through database uniqueness constraints.
The production migrator applies pending migrations, then shared and production modules.
FRAME registers the canonical cat breed catalog under shared/, so every db:seed execution
upserts its stable entries without creating identities, organizations, memberships, or other
demo records.
Commands
Section titled “Commands”pnpm -F @frame/models db:seed
# Destructive database reset remains development-only.pnpm -F @frame/models db:seed -- --resetpnpm -F @frame/models db:seed -- --confirm --env=stagingpnpm -F @frame/models db:seed -- --confirm --env=production- Apply migrations with
pnpm -F @frame/models db:migrate. 2. Rundb:seedwith the intended environment profile. 3. Create the FRAME Administrator withpnpm bootstrap. Interactive terminals prompt for email and a hidden password. Automated environments usepnpm bootstrap -- --email <address>and provide the password through secure stdin,FRAME_BOOTSTRAP_PASSWORD, or--generate-password. 4. Use the administrative Provisioning screen for demo environments and initial datasets.
How to add a seed module
Section titled “How to add a seed module”- Create a cohesive
SeedModuleundershared/,development/, orproduction/. - Register it in that directory’s
index.ts. - Declare
dependsOnwhen another module must run first. - Keep shared and production writes convergent; keep authentication-dependent data in server provisioning templates.
Visual Analysis Tools
Section titled “Visual Analysis Tools”pnpm db:viz: Interactive schema visualizer (Drizzle Lab).pnpm db:viz-gen: Static structural report of relations.
Testing and Quality
Section titled “Testing and Quality”pnpm test: Vitest (Zod schemas, utilities, seed logic).pnpm lint: oxlint.pnpm type-check: TypeScript (tsc) without emit.