151
130

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.

Laravel Migration コマンドまとめ

Posted at

マイグレーション実行

$ php artisan migrate

マイグレーション実行(対話OFF)

$ php artisan migrate --force

直前に実行したひとまとまりのマイグレーションをロールバック

$ php artisan migrate:rollback

全部ロールバックしてからマイグレーションし直す

$ php artisan migrate:refresh

一旦全てのテーブルを削除してマイグレーションし直す

$ php artisan migrate:fresh

実行時に発行されるクエリを表示するのみで、実際にマイグレーションはしない

$ php artisan migrate --pretend
$ php artisan migrate:rollback --pretend

マイグレーション状況を出力

$ php artisan migrate:status
151
130
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
151
130

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?