Sha256: f944ab66e65d53763b7b2f955cf9b15bbec58c6fda6f56daac292a855b89a492
Contents?: true
Size: 516 Bytes
Versions: 13
Compression:
Stored size: 516 Bytes
Contents
class RemoveIconField < ActiveRecord::Migration def self.up if Role.column_names.include?('icon') native_key = :icon prop_key = 'icon' Role.all.each do |rec| next unless value = rec[native_key] prop = rec.prop prop[prop_key] = value Zena::Db.execute "UPDATE #{rec.class.table_name} SET properties=#{Zena::Db.quote(rec.class.encode_properties(prop))} WHERE id=#{rec[:id]}" end remove_column :roles, :icon end end def self.down end end
Version data entries
13 entries across 13 versions & 1 rubygems