Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

add column with default value in rails

class AddColumnnameToTablename < ActiveRecord::Migration
  def change
    add_column :table_name, :column_name, :boolean, default: false
  end
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #column #default #rails
ADD COMMENT
Topic
Name
6+3 =