Skip to content

ORM session creates a subtransaction on get_bind()? this interferes w/ things ? #369

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by chris7 (@chris7)

I am trying to run a trivial migration, and alembic will migrate the database, but is not updating the database version. To update alembic_version, it requires me to run the migration again.

Here's the script I am running:

def upgrade():
  op.add_column(
    'peaks',
    sa.Column('rti', sa.Float(), nullable=True),
  )

And the output of a full migration:

alembic upgrade head
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 1 -> 2, Add peakgroups
INFO  [alembic.runtime.migration] Running upgrade 2 -> 3, peakgroup_feature_reference
INFO  [alembic.runtime.migration] Running upgrade 3 -> 4, feature_to_peakgroup
INFO  [alembic.runtime.migration] Running upgrade 4 -> 5, remove feature peaks
INFO  [alembic.runtime.migration] Running upgrade 5 -> 6, add retention time indices
$ alembic current
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
5

The database at this point has the 'rti' column, so it was successful but the alembic_version table was never updated. I can run the migration again, and it will stamp the database with 6.

running alembic v. 0.8.6 & SQLAlchemy 1.0.12. The database is a sqlite file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions