You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: templates/README.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,37 @@ You likely want to run processes dependent on your backend codebase; so the imag
47
47
As per the image attribute noted above, you will likely be running custom arguments in the context of that image.
48
48
You should specify those arguments [as per the documentation](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/).
49
49
50
+
## Database Migration
51
+
Database migrations are handled with [Flyway](https://flywaydb.org/). Migrations run in a docker container started in the Kubernetes cluster by CircleCI or the local dev environment startup process.
52
+
53
+
The migration job is defined in `kubernetes/migration/job.yml` and your SQL scripts should be in `database/migration/`.
54
+
Migrations will be automatically run against your dev environment when running `./start-dev-env.sh`. After merging the migration it will be run against other environments automatically as part of the pipeline.
55
+
56
+
The SQL scripts need to follow Flyway naming convention [here](https://flywaydb.org/documentation/concepts/migrations.html#sql-based-migrations), which allow you to create different types of migrations:
57
+
* Versioned - These have a numerically incrementing version id and will be kept track of by Flyway. Only versions that have not yet been applied will be run during the migration process.
58
+
* Undo - These have a matching version to a versioned migration and can be used to undo the effects of a migration if you need to roll back.
59
+
* Repeatable - These will be run whenenver their content changes. This can be useful for seeding data or updating views or functions.
0 commit comments