Sha256: 5155383bfe68a0a5ba2bd58bea842f72e90adc767a3e947ae8855c7319bc5729

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 Bytes

Contents

class CreateCheckouts < ActiveRecord::Migration
  def self.up
    create_table :checkouts do |t|
      t.integer :user_id
      t.integer :item_id, null: false
      t.integer :checkin_id
      t.integer :librarian_id
      t.integer :basket_id
      t.datetime :due_date
      t.integer :checkout_renewal_count, default: 0, null: false
      t.integer :lock_version, default: 0, null: false
      t.timestamps
    end
    add_index :checkouts, :user_id
    add_index :checkouts, :item_id
    add_index :checkouts, :basket_id
    add_index :checkouts, [:item_id, :basket_id], unique: true
    add_index :checkouts, :librarian_id
    add_index :checkouts, :checkin_id
  end

  def self.down
    drop_table :checkouts
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
enju_seed-0.3.0.beta.3 spec/dummy/db/migrate/033_create_checkouts.rb
enju_seed-0.3.0.beta.2 spec/dummy/db/migrate/033_create_checkouts.rb
enju_seed-0.3.0.beta.1 spec/dummy/db/migrate/033_create_checkouts.rb