-
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:
CREATE INDEX ON tmp_session_last_attempt_date (session_id);
-
Run this on the master shard: (may take up to an hour)
UPDATE student_sessions SET last_attempt_date = t.last_attempt_date FROM tmp_session_last_attempt_date t WHERE student_sessions.id = t.session_id;
-
Drop the temp table from the master shard:
DROP TABLE tmp_session_last_attempt;
Last active
December 14, 2015 04:49
-
-
Save seejee/5031415 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment