Skip to content

foreign_key and references in migrations does not work #599

Description

@jarl-dk

I would love to see support for foreign_key and references in migration to support composite keys.

such that the following will work:

def change
  create_table :tags do |t|
    t.string :user_first_name
    t.string :user_last_name

    t.foreign_key :user, column: [:first_name, :last_name], primary_key: [:user_first_name, :user_last_name]
  end
end

Similar for t.references

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions