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

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented May 19, 2015

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

This comment has been minimized.

sqlalchemy-bot commented May 19, 2015

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 #298

29b301a

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 19, 2015

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