Sha256: fc000f598ef388a523a3d989701da2499768d1a60c91c16544d7d6061762d166

Contents?: true

Size: 1.25 KB

Versions: 30

Compression:

Stored size: 1.25 KB

Contents

# -*- encoding : utf-8 -*-
class CreateNewRevisionTables < ActiveRecord::Migration

  def up
    add_column :cards, :db_content, :text
    
    create_table :card_acts do |t|
      t.integer  :card_id
      t.integer  :actor_id
      t.datetime :acted_at
      t.string   :ip_address
    end
    
    create_table :card_actions do |t|
      t.integer :card_id
      t.integer :card_act_id
      t.integer :super_action_id
      t.integer :action_type
      t.boolean :draft
    end
    
    create_table :card_changes do |t|
      t.integer :card_action_id
      t.integer :field
      t.text    :value 
    end
    
    add_index :card_acts, :card_id, :name=>'card_id_index'
    add_index :card_acts, :actor_id, :name=>'actor_id_index'
    add_index :card_actions, :card_id, :name=>'card_id_index'
    add_index :card_actions, :card_act_id, :name=>'card_act_id_index'
    add_index :card_changes, :card_action_id, :name=>'card_action_id_index'
    #add_index :card_actions, [:card_id, :draft], :name=>'card_id_and_draft_index'
    #add_index :card_changes, [:card_action_id, :field], :name=>'card_action_id_and_field_index'
  end

  def down
    remove_column :cards, :db_content
    drop_table :card_acts
    drop_table :card_actions
    drop_table :card_changes
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
card-1.16.6 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.16.5 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.16.4 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.16.3 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.16.2 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.16.1 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.16.0 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.7 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.6 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.5 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.4 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.3 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.2 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.1 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.0 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.pre2 db/migrate/20140822073704_create_new_revision_tables.rb
card-1.15.pre db/migrate/20140822073704_create_new_revision_tables.rb
wagn-1.14.9 db/migrate/20140822073704_create_new_revision_tables.rb
wagn-1.14.8 db/migrate/20140822073704_create_new_revision_tables.rb
wagn-1.14.7 db/migrate/20140822073704_create_new_revision_tables.rb