Answers for "rails migration update column default value"

2

rails migration add default value

change_column :users, :admin, :boolean, :default => false
Posted by: Guest on November-25-2020
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 "rails migration update column default value"

Browse Popular Code Answers by Language