icefoganalytics / elcc-data-management

Data Management application for Education's Early Learning Child Centre
Apache License 2.0
0 stars 0 forks source link

Dev Tooling: Automate the Migration and Seeding Process of the Database #10

Closed klondikemarlen closed 1 year ago

klondikemarlen commented 1 year ago

Relates to https://github.com/icefoganalytics/elcc-data-management/issues/3

Context

Currently initial database creation and the running of migrations and seeds are all manual processes. This PR automates database creation and the running of migrations and seeds.

Questions

Implementation

  1. Create a database initialization pipeline that waits for the database to spin up, then runs the SQL to create the database.
  2. Run migrations on api service start.
  3. Run seeds on api service start.

Screenshots

Migrations and tables image

Seeds in "centers" table image

Testing Instructions

  1. Run dev down -v to drop all services and databases for this project.
  2. Run dev up --build to create the new database and run migrations and seeds.
  3. Open your database manager and check that the appropriate tables exist and all migration have run.
  4. Check that all seeds have run as well.
  5. Open the app and check that you can log in.