Skip to content

t.references doesn't raise an error on non-existent options #33284

@georgewambold

Description

@georgewambold

Steps to reproduce

  1. Create a migration
  2. Use create_table to add a table called :users like this:
create_table :users, force: true do |t|
end
  1. Use create_table to add a table called :posts that references :users like this:
create_table :posts, force: true do |t|
  t.references :users, nnull: false, uniqe: true 
end

**** NOTE that 'nnull' and 'uniqe' are non-existent options!! ****

  1. Run the migration

I created a runnable gist to illustrate the issue here: https://gist.github.com/georgewambold/16ee14cb0e5ca77b35ff3c94b4537475

Expected behavior

An error should be raised

Actual behavior

The migration changes are commited without raising an error

System configuration

Rails version: 6.0.0.alpha

Ruby version: 2.5.1

Other notes

This is my first issue and I'd love to write the fix if the issue is accepted.

This issue is similar to issue 8104 and PR 32675

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions