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

mysqlでテーブルにカラムを追加する方法 初心者メモ

Last updated at Posted at 2019-09-22

mysqlでテーブルにカラムを追加する方法

まずテーブルの確認

3156f9c2f06fea6af08836bcaab540b4[1].png

ここでカラムが足りない事に気づいたら

migrateとrollback

php artisan migrate:rollback --step 3で3つ前にprofilesで使用したmigrateにrollbackする
70e9e0e4f424c1270c6408f799d47f9b[1].png

migrationディレクトリに必要なカラムを追加する。

a6e0f84b36cb07d90087afd0a1551549[1].png

再度migrateする

18b5dc1d15503a26b9c02335a0b36358[1].png

これでカラムの追加完了

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?