10

I am creating a Sequel migration to create a new table in my PostgreSQL database. I want to define a String array column, which PostgreSQL supports.

My migration looks like this:

create_table :venues do
  primary_key :id

  String      :reference                                , :null => false
  String      :name                                     , :null => false
  String      :description                              , :null => false
  String[]    :type                                     , :null => false

  DateTime    :created_at                               , :null => false
  DateTime    :updated_at                               , :null => false
end

How can I define something like text[] in my migration?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
beatlecz
  • 158
  • 1
  • 7

1 Answers1

22

You just use the column method and specify the type as a string: column :type, "text[]"

Jeremy Evans
  • 11,959
  • 27
  • 26
  • Look here for the syntax http://sequel.jeremyevans.net/rdoc/files/doc/schema_modification_rdoc.html#label-Column+types – mraaroncruz Dec 02 '15 at 17:49