diff --git a/Guide/database.markdown b/Guide/database.markdown index ad11bdf02..954c42328 100644 --- a/Guide/database.markdown +++ b/Guide/database.markdown @@ -92,6 +92,10 @@ You can also update the database while keeping its contents. When dumping the database into the `Fixtures.sql` first and then rebuilding the database with the dump, the contents will be kept when changing the schema. +### Transferring/Backing Up DB + +To have the full database dumped in a portable manner, you can do `make sql_dump > /tmp/my_app.sql`, which will generate a full SQL database dump, without owner or ACL information. + ## Haskell Bindings ### Model Context diff --git a/lib/IHP/Makefile.dist b/lib/IHP/Makefile.dist index 5358d4cb4..6a3ca2890 100644 --- a/lib/IHP/Makefile.dist +++ b/lib/IHP/Makefile.dist @@ -123,6 +123,9 @@ dumpdb: dump_db ## Saves the current database state into the Fixtures.sql dump_db: ## Saves the current database state into the Fixtures.sql pg_dump -a --inserts --column-inserts --disable-triggers -h $$PWD/build/db app | sed -e '/^--/d' > Application/Fixtures.sql +sql_dump: ## Saves the current database state, so it can dumped into an SQL file `make sql_dump > dump.sql` + @pg_dump --no-owner --no-acl -h $$PWD/build/db app | sed -e '/^--/d' + build/Generated/Types.hs: Application/Schema.sql ## Rebuilds generated types mkdir -p build/Generated build-generated-code