MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/pms_cafsinfotech_in/db/migrate/20150113211532_populate_email_addresses.rb
class PopulateEmailAddresses < ActiveRecord::Migration[4.2]
  def self.up
    t = EmailAddress.connection.quoted_true
    n = EmailAddress.connection.quoted_date(Time.now)

    sql = "INSERT INTO #{EmailAddress.table_name} (user_id, address, is_default, notify, created_on, updated_on)" +
          " SELECT id, mail, #{t}, #{t}, '#{n}', '#{n}' FROM #{User.table_name} WHERE type = 'User' ORDER BY id"
    EmailAddress.connection.execute(sql)
  end

  def self.down
    EmailAddress.delete_all
  end
end