The DataMapper.auto_upgrade! call is currently additive only. It adds new tables, columns and indexes but does not change anything pre-existing. In the future it may try to identify "safe" changes it can make without causing an exception and perform those.
Please note though, this might not be a "safe" change. If the table has NULL values for any columns it may not always be safe to change it to a NOT NULL column without providing a default value. MySQL will probably silently coerce those fields to an empty string but other databases may explode if you try to do this.
One idea I had was to inspect the data with queries before event starting on a conversion to make sure data won't be silently truncated or information lost. In this case we'd do a SELECT COUNT(*) FROM departmentos WHERE nombre IS NULL and if it returned 0 we'd apply the change, otherwise we'd raise an exception telling you to either supply a default value or fix the data beforehand.
SELECT COUNT(*) FROM departmentos WHERE nombre IS NULL
The typical use case for developing locally is to use DataMapper.auto_migrate! in combination with a seed script, so you can just blow away the local database then repopulate it using the seed script. You never really want to use that method or DataMapper.auto_upgrate! in production though; you would write a dm-migrations migration script and apply it when you deploy your app.
Great, this makes sense. It just wasn't clear enough in the getting started page.
I like your idea about inspecting the data and then allowing or not an auto_upgrade!