Permalink
Browse files

Add a tool to check for multiple alembic heads

Change-Id: Ia1a4354f3c74e4f81b4f93e20389f878ffaab6c3
  • Loading branch information...
1 parent 73b49bb commit 84812ff6b7ebfa6538ea44bfde396a9312247751 @asalkeld asalkeld committed Feb 18, 2014
Showing with 9 additions and 0 deletions.
  1. +8 −0 tools/check_for_alembic_branches.sh
  2. +1 −0 tox.ini
View
8 tools/check_for_alembic_branches.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+HEADS=$(alembic -c solum/objects/sqlalchemy/migration/alembic.ini branches | grep head | wc -l)
+if [ $HEADS -gt 1 ]; then
+ echo "ERROR: there are multiple alembic migration branches"
+ alembic -c solum/objects/sqlalchemy/migration/alembic.ini branches
+ exit 1
+fi
+exit 0
View
1 tox.ini
@@ -16,6 +16,7 @@ commands = python setup.py testr --slowest --testr-args='{posargs}'
commands =
flake8
{toxinidir}/tools/config/check_uptodate.sh
+ {toxinidir}/tools/check_for_alembic_branches.sh
[testenv:venv]
commands = {posargs}

0 comments on commit 84812ff

Please sign in to comment.