Sha256: bf19b6cdcb95f3d361e873426abec536c32d923cde34f0f042681886f2ff9ab4
Contents?: true
Size: 1.04 KB
Versions: 11
Compression:
Stored size: 1.04 KB
Contents
class ExtendLabel < ActiveRecord::Migration FIELDS = [ {"rev" => {:type => :integer, :options => {:default => 1}}}, {"published_version_id" => {:type => :integer}}, {"published_at" => {:type => :date}}, {"locked_by" => {:type => :integer}}, {"expired_at" => {:type => :date}}, {"follow_up" => {:type => :date}}, {"to_review" => {:type => :boolean}}, {"rdf_updated_at" => {:type => :date}} ] def self.up FIELDS.each do |hsh| hsh.each do |column_name, hsh2| unless column_exists?(:labels, column_name) add_column(:labels, column_name, hsh2[:type], (hsh2[:options] || {})) end end end add_index :labels, "published_version_id", :name => "ix_labels_on_published_v" unless index_exists?(:labels, "published_version_id", :name => "ix_labels_on_published_v") end def self.down FIELDS.each do |hsh| hsh.each do |column_name, hsh2| if column_exists?(:labels, column_name) remove_column(:labels, column_name) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems