postgresql 9.1 - ActiveRecord::StatementInvalid: PG::DatatypeMismatch: ERROR: column is of type integer[] but default expression is of type integer Rails 4.1.1 -


i using rails 4.1.1 , pg (0.17.1) gem having error while running migration

activerecord::statementinvalid: pg::datatypemismatch: error: column "page_ids" of type integer[] default expression of type integer

here migration code

class createpages < activerecord::migration     def change         create_table :pages |t|             t.string     :name             t.integer    :page_ids,     array: true, null: false, default: '{}'             t.timestamps         end     end end 

the array: true not working

try:

t.integer    :page_ids,     array: true, null: false, default: [] 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -