I found out that there is no MODIFY in SQLite. So my question now becomes:
How do I deal with this situation? I want to continue to use migrations, but I also want to be able to test using SQLite.
I've used something like this in the past, as ->after() isn't supported either in sqlite (what I remember)
if (App::environment() == 'testing') {
// Testing specific code -- you know this will be SQLite
} else {
// Anything else
}
This would mean you could 'hack' previous migrations, that outside of testing do the same as they do now. But set the varchar to 20 in sqlite.
And make the second migration (the actual change from 10 to 20 length) empty for SQLite, but work normally for anything else.
Hope this gets you a step further and if there's a better way. I'm sure someone will correct me.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community