Sha256: eb18d7a6b0c6ddebb2887db029cbea90b9f4063b9f1e62acfbb428eae3cb8078

Contents?: true

Size: 930 Bytes

Versions: 18

Compression:

Stored size: 930 Bytes

Contents

class CreateDirtyHistoryRecords < ActiveRecord::Migration
  def self.up
    create_table :dirty_history_records do |t|                                           
      t.references :creator,  :polymorphic => true # creates creator_type and creator_id field
      t.references :object,   :polymorphic => true # creates object_type and object_id field            
      t.string     :column_name, :length => 64
      t.string     :column_type, :length => 16 # :string, :text, :integer, :decimal, :float, :datetime, :boolean
      t.text       :old_value
      t.text       :new_value
    
      t.datetime   :created_at
      t.datetime   :revised_created_at
      t.datetime   :updated_at
      t.datetime   :deleted_at
    end
    add_index :dirty_history_records, [:creator_id, :creator_type]
    add_index :dirty_history_records, [:object_id,  :object_type]
  end

  def self.down
    drop_table :dirty_history_records
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dirty_history-0.6.3 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.6.2 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.6.1 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.6.0 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.5.4 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.5.3 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.5.2 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.5.1 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.5.0 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.4.10 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.4.9 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.4.8 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.4.7 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.4.6 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.4.5 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.4.4 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.4.3 lib/generators/dirty_history/migration/templates/active_record/migration.rb
dirty_history-0.4.2 lib/generators/dirty_history/migration/templates/active_record/migration.rb