Migration for creating missing indexes does not work with sqlite

Bug #1348202 reported by Andrea Frittoli
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
subunit2sql
Triaged
Low
Unassigned

Bug Description

$ alembic upgrade head
INFO [alembic.migration] Context impl SQLiteImpl.
INFO [alembic.migration] Will assume non-transactional DDL.
INFO [alembic.migration] Running upgrade None -> 5ef013efbc2, create tests tables
INFO [alembic.migration] Running upgrade 5ef013efbc2 -> 1f92cfe8a6d3, create runs table
INFO [alembic.migration] Running upgrade 1f92cfe8a6d3 -> 3db7b49816d5, create test_runs table
INFO [alembic.migration] Running upgrade 3db7b49816d5 -> 163fd5aa1380, Create avg runtime column in test table
INFO [alembic.migration] Running upgrade 163fd5aa1380 -> 4ca26dac400e, Create metadata tables
INFO [alembic.migration] Running upgrade 4ca26dac400e -> 13d819bbb0ff, create missing indexes
Traceback (most recent call last):
  File "/home/af/venvs/subunit2sql/bin/alembic", line 9, in <module>
    load_entry_point('alembic==0.6.5', 'console_scripts', 'alembic')()
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/config.py", line 298, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/config.py", line 293, in main
    self.run_cmd(cfg, options)
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/config.py", line 279, in run_cmd
    **dict((k, getattr(options, k)) for k in kwarg)
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/command.py", line 125, in upgrade
    script.run_env()
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/script.py", line 203, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/util.py", line 212, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/compat.py", line 58, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "subunit2sql/migrations/env.py", line 83, in <module>
    run_migrations_online()
  File "subunit2sql/migrations/env.py", line 76, in run_migrations_online
    context.run_migrations()
  File "<string>", line 7, in run_migrations
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/environment.py", line 688, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/migration.py", line 258, in run_migrations
    change(**kw)
  File "subunit2sql/migrations/versions/13d819bbb0ff_create_missing_indexes.py", line 35, in upgrade
    ['test_id', 'run_id'])
  File "<string>", line 7, in create_unique_constraint
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/operations.py", line 621, in create_unique_constraint
    schema=schema, **kw)
  File "/home/af/venvs/subunit2sql/local/lib/python2.7/site-packages/alembic/ddl/sqlite.py", line 21, in add_constraint
    "No support for ALTER of constraints in SQLite dialect")
NotImplementedError: No support for ALTER of constraints in SQLite dialect

Environment:

$ pip freeze | egrep '(subunit|oslo|alem)'
alembic==0.6.5
oslo.config==1.4.0.0a3
oslo.db==0.3.0
python-subunit==0.0.18
subunit2sql==0.2.dev4.g10e5d0e

Changed in subunit2sql:
status: New → Triaged
importance: Undecided → Wishlist
importance: Wishlist → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to subunit2sql (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/109865

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to subunit2sql (master)

Reviewed: https://review.openstack.org/109865
Committed: https://git.openstack.org/cgit/openstack-infra/subunit2sql/commit/?id=a08a7afa81626847f60d62cbb602898d71796ead
Submitter: Jenkins
Branch: master

commit a08a7afa81626847f60d62cbb602898d71796ead
Author: Matthew Treinish <email address hidden>
Date: Sun Jul 27 13:06:34 2014 -0400

    Update the documentation

    This commit updates the documentation for subunit2sql. It adds details
    to the README around running setting up the DB and running subunit2sql.
    Also, the db api autodoc usage is corrected so that it properly
    generates the documentation. Finally, the sphinx theme is switched to
    oslosphinx to have consistent style with the documentation for the
    other OpenStack projects.

    Related-Bug: #1348202
    Change-Id: Icf148dee19bb888b551e60a396f87f6c09553e09

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.