2013-07-16 13 views
5

Sequelの移行を作成して、PostgreSQLデータベースに新しいテーブルを作成しています。 PostgreSQLがサポートするString arrayカラムを定義したいと思います。Sequel Postgresqlの移行でARRAYカラムを定義するにはどうすればよいですか?

私の移行は、次のようになります。

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 

がどのように私は私の移行にtext[]のようなものを定義することができますか?

答えて

12

あなただけのカラム法を使用して文字列としてタイプを指定します。構文については、こちらをcolumn :type, "text[]"

+0

ルックhttp://sequel.jeremyevans.net/rdoc/files/doc/schema_modification_rdoc.html#label-Column +タイプ – mraaroncruz

関連する問題