Commit graph

8 commits

Author SHA1 Message Date
Pierre-Yves Chibon
64fdf441d1 Add queries to fix the ownership and the foreign key on user_messages
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-02-03 15:09:46 +01:00
Pierre-Yves Chibon
fd25669785 Adjust the migration.sql script to use range partition instead of list
This allows to partition on the primary key and have all the partitions
be of the same size, instead of having them be by year with different
sizes.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-02-01 14:54:51 +01:00
Will Woods
da5e593171 Fix SQL table constraints to work with partitioned table
Partitioned table constraints like UNIQUE or PRIMARY KEY have to include
the table's partition key. This commit moves the constraints into the
CREATE TABLE statement and adds the partition key to those indexes.
2021-01-26 13:21:50 -05:00
Pierre-Yves Chibon
9344d7eaf4 Add a couple of information/commands on the migration.sql
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-01-26 15:27:31 +01:00
Pierre-Yves Chibon
a84d763068 Add a default table to the partition
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-01-25 16:20:48 +01:00
Pierre-Yves Chibon
115d58d385 Don't assume all the messages have a year, at least for now
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-01-25 15:14:47 +01:00
Pierre-Yves Chibon
eadb27c640 Adjust the how to save the year in the messages table
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-01-25 15:14:00 +01:00
Pierre-Yves Chibon
b189c95395 Add first work on the migration SQL file to partition the DG DB
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-01-25 15:13:10 +01:00