Skip to content

Track schema/index bootstrap SQL migration cleanup #12

@oritwoen

Description

@oritwoen

Context

PR #9 review highlighted that idx_observations_project_input_hash was added in runtime bootstrap SQL (CUSTOM_SQL) instead of through drizzle migrations.

Why this matters

  • Schema-affecting changes are easier to audit when represented in migration history
  • Current runtime SQL includes multiple indexes and triggers created outside drizzle migration files

Scope

  • Inventory runtime bootstrap SQL in src/index.ts
  • Decide which statements should move to drizzle migrations versus remain runtime bootstrap
  • Move eligible statements into migrations and keep startup idempotent
  • Add or update tests to cover migration path for existing databases

Notes

This is intentionally scoped as follow-up to avoid mixing larger schema-process refactors into PR #9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorCode restructuring without behavior changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions