-
Migrate the db.
-
Copy 'temp_session.dump' from the 'ttm-utilities' S3 bucket.
-
Restore the dump to the master shard: (Ignore any warnings about the zmance user ... nailed it.)
pg_restore -U -h -p -d -t tmp_session_last_attempt_date temp_session.dump
-
Add an index to the temp table:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| seejee@seejee-mbp:~/code/apangea (review)$ git diff | |
| diff --git a/db/enrollments_schema.rb b/db/enrollments_schema.rb | |
| index 8e7447c..8bd8a6a 100644 | |
| --- a/db/enrollments_schema.rb | |
| +++ b/db/enrollments_schema.rb | |
| @@ -11,7 +11,7 @@ | |
| # | |
| # It's strongly recommended to check this file into your version control system. | |
| -ActiveRecord::Schema.define(:version => 20130211201447) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| s.id as session_id, | |
| s.created_at, | |
| min(coalesce(s1.created_at, '9999-01-01')) as end_date | |
| FROM | |
| student_sessions s | |
| left outer join student_sessions s1 on s.student_id = s1.student_id | |
| AND s.created_at < s1.created_at | |
| GROUP BY | |
| s.id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FactoryGirl.define do | |
| factory :status do | |
| end | |
| factory :thing do | |
| association :status, factory: status | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LessonMapBuilder | |
| def initialize(activities, current) | |
| @activities = activities | |
| @current = current | |
| end | |
| def build | |
| map = {} | |
| @activities.each do |ea| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # These paramters will be required when using the script. | |
| # Scalr will ask for them. | |
| __UPDATE_ALL_PACKAGES__=%updateAllPackages% | |
| SCALR_FARM_NAME=%farm_name% | |
| SCALR_ROLE_NAME=%role_name% | |
| SCALR_INSTANCE_INDEX=%instance_index% | |
| RECONFIGURE=%reconfigure% | |
| RECONFIGURE_OPTS=%reconfigure_opts% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| onProcess: (job, done, chatExporter = new ChatExporter()) => | |
| logger.debug('processing transcript', job.data.id) | |
| hget = Q.nbind(@redis.hget, @redis) | |
| hget('chats', job.data.id) | |
| .then((t) -> @chatExporter.exportTranscript(JSON.parse(t))) | |
| .then( -> | |
| logger.debug "Successfully processed transcript:", id | |
| done() | |
| ) |
Rbx 2.0:
- Full:
real 18m26.393s user 25m39.945s sys 1m32.109s Processing control /Users/seejee/code/reporting/etl/attempt_fact.ctl Source: /Users/seejee/code/reporting/etl/attempt_fact.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class FiguresOutTheNextThing | |
| constructor: (@lesson) -> | |
| doNextThing: | |
| is @lesson.isntStarted() -> | |
| navigate("#{@lesson.id}/start") | |
| return | |
| if @lesson.isFinished() -> | |
| navigate('/student_dashboard') |