Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporary tables match "^lhm[noc]_" #7

Merged
merged 1 commit into from
Sep 20, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/large_hadron_migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ def self.large_hadron_migrate(curr_table, *args, &block)

raise "chunk_size must be >= 1" unless chunk_size >= 1

new_table = "new_#{curr_table}"
old_table = "%s_#{curr_table}" % Time.now.strftime("%Y_%m_%d_%H_%M_%S_%3N")
journal_table = "#{old_table}_changes"
started = Time.now.strftime("%Y_%m_%d_%H_%M_%S_%3N")
new_table = "lhmn_#{curr_table}"
old_table = "lhmo_%s_#{curr_table}" % started
journal_table = "lhmc_%s_#{curr_table}" % started
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lhmc - what does 'c' stand for? changes? then var name `journal_table' better should reflect this as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup - nEW, oLD, cHANGES.

r

On Sep 16, 2011, at 10:14 , Tobias Bielohlawek wrote:

@@ -100,9 +100,10 @@ class LargeHadronMigration < ActiveRecord::Migration

raise "chunk_size must be >= 1" unless chunk_size >= 1
  • new_table = "new_#{curr_table}"
  • old_table = "%s_#{curr_table}" % Time.now.strftime("%Y_%m_%d_%H_%M_%S_%3N")
  • journal_table = "#{old_table}_changes"
  • started = Time.now.strftime("%Y_%m_%d_%H_%M_%S_%3N")
  • new_table = "lhmn_#{curr_table}"
  • old_table = "lhmo_%s_#{curr_table}" % started
  • journal_table = "lhmc_%s_#{curr_table}" % started

lhmc - what does 'c' stand for? changes?

Reply to this email directly or view it on GitHub:
https://github.com/soundcloud/large-hadron-migrator/pull/7/files#r128093


last_insert_id = last_insert_id(curr_table)
say "last inserted id in #{curr_table}: #{last_insert_id}"
Expand Down