Skip to content

Rails references on create_table not supported #113

@codenamev

Description

@codenamev

Attempting to run any migration with departure that uses [Rails' references] on create_table (https://guides.rubyonrails.org/active_record_migrations.html#references) will fail with missing for_alter method(s).

Example:

class CreateExamplesTable < ActiveRecord::Migration[7.0]
  uses_departure!

  def change
    create_table :examples do |t|
      # ... other columns
      t.references :other_ar_backed_model_name, null: false, foreign_key: true
    end
  end
end

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