paltman-archive / nashvegas

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

Better Error message when migration can not be loaded #17

Closed issackelly closed 12 years ago

issackelly commented 13 years ago

I only have migrations that start with numbers (0042_something - 0050_something) but I'm still getting this message:

Traceback (most recent call last):
  File "manage.py", line 27, in <module>
    execute_from_command_line()
  File "/Users/issackelly/virtualenvs/po2-winwin/lib/python2.7/site-packages/django/core/management/__init__.py", line 429, in execute_from_command_line
    utility.execute()
  File "/Users/issackelly/virtualenvs/po2-winwin/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/issackelly/virtualenvs/po2-winwin/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/issackelly/virtualenvs/po2-winwin/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Users/issackelly/virtualenvs/po2-winwin/lib/python2.7/site-packages/nashvegas/management/commands/upgradedb.py", line 272, in handle
    self.execute_migrations(show_traceback=True)
  File "/Users/issackelly/virtualenvs/po2-winwin/lib/python2.7/site-packages/django/db/transaction.py", line 338, in _commit_manually
    return func(*args, **kw)
  File "/Users/issackelly/virtualenvs/po2-winwin/lib/python2.7/site-packages/nashvegas/management/commands/upgradedb.py", line 135, in execute_migrations
    migrations = self._filter_down()
  File "/Users/issackelly/virtualenvs/po2-winwin/lib/python2.7/site-packages/nashvegas/management/commands/upgradedb.py", line 79, in _filter_down
    raise MigrationError("Invalid migration file prefix (must begin with a number)")
nashvegas.management.commands.upgradedb.MigrationError: Invalid migration file prefix (must begin with a number)

I'd really like to see what it's trying to parse, which migration, etc, that it can't determine is a number.

paltman commented 12 years ago

I know it's been a year now since you opened this @issackelly but wanted to let you know, in case you happened to still care about this issue after all this time, that the error message does now include the name of the file.