Answers for "add migration to set default false for existing column in database rails 3"

1

rails migration update column default value

class MigrationName < ActiveRecord::Migration
	def change
    	change_column :my_table, :my_column, :data_type, deafult: "value"
	end
end
Posted by: Guest on December-04-2020

Code answers related to "add migration to set default false for existing column in database rails 3"

Browse Popular Code Answers by Language