cartalyst/sentry — pull request #351 by joshuajabbour (2014-01-25 08:28:20+00:00)
Title: Update migrations to support sqlite

Okay, so in reference to https://github.com/cartalyst/demo-sentry/issues/2, I've gone ahead and updated all current migrations to support sqlite. I've also thoroughly tested them, with hundreds of migrate/rollback checks. (I only updated and tested the Schema calls, not the DB calls, since I was working with a fresh install. For all I know, the DB calls might fail too.)

Fundamentally, laravel is broken for sqlite. That's unfortunate. But apparently, developers need to be aware of undocumented workaround tricks to make migrations work (and who knows what other database-related commands). Like not having more than one table alteration in a Schema::table callback (except sometimes you can :roller_coaster:).

Usually, the migration will error out (which is how I first noticed this problem—so much for using sqlite as a "quick" testing database). But sometimes, migration tasks are just silently ignored (yay). Like the fact that you can't add indices in Schema::table callbacks at all. All in all, it just means you can never be sure you'll have the intended environment.

Anyway, it doesn't appear this is going to change anytime soon: https://github.com/laravel/framework/issues/2694 and https://github.com/laravel/framework/issues/2979 and many others. Ideally, we'd stop claiming to support sqlite in laravel, or fix the holes and make it work robustly.

But I wanted to make these commits available, since at least they'll make sentry a bit more robust. I'd also consider squashing all your migrations before final release, as only using create/drop methods will fix everything (see http://registry.autopergamene.eu/package/cytracom-laravel-migration-squasher).