Sha256: b17c7075af1a0929c925b87a66673090f462a6da8c1d563273e748f4d2eae8fe

Contents?: true

Size: 827 Bytes

Versions: 2

Compression:

Stored size: 827 Bytes

Contents

class CreateVersions < ActiveRecord::Migration
  def self.up
    create_table :versions do |t|
      t.string   :versionable_type, null: false
      t.integer  :versionable_id,   null: false

      t.integer  :user_id

      t.text     :notes

      t.boolean  :initial, null: false, default: false

      t.boolean  :marked_for_removal, null: false, default: false

      t.boolean  :approved, null: false, default: false
      t.boolean  :declined, null: false, default: false
      t.boolean  :pending, null: false, default: true

      t.datetime :created_at
    end
    add_index :versions, :initial
    add_index :versions, [:versionable_type, :versionable_id]
  end

  def self.down
    remove_index :versions, :initial
    remove_index :versions, [:verstionable_type, :versionable_id]
    drop_table :versions
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
controlled_versioning-0.6.1 lib/generators/templates/create_versions.rb
controlled_versioning-0.6 lib/generators/templates/create_versions.rb