Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AR_migrationの例外.pdf

Hiroto Fukui
September 07, 2018
49

 AR_migrationの例外.pdf

Hiroto Fukui

September 07, 2018
Tweet

Transcript

  1. IllegalMigrationNameError - unless /^[_a-z0-9]+$/.match?(file_name) の時に発生 # A migration file name

    can only contain underscores (_), lowercase characters, and numbers 0-9. Any other file name will raise an IllegalMigrationNameError.
  2. ProtectedEnvironmentError - protected environment(デフォルトではproduction)に対してdb:drop, db:purge などのリスクが高い操作を行おうとすると発生 - DBの環境情報はinternal_metadata tableに入っている mysql>

    SELECT * FROM ar_internal_metadata; +-------------+-------------+---------------------+---------------------+ | key | value | created_at | updated_at | +-------------+-------------+---------------------+---------------------+ | environment | development | 2018-08-23 03:01:21 | 2018-08-23 03:01:21 | +-------------+-------------+---------------------+---------------------+ 1 row in set (0.00 sec)