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?

seedに記述したデータで サンプル状態に戻す

Posted at

やりたいこと

・DBを 初期化 したい
・開発中に テーブル構成やデータをリセットしたい
・seedに記述したデータで サンプル状態に戻す

コマンド

php artisan migrate:fresh --seed

実行内容:
①全テーブル削除(DROP)
②再マイグレーション(php artisan migrate)
③シーディング(php artisan db:seed)

注意点

migrate:fresh は本番環境でやると データが全削除されるので要注意!!
これは基本的に ローカル専用コマンドです。

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?