#I just started in laravel and got an error when trying to migrate with newly added foreign keys

8 messages · Page 1 of 1 (latest)

frigid pendant
#

try reading the error, it tells you what is wrong. Sub categories table already exists shrug

also may be wise to define a down() so you can revert the migration

  • read the #rules
#

I would also advise against dumping all of this in a single migration file

#

usually a migration is for one table.. or one feature

hoary wren
hoary wren
#

its solved now but ty for your help

mystic ledge
#

you should remove the field of sub_categories in the table on your database.

#

then migrate again.