Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

rails g migration add column array

class AddSubjectsToBook < ActiveRecord::Migration
  def change
    add_column :books, :subjects, :text, array: true, default: []
  end
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rails #migration #add #column #array
ADD COMMENT
Topic
Name
6+8 =