Skip to content
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

missing check for batch mode in render for create_foreign_key. #315

Closed
sqlalchemy-bot opened this issue Aug 12, 2015 · 6 comments
Closed

Comments

@sqlalchemy-bot
Copy link

Migrated issue, originally created by Ryan Lahfa (@OzVessalius)

In batch mode (for SQLite support), autogeneration doesn't work as expected with Foreign Key generation for example.

Look at autogenerate/render.py:245 function, it should add create_foreign_key calls.
The arguments provided are one for the operation.create_foreign_key call.
If we are in batch mode, we MUST omit the source table as it is redundant.

Then, the auto-generated call isn't valid at the end.

A quick workaround would be to patch the code and check for batch_prefix in autogen_context.
If we found it, we would pop the useless arguments and I think that should do it.

If you need more information about that, please, let me know! :)
Thanks for Alembic!

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

Thanks for reporting. please refer to the current master when reporting issues. All the render functions except for create_foreign_key are consulting the batch context and the test itself is also testing for the wrong call in test_autogen_composition.

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • removed labels: easy

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • changed title from "Autogenerate in batch mode doesn't generate good f" to "missing check for batch mode in render for create_"

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • set milestone to "fasttrack"

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

1458041

@sqlalchemy-bot
Copy link
Author

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
Projects
None yet
Development

No branches or pull requests

2 participants