Reputation: 163
I've decided to remove all the migrations from a Laravel 5.7 project as I would rather create/update the tables by hand. I've realised that data can still be loaded from the database without any migration files.
Upvotes: 0
Views: 483
Reputation: 163
Remove the migration files and data in the migrations table but keep the other tables and fields.
Steps modified from this SO answer.
\database\migrations\
migrations
table in MySQL delete from migrations;
composer dump-autoload
If you are managing your tables by hand remember to add the
created_at
timestamp NULL DEFAULT NULL
updated_at
timestamp NULL DEFAULT NULL
fields to your tables if you want to use Laravels built in timestamps functionality. If you don't want to use it leave them out and add the following line to the model:
public $timestamps = false;
See this SO question for more details on the timestamps.
Upvotes: 1