updated process for migrations Jan 2018

CCB Approved Services

  1. Create Org
  2. Attach Service Approval
  3. Resolve Informals
  4. Run attendance import
  5. Run booking auto create
  6. Run balance reset
  7. Import Transfer amounts
  8. Import parent emails
# set all balances to zero
# in ruby console

Organisation[9999999].parents.each {|v| Payment.create(amount: v.balance, parent_id: v.id, payment_date: Date.parse('2020-01-01'), notes: "Migration balance adjustment", src: 'other', src_ref: 'migration_2_sc') }

# 9999999 is the organisation id
# payment_date can be today (Date.today)
# notes and src_ref can be changed (but give it something uniq, can be easily deleted if by mistake)
# to get balance at, call balance with a single param v.balance(Date.parse('2018-01-01'))

# auto generate bookings, and session codes, and rooms.

cd /home/bitnami/ccms_prod

RACK_ENV=production bundle exec rake auto_bookings[service_id]

e.g. rake auto_bookings[1000000]

Pull Attendance history

ssh into prod.

cd /home/bitnami/ccsm_prod
RACK_ENV=production bundle exec padrino console


after console loaded, type:

require './sucker_punch_jobs/dss_att_job.rb' [enter]

DssAttJob.perform_async(302, nil, true) [enter]

wait for a while (seconds) and refresh att list page to see if statuses updated.
* 302 is the SC service id.

* third param true is recent two weeks. false is three years.