dimanche 10 décembre 2017

Start over with Laravel's migrations

I'm working on a bigger Laravel project for a while and have currently over 70 migrations (using MySQL). I've never written tests (shame on me) and like to catch up on that now.
I've used foreign keys at the beginning. I've renamed some and then I removed them completely with subsequent migrations.

Now a temporary sqlite database should be used for testing. But as I was renaming fk's by name and MySQL's naming convention differs from the sqlite's, sqlite cannot find these. There are also a bunch of other errors.

I'm wondering if I could delete all my migrations and create a single migration which holds all the database structure of the current state. Starting from scratch, so to speak.

Is that advisable? What should happen to the migrations table?

Aucun commentaire:

Enregistrer un commentaire