Rails5.1の主キーbigint移行

RailsのPRIMARY KEY(id)はデフォルトでAUTOINCREMENT付きINTEGERですが、Rails5.1でより大きなレコード数を扱えるようBIGINTに拡張されました。
この影響で、ridgepoleでRails5.0以前に作成したアプリケーションにスキーマを適用すると以下のような警告が表示されます。

[WARNING] Primary key definition of `versions` differ but `allow_pk_change` option is false
  from: {:id=>:serial}
    to: {}

Primary keyを変更するには、以下のようにridgepole 0.7.1で追加された--allow-pk-change(主キー変更を明示許可)を追加する必要があります。

$ ridgepole -c config/database.yml -f config/Schemafile -a --allow-pk-change

-- change_column("versions", :id, :bigint, {:auto_increment=>true})
   -> 0.1609s
中馬崇尋
Chuma Takahiro