Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2016-03-29 09:44:34 -0700
committerChristopher Allan Webber <cwebber@dustycloud.org>2016-03-29 09:44:34 -0700
commite47ed5c81ceb9979edc42a678d635efcc4607528 (patch)
tree6511d244000882f11123e34d673e4e9d8f1e18d4
parentdcccf654f57cb884f66b4da41121b991bdbb4071 (diff)
migrations: Only don't import "migrate" if it's not available
* mediagoblin/db/migrations.py: Import migrate if available; if not print a warning.
-rw-r--r--mediagoblin/db/migrations.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py
index 257da6ee..55d64294 100644
--- a/mediagoblin/db/migrations.py
+++ b/mediagoblin/db/migrations.py
@@ -14,13 +14,21 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import print_function
+
import datetime
import uuid
import six
-if six.PY2:
+try:
import migrate
+except ImportError:
+ # Apparently sqlalchemy-migrate is not installed, so we assume
+ # we must not need it
+ # TODO: Better error handling here, or require sqlalchemy-migrate
+ print("sqlalchemy-migrate not found... assuming we don't need it")
+ print("I hope you aren't running the legacy migrations!")
import pytz
import dateutil.tz