0
0

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 3 years have passed since last update.

【Laravel】migrateコマンド一覧

Posted at

概要

データベースにテーブルを作成するためのマイグレーションですが、テーブルの構造を定義、更新、削除するためのコマンドがいくつもあります。
ここではmigrateコマンドとして一覧でまとめてみました。

migrateコマンド一覧

  • マイグレーションファイルを作成する
$ php artisan make:migration create_テーブル名_table

  • マイグレーションファイルを実行する
$ php artisan migrate

  • migrationsテーブルを作成する
$ php artisan migrate:install

  • マイグレーションを再実行してテーブルを再構築する。テーブルとデータの初期化
$ php artisan migrate:refresh

  • すべてのマイグレーション操作を元に戻す(全削除)
$ php artisan migrate:reset

  • 1つ前のマイグレーション操作した情報に戻す
$ php artisan migrate:rollback

  • マイグレーションファイルと実行状態を確認できる
$ php artisan migrate:status
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?