New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of schemas is absent for most of operations #33

Closed
sqlalchemy-bot opened this Issue Feb 17, 2012 · 6 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Feb 17, 2012

Migrated issue, originally created by Dmitriy Bogomolov (@dvbogomolov)

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 17, 2012

Michael Bayer (@zzzeek) wrote:

somewhat intentional. I typically run migrations for a remote schema in terms of that schema, i.e. set the "search_path" as needed. That would be your workaround for now.

Anyway, can you list out areas where "schema" specification is needed along with links to correct format ? I gather we're just talking about Postgresql here as well.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 9, 2012

Anonymous wrote:

For example, in _produce_net_changes (in autogenerate) there is this line:

metadata_table_names = OrderedSet([table.name for table in metadata.sorted_tables])

the items from this operation are then compared (in _compare_tables) via these lines:

for tname in metadata_table_names.difference(conn_table_names):
        diffs.append(("add_table", metadata.tables[tname]))

metadata.tables is keyed using "." if schema exists, so the lookup for metadata.tables[tname] will fail on any result with a schema specified.

The problems run deeper than that though, as I patched that function to fix the lookup issue, and the autogenerated revision omits all schema info, so all tables are created in the default schema for the connection.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Sep 29, 2012

Michael Bayer (@zzzeek) wrote:

Issue #74 was marked as a duplicate of this issue.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Sep 29, 2012

Michael Bayer (@zzzeek) wrote:

see https://bitbucket.org/zzzeek/alembic/pull-request/23/add-support-of-schemas-for-most-of#chg-alembic/operations.py which contains a pull request for most/all of this.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Sep 30, 2012

Michael Bayer (@zzzeek) wrote:

61acefe a654c35

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Sep 30, 2012

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment