Alex Mansour
Alex Mansour

Reputation: 61

Add created_at column to migrations table - Laravel

When we run migrate:install in Laravel framework, migrations table is created in the database that has two columns (migration, batch), there is anyway to add new column which created_at timestamps . Thanks

Upvotes: 0

Views: 2062

Answers (2)

JustAMartin
JustAMartin

Reputation: 13733

I found a github project for Laravel 4:

https://github.com/Sano000/laravel-migrate-created_at

I myself will try to port it to Laravel 5.

Upvotes: 0

Kamran Ahmed
Kamran Ahmed

Reputation: 12438

Yes. Update the migrations that you created to add time stamps i.e. $table->timestamps(); and then run

php artisan migrate:refresh

What this will do is, roll back all your migrations and then run them all again. If you also want to follow your refresh by seeding, you should do

php artisan migrate:refresh --seed

Upvotes: 1

Related Questions