The standard string representation of an array within PostgreSQL uses {
and }
, for example:
=> select array[11, 23];
array
---------
{11,23}
(1 row)
So if someone is using '{}'
(note the quotes to make it a string) then they're presumably using the string representation of an empty array. When you use:
:default => [ ]
you're using an empty Ruby array as the default and letting ActiveRecord convert that to what PostgreSQL understands.
If your migration ran successfully then presumably it is correct. You can verify that by looking at the table's structure from inside the psql
CLI tool, if you say:
\d table_name
you should see something like this:
column | text[] | default '{}'::text[]
in the output.