Skip to content

Execute DB init scrip from migration path #349

@indpurvesh

Description

@indpurvesh

We need to consolidate all database initialization logic so that it runs consistently through our existing migration framework. Currently, some DB init scripts (e.g., schema bootstrap, seed data, initial configuration values) are executed manually or stored outside the migration workflow, which creates inconsistency between environments.

To ensure reliable and repeatable environment setup, all database init scripts must be placed in the migrations/ directory and executed as part of the standard migration pipeline.
Requirements

Move all existing DB initialization scripts (schema setup, lookup data, seed data, etc.) into the migrations/ folder using our standard naming conventions.

  • Ensure scripts run automatically during the migration execution step for all environments (local, dev, staging, production).
  • Verify that migration ordering guarantees idempotency and avoids duplication.
  • Ensure the migration engine can detect and run these initial scripts on fresh deployments.
  • Update documentation to reflect the new workflow for adding and running init scripts.

Acceptance Criteria

  • All current DB init scripts live in the migrations/ folder.
  • A new deployment on a clean database successfully initializes the schema and seed data via migrations only.
  • CI/CD environment setup works without manual SQL execution.
  • Developers can bring up a local environment with a clean DB using only migrations.
  • Documentation updated to describe how to add and execute init scripts.

**** Notes / Additional Context

This change removes the need for any manual SQL run steps during setup.
Ensure backward compatibility with existing environments by creating idempotent or versioned migration scripts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions