diff --git a/db/migrate/20170717105219_copy_confirmed_at_from_enterprises_to_spree_users.rb b/db/migrate/20170717105219_copy_confirmed_at_from_enterprises_to_spree_users.rb new file mode 100644 index 0000000000..72f4baeeec --- /dev/null +++ b/db/migrate/20170717105219_copy_confirmed_at_from_enterprises_to_spree_users.rb @@ -0,0 +1,5 @@ +class CopyConfirmedAtFromEnterprisesToSpreeUsers < ActiveRecord::Migration + def up + execute "UPDATE spree_users SET confirmed_at = enterprises.confirmed_at FROM enterprises WHERE spree_users.email = enterprises.email AND enterprises.confirmed_at IS NOT NULL" + end +end