python - flask unable to run db migrate - NameError: name 'conn_uniques' is not defined -


every time update models have delete , reinitialize database.

./manage.py db init , initial ./manage.py db migrate

work every subsequent ./manage.py db migrate fails following error:

info  [alembic.migration] context impl sqliteimpl. info  [alembic.migration] assume non-transactional ddl. traceback (most recent call last): file "manage.py", line 110, in <module> manager.run() file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages  /flask_script/__init__.py", line 405, in run result = self.handle(sys.argv[0], sys.argv[1:]) file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages    /flask_script/__init__.py", line 384, in handle return handle(app, *positional_args, **kwargs)  file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages  /flask_script/commands.py", line 145, in handle    return self.run(*args, **kwargs) file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages  /flask_migrate/__init__.py", line 80, in migrate  command.revision(config, message, autogenerate = true, sql = sql) file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages /alembic/command.py", line 97, in revision script.run_env()  file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages /alembic/script.py", line 199, in run_env util.load_python_file(self.dir, 'env.py') file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages/alembic/util.py", line 199, in load_python_file module = load_module(module_id, path) file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages/alembic/compat.py", line 49, in load_module   return machinery.sourcefileloader(module_id, path).load_module() file "<frozen importlib._bootstrap>", line 539, in _check_name_wrapper file "<frozen importlib._bootstrap>", line 1614, in load_module file "<frozen importlib._bootstrap>", line 596, in _load_module_shim file "<frozen importlib._bootstrap>", line 1220, in load file "<frozen importlib._bootstrap>", line 1200, in _load_unlocked file "<frozen importlib._bootstrap>", line 1129, in _exec file "<frozen importlib._bootstrap>", line 1471, in exec_module file "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed file "migrations/env.py", line 72, in <module> run_migrations_online() file "migrations/env.py", line 65, in run_migrations_online context.run_migrations() file "<string>", line 7, in run_migrations file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages/alembic/environment.py", line 652, in run_migrations  self.get_context().run_migrations(**kw) file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages /alembic/migration.py", line 210, in run_migrations self): file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages/alembic/command.py", line 83, in retrieve_migrations autogen._produce_migration_diffs(context, template_args, imports) file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages/alembic/autogenerate/api.py", line 143, in _produce_migration_diffs autogen_context, object_filters, include_schemas) file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages/alembic/autogenerate/api.py", line 198, in _produce_net_changes inspector, metadata, diffs, autogen_context) file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages/alembic/autogenerate/compare.py", line 69, in _compare_tables diffs, autogen_context, inspector) file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages/alembic/autogenerate/compare.py", line 223, in _compare_indexes_and_uniques  metadata_indexes file "/home/sergi/.virtualenvs/flaskvenv/lib/python3.4/site-packages/alembic/ddl/sqlite.py", line 56, in correct_for_autogen_constraints conn_uniques.remove(idx) nameerror: name 'conn_uniques' not defined 

i use sqlite3 database. had models split several files put them in single file no help. tried upgrading flask-migrate, flask-sqlalchemy , other packages no help. wrong?

update: using alembic version 0.6.2

it's odd, few of 0.6.x releases of alembic appear have undefined symbol.

the mistake corrected in release 0.6.7. here commit shows how line corrected: https://github.com/zzzeek/alembic/commit/ead05ce48d40d4235b2395972fd1a6efb96d414c

pretty sure if upgrade 0.6.7 or newer problem resolved.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -