6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FuelPHP マイグレーションメモ

Last updated at Posted at 2015-06-24

特定のマイグレーションファイルだけ実行したかった

以下の様な状態で

$ oil r migrate
Performed migrations for app:default:
0130_create_staff_info_a
0131_create_staff_info_b

$ oil r migrate:down v=129
Reverted migrations for app:default:

  • 0131_create_staff_info_b
  • 0130_create_staff_info_a

131だけ適応したかった。

130のマイグレーションファイルを適当にリネームし

$ oil r migrate
Performed migrations for app:default:
0131_create_staff_info_b

131だけ適応できた。

飛ばされた130を適応させたい場合はファイル名を元に戻し

$ oil r migrate
Already on the latest migration for app:default.

上記だと130が実行されなかったので以下のようにする。

$ oil r migrate:current
Newly installed migrations for app:default:

  • 0130_create_staff_info_a

130も適応できた。

ほかにいいやり方あるのかなー

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?