Home > Blockchain >  Rails: remove array from DB column in migration
Rails: remove array from DB column in migration

Time:06-02

In Rails, you can add an array column in a migration like so:

change_table :scheduled_posts do |t|
  t.string :list_id, array: true
end

What's the syntax to change it to a non-array?

CodePudding user response:

Turns out it was pretty simple:

change_column :scheduled_posts, :list_id, :string, array: false
  • Related