I'm getting an error on running "php artisan migrate:rollback" in Git Bash that should drop a column.
I've already ran:
1. composer require doctrine/dbal
2. composer update
3. I even tried "composer dump-autoload"
When I check on the database schema using: "sqlite3 database/database.sqlite" the table contains all the columns (including the one called "excerpt" which is the rogue one that should be dropped) but on running the rollback I get the error that the column isn't published. See below.
The Migration that created the column is as follows:
How do you solve this so that you can seamlessly drop columns using migrate:rollback?
posted 2 years ago
I resorted to using a mysql database which runs flawlessly within the homestead virtual box. Just remember:
1. Log into the homestead box: "mysql -u homestead -p " (enter "secret" when prompted for the password on the next line- it's masked)
2. Create your own database: "create database your_database_name;"
and set this as the database name on your .env file, for example:
Oh. And when you create the articles migration, make a few changes as follows:
//Notice I've added nullable to the defined timestamp, this will make the migration work otherwise you'll get the following error on running php artisan migrate
//Notice I've removed the underscore for published_at to read simply publishedat; this will save you a ton of grief when you get to the Eloquent stage, your Article object simply won't save(); and thus won't be committed to the database.
And if you're using Git Bash you can head over here "https://gist.github.com/hofmannsven/9164408" for some useful commands such as viewing your database tables and such.