This repository contains essential resources for migrating a legacy database to a modern Postgres environment, with a focus on internationalization support.
schema.sql- A Postgres-compatible schema for setting up an empty database.schema_sqlite.sql- A SQLite-compatible schema for setting up an empty database. This schema can be used for unit testing.migrated_data.sql- Migrated data from the legacy database using the new table format. This script should be run afterschema.sql.
legacy_database.sql- A copy of the existing legacy database. This script is only here as a reference and is not compatible with the latest version of backend services.alter_competence_table.sql- SQL script to update the schema of the competence table to support internationalization.
To migrate your database to Heroku Postgres, follow these steps. It is assumed that you have Heroku CLI installed and are logged in to your Heroku account.
-
Create a new Heroku app:
heroku create <app-name>
-
Add Heroku Postgres as an add-on:
heroku addons:create heroku-postgresql:mini --app <app-name>
-
Retrieve the database add-on name:
heroku pg:info --app <app-name>
-
Create tables:
heroku pg:psql <add-on-name> --app <app-name> < schema.sql
-
Load existing data:
heroku pg:psql <add-on-name> --app <app-name> < migrated_data.sql
-
Connect to database:
heroku pg:psql <add-on-name> --app <app-name>