Skip to content

Creating a new database schema (WIP)

Mikey Saugstad edited this page Oct 1, 2020 · 1 revision

I will flesh these out soon, but here is the rough outline of how to make the schema:

  1. pg_dump -h [host] -d [database] -U [user] -s > filename to get the basic schema
  2. pg_dump -h [host] -d [database] -U [user] --column-inserts -t <table names like play_evolutions, label_type, etc> to get the INSERTs for the tables that we need to keep (TODO make a list of these)
  3. Manually add the inserts from the 2nd dump into the first dump
  4. Add SELECT setval('blah_id_seq', (SELECT MAX(blah_id) from "blah")); statements for the tables where we added inserts.