paltman-archive / nashvegas

Another database migration script runner for Django projects.
http://paltman.github.com/nashvegas
MIT License
97 stars 18 forks source link

Inconsistency between NASHVEGAS docs & code #28

Closed ptoal closed 12 years ago

ptoal commented 12 years ago

The docs show an example:

NASHVEGAS = { "createdb": "createdb -U postgres -T template0 -E UTF8", "dropdb": "dropdb -U postgres", "pg_dump": "pg_dump -U postgres", }

But this won't actually execute properly. The issue is that the code doesn't create the right commands. eg: def setup_database(self): command = "createdb %s" % self.name if NASHVEGAS and "createdb" in settings.NASHVEGAS: command = settings.NASHVEGAS["createdb"] Popen(command.split()).wait()

If you don't specify the NASHVEGAS settings, it tries to execute a command like: createdb mydb_compare
(where mydb_compare is generated, or passed as an option on the CLI)

If you specify NASHVEGAS["createdb"] as in the example, you get: createdb -U postgres -T template0 -E UTF8 (no DB name provided)

I believe the "fix" is to have code similar to the following (for setup_database, teardown_database, and handle) command = settings.NASHVEGAS["createdb"] + " %s" % self.name

Comments?

paltman commented 12 years ago

@ptoal This has been fixed for a while now I think. Sorry I am so late responding to this issue. Thanks.