diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-23 15:43:41 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-30 13:28:47 +0300 |
commit | dc54c84f07f83852a33d5140eb3c46a0d9139dfb (patch) | |
tree | ed13f3795c5434ce03d8388818f267a942ad74c5 /_support/gitlab-test.git-packed-refs | |
parent | 1df76cd4ecf6c640389b05e5910793786281b930 (diff) |
praefect: Track database schema in Git
Given that our Praefect database schema is seeded by migrations, there
is no single place which gives an overview over the complete schema.
While this is information that can be easily obtained by connecting to a
Praefect database, this workaround doesn't really work across different
Praefect versions given that one would have to re-seed the database for
each version one is about to investigate. This makes it hard to get info
about the current database schema and to compare changes to the schema
between different versions.
Introduce a new script "generate-praefect-schema" to fix this issue. The
script connects to a Postgres server, creates a new database, seeds the
database by executing `praefect sql-migrate` and then dumps the
resulting schema. Furthermore, a new Makefile target automates this and
writes the dump into our `_support` directory.
The intent is that whenever the database changes, the author of those
changes must update the schema in our `_support` folder such that it's
easily possible to diff the schema across different versions in our Git
history.
To ensure that the schema is always up to date, a new CI job is added
which performs the dump and then checks that no changes occurred.
Diffstat (limited to '_support/gitlab-test.git-packed-refs')
0 files changed, 0 insertions, 0 deletions