• M
    Index option added for change_table migrations · 5e4c22df
    Mehmet Emin INAC 提交于
    In case if we want to add a column into the existing table
    with index on it, we have to add column and index in two
    seperate lines.
    With this feature we don't need to write an extra line to
    add index for column. We can just use `index` option.
    
    Old behaviour in action:
    ```
      change_table(:languages) do |t|
        t.string :country_code
        t.index: :country_code
      end
    ```
    
    New behaviour in action:
    ```
      change_table(:languages) do |t|
        t.string :country_code, index: true
      end
    ```
    
    Exactly same behaviour is already exist for `create_table` migrations.
    5e4c22df
change_table_test.rb 8.6 KB