diff --git a/caravel/migrations/versions/b4456560d4f3_change_table_unique_constraint.py b/caravel/migrations/versions/b4456560d4f3_change_table_unique_constraint.py index 0b8164d0c16..1c5c50a5f63 100644 --- a/caravel/migrations/versions/b4456560d4f3_change_table_unique_constraint.py +++ b/caravel/migrations/versions/b4456560d4f3_change_table_unique_constraint.py @@ -14,12 +14,20 @@ from alembic import op def upgrade(): - op.drop_constraint( - u'tables_table_name_key', 'tables', type_='unique') - op.create_unique_constraint( - u'_customer_location_uc', 'tables', - ['database_id', 'schema', 'table_name']) + try: + # Trying since sqlite doesn't like constraints + op.drop_constraint( + u'tables_table_name_key', 'tables', type_='unique') + op.create_unique_constraint( + u'_customer_location_uc', 'tables', + ['database_id', 'schema', 'table_name']) + except Exception: + pass def downgrade(): - op.drop_constraint(u'_customer_location_uc', 'tables', type_='unique') + try: + # Trying since sqlite doesn't like constraints + op.drop_constraint(u'_customer_location_uc', 'tables', type_='unique') + except Exception: + pass diff --git a/run_tests.sh b/run_tests.sh index bc22a8d6db6..9fbb244b95e 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -2,5 +2,6 @@ rm /tmp/caravel_unittests.db rm -f .coverage export CARAVEL_CONFIG=tests.caravel_test_config +set -e caravel/bin/caravel db upgrade python setup.py nosetests