Fantasia flatten database schemas

From vishiri/fantasia-archive · View interactive version

Fantasia flatten database schemas is an AI agent skill from the GitHub repository vishiri/fantasia-archive. Collapses .faproject SQLite PRAGMA user_version ladders into a single bootstrap schema (procedure sets max to 1) during pre-release dev resets. Use when the user asks to flatten database schemas, reset migrations, or squash schema versions before wider release.

How to use this skill

Skill file

Flatten database schemas (`.faproject`)

When to use

Live repo today

Target after flatten (procedure outcome)

Flatten procedure (checklist)

  1. Read docs/database/projectDB.md; list tables/columns/indexes to keep
  2. Merge DDL into faProjectDbSchemaDdl.ts (applyFaProjectProjectDataSchemaV1, applyFaProjectContentSchemaV1)
  3. Simplify faProjectDbMigrateWiring.ts — max version 1, remove legacy steps
  4. Delete obsolete migration-only helpers
  5. Rewrite _tests/faProjectDbMigrate.vitest.test.ts; update DDL tests
  6. Docs: projectDB.md, templateCustomFields.md, AGENTS.md, README.md if needed
  7. Changelog: older dev .faproject must be recreated (current package.json version only)
  8. Full yarn testbatch:verify before commit (schema squash touches electron + docs + broad tests)

Adding migrations again (after flatten)

  1. Bump FA_PROJECT_USER_VERSION_SUPPORTED_MAX
  2. Add applyFaProjectContentSchemaV2 or migrateProjectDataV1ToV2
  3. Chain in applyFaProjectMigrations
  4. Update projectDB.md + tests

No long historical ladder unless real user upgrades require it.

Related

Types

Shared types → types/. See types-folder.mdc.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.