Skip to content

Wrong FK naming #1

@e1senh0rn

Description

@e1senh0rn

I found strange behavior, more likely to be a bug for me.
Steps to reproduce:
DBMS: MySQL 5.1.45

Create table with field supposed to be FK:

create_table :seals do |t|
  t.references :bag, :foreign_key => {:dependent => :delete}, :null => false
  ...
end

Constraint named "seals_ibfk_1" will be created.

And when I run

remove_foreign_key  :seals, :bags

SQL query with drop FK name "fk_seals_bag_id" would be generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions