Class: DbDiff::Delta::ModifyTable
Instance Attribute Summary
#element
Instance Method Summary
collapse
#initialize, #table, #to_a
Constructor Details
This class inherits a constructor from DbDiff::Delta
Instance Method Details
#process(database) ⇒ Object
246
247
248
249
250
251
|
# File 'lib/dbdiff/delta.rb', line 246
def process(database)
cur_table = database.tables.find{|t| t.name == element.name}
cur_table.engine = element.engine.dup
cur_table.collation = element.collation.dup
end
|
#sql ⇒ Object
242
243
244
|
# File 'lib/dbdiff/delta.rb', line 242
def sql
"ALTER TABLE #{element.name} ENGINE=%s DEFAULT CHARSET=%s" % [element.engine, element.charset]
end
|