Sha256: 23e7fd0eed6180af40a0aacd505a46a6906f527a2bcebde16818228e67560d39

Contents?: true

Size: 668 Bytes

Versions: 56

Compression:

Stored size: 668 Bytes

Contents

class CreateCheckouts < ActiveRecord::Migration[4.2]
  def self.up
    create_table :checkouts do |t|
      t.references :user, index: true, foreign_key: true
      t.references :item, index: true, foreign_key: true, null: false
      t.references :checkin, index: true, foreign_key: true
      t.references :librarian, index: true
      t.references :basket, index: true
      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, [:item_id, :basket_id], unique: true
  end

  def self.down
    drop_table :checkouts
  end
end

Version data entries

56 entries across 56 versions & 4 rubygems

Version Path
enju_biblio-0.3.10.rc.1 spec/dummy/db/migrate/033_create_checkouts.rb
enju_biblio-0.3.9 spec/dummy/db/migrate/033_create_checkouts.rb
enju_biblio-0.4.0.rc.1 spec/dummy/db/migrate/033_create_checkouts.rb
enju_library-0.4.0.rc.1 spec/dummy/db/migrate/033_create_checkouts.rb
enju_circulation-0.3.8 db/migrate/033_create_checkouts.rb
enju_biblio-0.3.8 spec/dummy/db/migrate/033_create_checkouts.rb
enju_library-0.3.7 spec/dummy/db/migrate/033_create_checkouts.rb
enju_circulation-0.3.7 db/migrate/033_create_checkouts.rb
enju_library-0.3.6 spec/dummy/db/migrate/033_create_checkouts.rb
enju_biblio-0.3.7 spec/dummy/db/migrate/033_create_checkouts.rb
enju_biblio-0.3.6 spec/dummy/db/migrate/033_create_checkouts.rb
enju_library-0.4.0.beta.4 spec/dummy/db/migrate/033_create_checkouts.rb
enju_circulation-0.4.0.beta.4 db/migrate/033_create_checkouts.rb
enju_circulation-0.4.0.beta.3 db/migrate/033_create_checkouts.rb
enju_biblio-0.4.0.beta.2 spec/dummy/db/migrate/033_create_checkouts.rb
enju_library-0.4.0.beta.3 spec/dummy/db/migrate/033_create_checkouts.rb
enju_circulation-0.3.6 db/migrate/033_create_checkouts.rb
enju_circulation-0.4.0.beta.2 db/migrate/033_create_checkouts.rb
enju_library-0.4.0.beta.2 spec/dummy/db/migrate/033_create_checkouts.rb
enju_circulation-0.4.0.beta.1 db/migrate/033_create_checkouts.rb