Sha256: 3d80b93086cf06aac668ed965a8e6cacc9810592501d1cc892b983f87eb87a9a

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

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  :accepted, 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, :accepted
    add_index :versions, :declined
    add_index :versions, :pending
    add_index :versions, [:versionable_type, :versionable_id]
  end

  def self.down
    remove_index :versions, :initial
    remove_index :versions, :accepted
    remove_index :versions, :declined
    remove_index :versions, :pending
    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.3 lib/generators/templates/create_versions.rb
controlled_versioning-0.6.2 lib/generators/templates/create_versions.rb