joshmfrankel / joshmfrankel.github.io

Blog and Personal site
http://joshfrankel.me
MIT License
2 stars 1 forks source link

Use postgres functions within Rails migration #79

Open joshmfrankel opened 7 months ago

joshmfrankel commented 7 months ago
add_column :table, :column, :text, default: -> { "('prefix-' || md5(random()::text) || 'suffix')" }, null: false, if_not_exists: true