karenc / db-migrator

GNU Affero General Public License v3.0
4 stars 5 forks source link

Log warning message for "list" if schema_migrations table doesn't exist #23

Closed karenc closed 8 years ago

karenc commented 8 years ago

For "list", we'll output a warning message showing the error from postgres, and continue with the listing of migrations.

For "migrate" and "rollback", we want to make sure schema_migrations exist and error before running the migrations.

Slightly modified version of #17.

mmulich commented 8 years ago

Raising a finer-grained exception rather than use the raise_error parameter might be better? This way you can catch it if you'd like or ignore it if you don't. It's a matter of preference, but I like to think exceptions should bubble up. Then you can do things with the exception from the cli layer, much like the view layer in web apps, that are specific to that medium / layer of representation. For example, If we ever put db-migrator into an admin interface, the logging message isn't really going to help out since it most likely won't be seen by the user. So handling the exception from the representation layer would be better in my opinion.

I think this solves the immediate need. :+1:

reedstrm commented 8 years ago

:bump: This is going to happen in production for the first rollout. I'd rather not have an expected error to explain to Devops.