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

FK options missing from _add_fk_constraint #298

Closed
sqlalchemy-bot opened this issue May 19, 2015 · 2 comments
Closed

FK options missing from _add_fk_constraint #298

sqlalchemy-bot opened this issue May 19, 2015 · 2 comments
Labels
autogenerate - rendering bug Something isn't working
Milestone

Comments

@sqlalchemy-bot
Copy link

Migrated issue, originally created by Michael Bayer (@zzzeek)

render fk constraint has:

    if constraint.name:
        opts.append(("name", repr(
            _render_gen_name(autogen_context, constraint.name))))
    if constraint.onupdate:
        opts.append(("onupdate", repr(constraint.onupdate)))
    if constraint.ondelete:
        opts.append(("ondelete", repr(constraint.ondelete)))
    if constraint.initially:
        opts.append(("initially", repr(constraint.initially)))
    if constraint.deferrable:
        opts.append(("deferrable", repr(constraint.deferrable)))
    if constraint.use_alter:
        opts.append(("use_alter", repr(constraint.use_alter)))

whereas add_fk_constraint only has:

    if constraint.deferrable:
        args.append("%s=%r" % ("deferrable", str(constraint.deferrable)))
    if constraint.initially:
        args.append("%s=%r" % ("initially", str(constraint.initially)))

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

  • Fixed bug where foreign key options including "onupdate",
    "ondelete" would not render within the op.create_foreign_key()
    directive, even though they render within a full
    ForeignKeyConstraint directive.
    fixes FK options missing from _add_fk_constraint #298

29b301a

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

@sqlalchemy-bot sqlalchemy-bot added autogenerate - rendering bug Something isn't working labels Nov 27, 2018
@sqlalchemy-bot sqlalchemy-bot added this to the fasttrack milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autogenerate - rendering bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant