Sorry, it looks like I suck at branches... I started a new branch from brutasse:error-messages (previous pull request) instead of master. This request is for the last 3 commits, let me know if I should apply them to a fresh branch instead.
I've been playing with comparedb and I find this feature really nifty. I had 2 issues to get it to work:
my local postgres install only accepts the 'postgres' user and won't create a UTF8 database if I don't pass it a specific template. I added an optional NASHVEGAS settings that lets the user specify his own commands with custom arguments. I've been hesitating between making this setting a command-line option but it's quite simple this way and falls back to simple createdb, dropdb and pg_dump calls if no setting is provided. (otherwise I'd have to map the management command's options with the postgres command, inevitably forgetting some use cases).
Once I got comparedb working it wasn't outputting anything when I changed something in the models. Maybe I'm getting this wrong but I think comparedb should compare the current database with a fresh database created with syncdb. A switch to syncdb for the _compare-suffixed database properly shows missing indices, columns, tables and constraints.
Sorry, it looks like I suck at branches... I started a new branch from brutasse:error-messages (previous pull request) instead of master. This request is for the last 3 commits, let me know if I should apply them to a fresh branch instead.
I've been playing with comparedb and I find this feature really nifty. I had 2 issues to get it to work:
createdb
,dropdb
andpg_dump
calls if no setting is provided. (otherwise I'd have to map the management command's options with the postgres command, inevitably forgetting some use cases).comparedb
should compare the current database with a fresh database created withsyncdb
. A switch to syncdb for the_compare
-suffixed database properly shows missing indices, columns, tables and constraints.Let me know what you think, Bruno