The only reason I could think of is that you accidentally run migrate before changing the migration. Then it created the table with the first version and running another migrate on the same database will do nothing.
Can you do a migrate:rollback and do it again? I see nothing wrong on your migration.
danallendotcom liked this reply
I actually checked for that before starting this thread. Deleted the project, recreated it following a guide.
This morning, I found and fixed the problem. Your answer is so close I marked it as the solution.
Here is an updated STEPS TO REPRODUCE PROBLEM, following a guide for newbies:
The migration file is created with write permission only for the user that ran the command for creating the model. However, my code editor is logged into the server with a different user. When I tried saving, I wrongly assumed the migration file had the same permissions as all the files got when I set the file directory recursively to give everyone write permissions. In the code editor, there is a badge on the file when there are unsaved changes. Unfortunately, the badge turns off when file-save fails. A warning pops up, but it is easy to miss if you are not looking for it.
Bottom line, you were 100% correct, the migration occurred without the fields being in the migration file. Your were right that nothing was wrong. I did the rollback and re-migrated, everything is perfect now.
Thank you for taking the time to answer my question. I appreciate it a lot, because i know you didn't have to do that.
tvbeek liked this reply
Thanks for your friendly reply :) That is a big motivator to keep taking time to answer questions :)
And thanks for explaining what happen, that can help other people who have the same problem.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community