diff --git a/scripts/migration.sql b/scripts/migration.sql index ac89117..9b89cf3 100644 --- a/scripts/migration.sql +++ b/scripts/migration.sql @@ -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