PostgreSQL migrate column to array
The following DDL will convert the column to an array and make the existing value be the first array element:

alter table the_table
   alter column x type varchar(255)[] using array[x];


varchar is a synonym for character varying

To reverse this change, you can apply the same logic:

alter table the_table
   alter column x type varchar(255) using coalesce(x[1],'');


x[1] returns the first element, but will only return null if the array is empty. With coalesce() this can then be turned into an empty string ''