Using Ruby 2.0.0-p195 with Rails 3.2.13 and v0.3.1 of the postgres_ext gem.
It seems that I often have trouble with schema dumps (not SQL structure dumps) using Rails wherein the schema dumper converts UUID columns to text columns and arrays to text columns with defaults of "{}"
. Routine operations such as rake db:schema:dump
cause destructive diffs like the following:
- t.string "dbas", :default => [], :array => true
- t.string "industries", :default => [], :array => true
+ t.text "dbas", :default => "{}"
+ t.text "industries", :default => "{}"
- t.uuid "uuid"
+ t.text "uuid"
If I examine the structure of the DB manually or just ask Rails what type of column type it thinks a given attribute has, everything looks just fine.
Naturally, this problem wreaks all sorts of havoc. Short of switching to a SQL structure dump, how can I get proper schema dumps?