Linoor is a premium Template for Digital Agencies, Start Ups, Small Business and a wide range of other agencies.

needhelp@linoor.com
888 999 0000

Insert a default value into migration

You are here:
Estimated reading time: < 1 min

‘-After running migration in the command line. Go to the migration file in db/[migration-file]

-insert default value using the following example

 

class AddConnectCodeToUsers < ActiveRecord::Migration[6.0]
def change
add_column :users, :connect_code, :integer, default: 0
end
end

Was this article helpful?
Dislike 0
Views: 1