Why Laravel can't find my migration file?

Viewed 189

After reading in this link that we can change our migration file conventions, I thought removing timestamp and setting a simple counter would be more maintainable.

001_first_table.php
002_second_table.php
003_third_table.php

But the problem is that now Laravel complaints that:

Cannot declare class FirstTable, because the name is already in use

This error means file name is not matched with class name. This error doesn't happen when we prefix file names with timestamps, but happens if we change that scheme and replace the timestamp with ordinal series.

Why is it so? How can I fix it?

1 Answers

You should retstart from the beginning

php artisan migration:refresh

or If you did "unstandard changes" you should destroy you models and tables manually

model to delete in app\Models

table to delete : in the db

Related