I created a migration file using
php artisan make:migration create_todoapps_table.
The migration file was created with the table name as to_do_apps
(Schema::create('to_do_apps', function (Blueprint $table) {...}).
But I don't want the table name to be to_do_apps .
So I tried to change it to todoapps manually
(Schema::create('todoapps', function (Blueprint $table) {...}).
When doing migration this works fine and table with todoapps is getting created. But when doing the factory and seed, it is trying to add data to the old table name to_do_apps itself, which is causing an error because, that table is not available.
Is there a way to overcome this issue?
How can I change the tablename in migration file without breaking anything?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire