Closed mmulich closed 8 years ago
I think this is because there's a development.ini
in the current working directory, which is the default location for the config file, and the development.ini
has a db-connection-string
setting so dbmigrator init
is happy and actually did something. (I guess it should've printed something :stuck_out_tongue:)
If you do this in a directory that doesn't have a development.ini
:
karen@trusty:~$ dbmigrator init
Traceback (most recent call last):
File "/usr/local/bin/dbmigrator", line 9, in <module>
load_entry_point('db-migrator==0.0.1', 'console_scripts', 'dbmigrator')()
File "/usr/local/lib/python2.7/dist-packages/db_migrator-0.0.1-py2.7.egg/dbmigrator/cli.py", line 57, in main
return args['cmmd'](**args)
File "/usr/local/lib/python2.7/dist-packages/db_migrator-0.0.1-py2.7.egg/dbmigrator/utils.py", line 60, in wrapper
raise Exception('db-connection-string missing')
Exception: db-connection-string missing
^ Will now print a message: Schema migrations initialized.
after running dbmigrator init
:)
Do you want the default behavior to change?
Yes, I think the default behavior should change. I was not excepting this general purpose tool to have an awareness of our configuration file structure. Let's try not to closely mimic the CWD behavioral assumption that rake and django use.
Removed default config path (development.ini)
We need to return an error when the user fails to supply settings for the database connection.
For example:
So it worked, right? :wink: