Skip to content

Instantly share code, notes, and snippets.

@EmmanuelKasper
Last active May 10, 2016 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EmmanuelKasper/04d40bfd8e82fac3144e7a2cc2b2fe1b to your computer and use it in GitHub Desktop.
Save EmmanuelKasper/04d40bfd8e82fac3144e7a2cc2b2fe1b to your computer and use it in GitHub Desktop.
Create an evolution script for the play framework based on pg_dump
# after that you need to insert # --- !Ups on top of the generated file
echo '# --- !Ups' > conf/evolutions/default/2.sql
# column inserts are needed in case of new model properties
# we keep only the insert statements, pg_dump comments confuse ebean/play
pg_dump --column-inserts \
--inserts --data-only --exclude-table=play_evolutions \
--username popcon -h localhost popcon \
| grep '^INSERT INTO' \
>> conf/evolutions/default/2.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment