mix scoria.dev.db (scoria v0.1.2)

Copy Markdown View Source

Dev-only database setup for the local dashboard harness.

Plain mix ecto.migrate cannot stand up a fresh Scoria database: the core and knowledge migration sets are interleaved by foreign-key dependencies and even share a version number (20260511000300), tracked in separate schema_migrations tables via the test-support migration helper.

Required order on a fresh DB:

  1. enable the vector extension (the knowledge hnsw index needs it)
  2. core migrations UP TO (excluding) create_semantic_cache_tables — creates ai_traces / ai_spans / ai_workflow_runs, which the knowledge migration's FKs reference
  3. knowledge migrations — creates ai_retrieval_runs
  4. the remaining core migration (create_semantic_cache_tables), whose FK references ai_retrieval_runs

This task lives under dev/ and is compiled only in :dev — it never ships to Hex. Used by mix dev.setup and the Docker entrypoint.