Add a couple of information/commands on the migration.sql

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2021-01-26 15:27:31 +01:00
parent a84d763068
commit 9344d7eaf4

View file

@ -1,3 +1,5 @@
\timing on
-- Update the current messages table so it stores the year that we'll partition
-- on.
@ -5,6 +7,8 @@ ALTER TABLE messages ADD COLUMN year integer;
update messages set year = extract(year from timestamp);
-- Schema extracted using:
-- sudo -u postgres pg_dump -t 'public.messages' --schema-only datanommer
-- Create the messages2 table that will be partitioned and will have the messages
-- moved to