Commit Graph

163 Commits

Author SHA1 Message Date
fabianlindfors
86f77f497c Add generate-schema-query command 2021-11-11 20:47:07 +01:00
fabianlindfors
a04f94ff97 Add Postgres connection options to CLI 2021-11-11 20:36:37 +01:00
fabianlindfors
a407a2d809 Run backfills in batches
Previously a simple UPDATE query was used to backfill the table. This
causes excessive locking and is inefficient on large tables. Now we
instead run backfills in batches of a thousand rows. The batches are
determined based on primary key and iterated in ascending order.
2021-11-09 00:53:24 +01:00
fabianlindfors
e27be94619 Add primary key to schema
We need to know the primary key to perform efficient batch updates.
2021-11-08 23:49:49 +01:00
fabianlindfors
78d8aabd5b Enable composite primary keys when creating table
Also makes the primary key a mandatory field. We'll need primary keys in
order to perform efficient batch updates later.
2021-11-08 23:32:14 +01:00
fabianlindfors
40d16c3367 Move new migrations to InProgress status
Previously the new migrations were directly added to the migrations
lists. Now they are instead added to a vector in the InProgress status
and moved to the migrations list once the migration is complete.

Another status should be added later to indicate that a migration is
currently being applied. Right now, if a migration fails and then the
migrations are changed before being retried, there could be some
dangling changes.
2021-11-08 00:09:30 +01:00
fabianlindfors
23034f2198 Add new migration for creating indices 2021-10-27 00:55:29 +02:00
fabianlindfors
0762a5025a Add missing headings to README 2021-10-27 00:19:29 +02:00
fabianlindfors
03a4180409 Update README with working TOC 2021-10-27 00:15:54 +02:00
fabianlindfors
c27afadbd2 Add foreign keys option to create table migration 2021-10-27 00:10:02 +02:00
fabianlindfors
10699fa46c Add primary key option to create table migration 2021-10-26 23:00:18 +02:00
fabianlindfors
acf7c15448 Add command to abort migration 2021-10-26 00:32:37 +02:00
fabianlindfors
7d8302a0a4 Initial commit 2021-10-26 00:31:09 +02:00