COSCUP ( Conference for Open Source Coders, Users and Promoters) is an annual conference since 2006. It's a major force of Free software movement advocacy in Taiwan.
add_index :users, [:group_id] rename_column :users, :email, :mail end def down remove_column :users, :group_id remove_index :users, [:group_id] rename_column :users, :mail, :email end end Example of Rails Migration
a table? • If we have multiple read replicas, how to alter a table? • How to use open source solution to alter a large table? • How to use LHM without Ruby on Rails?
def self.up Lhm.change_table :users do |m| m.add_column :group_id, "INT(12)" m.add_index [:group_id] m.rename_column(:email, :mail) end end def self.down Lhm.change_table :users do |m| m.remove_index [:group_id] m.remove_column :group_id m.rename_column(:mail, :email) end end end
&& @timeout_seconds < MAX_TIMEOUT Lhm.logger.info("Increasing timeout between strides from #{@timeout_seconds} to #{@timeout_seconds * 2} because #{lag} seconds of slave lag detected is greater than the maximum of #{@allowed_lag} seconds allowed.") @timeout_seconds = @timeout_seconds * 2 elsif lag <= @allowed_lag && @timeout_seconds > INITIAL_TIMEOUT Lhm.logger.info("Decreasing timeout between strides from #{@timeout_seconds} to #{@timeout_seconds / 2} because #{lag} seconds of slave lag detected is less than or equal to the #{@allowed_lag} seconds allowed.") @timeout_seconds = @timeout_seconds / 2 else @timeout_seconds end end