mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Hack around the "last migration doesn't stamp" Alembic bug (#967)
* Hack around the "last migration doesn't stamp" Alembic bug This makes MySQL, Sqlite and Postgres work with a special hard coded rule. I'm hoping Alembic fixes the root cause eventually. * Running db upgrade twice in tests
This commit is contained in:
parent
84213ab8cd
commit
23a5463208
@ -9,7 +9,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run lint && mocha --compilers js:babel-core/register --required spec/helpers/browser.js spec/**/*_spec.*",
|
"test": "npm run lint && mocha --compilers js:babel-core/register --required spec/helpers/browser.js spec/**/*_spec.*",
|
||||||
"dev": "NODE_ENV=dev webpack -d --watch --colors",
|
"dev": "NODE_ENV=dev webpack -d --watch --colors",
|
||||||
"prod": "NODE_ENV=production webpack -p --colors",
|
"prod": "NODE_ENV=production webpack -p --colors --progress",
|
||||||
"lint": "npm run --silent lint:js",
|
"lint": "npm run --silent lint:js",
|
||||||
"lint:js": "eslint --ignore-path=.eslintignore --ext .js ."
|
"lint:js": "eslint --ignore-path=.eslintignore --ext .js ."
|
||||||
},
|
},
|
||||||
|
@ -72,11 +72,21 @@ def run_migrations_online():
|
|||||||
poolclass=pool.NullPool)
|
poolclass=pool.NullPool)
|
||||||
|
|
||||||
connection = engine.connect()
|
connection = engine.connect()
|
||||||
|
kwargs = {}
|
||||||
|
if engine.name in ('sqlite', 'mysql'):
|
||||||
|
kwargs = {
|
||||||
|
'transaction_per_migration': True,
|
||||||
|
'transactional_ddl': True,
|
||||||
|
}
|
||||||
|
configure_args = current_app.extensions['migrate'].configure_args
|
||||||
|
if configure_args:
|
||||||
|
kwargs.update(configure_args)
|
||||||
|
|
||||||
context.configure(connection=connection,
|
context.configure(connection=connection,
|
||||||
target_metadata=target_metadata,
|
target_metadata=target_metadata,
|
||||||
#compare_type=True,
|
#compare_type=True,
|
||||||
process_revision_directives=process_revision_directives,
|
process_revision_directives=process_revision_directives,
|
||||||
**current_app.extensions['migrate'].configure_args)
|
**kwargs)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with context.begin_transaction():
|
with context.begin_transaction():
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
echo $DB
|
echo $DB
|
||||||
rm /tmp/caravel_unittests.db
|
rm ~/.caravel/caravel_unittests.db
|
||||||
rm -f .coverage
|
rm -f .coverage
|
||||||
export CARAVEL_CONFIG=tests.caravel_test_config
|
export CARAVEL_CONFIG=tests.caravel_test_config
|
||||||
set -e
|
set -e
|
||||||
caravel/bin/caravel db upgrade
|
caravel/bin/caravel db upgrade
|
||||||
|
caravel/bin/caravel db upgrade # running twice on purpose as a test
|
||||||
caravel/bin/caravel version -v
|
caravel/bin/caravel version -v
|
||||||
python setup.py nosetests
|
python setup.py nosetests
|
||||||
|
Loading…
Reference in New Issue
Block a user