Skip to content

MigrationContext.stamp missing call to _ensure_version_table? #300

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Christian Theune (@ctheune)

Hi!

I'm currently upgrading from an older version where I used the following code when stamp() did not exist yet:

migration_context._update_current_rev(
migration_context.get_current_revision(), script.get_current_head())

This code was fine to call directly after create_all() and the new documentation says that one should use command.stamp. In my situation I do not have a manifested config file to use the Configuration object with and I think I should be able to just call

migration_context.stamp(script, "head")

This fails for new databases because the initial version table does not get created. I see that the MigrationContext class has _ensure_version_table() which is used except in stamp(). This looks like an accident to me.

Christian

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions