activerecord-postgres-array
activerecord-postgres-array copied to clipboard
Fix defaults when dumping ruby schema
I noticed an issue where the schema dump contained the string version of the column default (ie "{foo,bar}"), causing errors when the schema was loaded.
I did some digging and saw that type_cast gets called to extract the default value when dumping the schema and I added a method chain to detect array columns and properly extract them.
+1 this
It would be great if this got merged.
We have an array field in our database with default: [], which gets garbled if we dump the schema (default: "{}"). This pull request fixes that for us.