Class: CreateActiveBookings

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/active_bookings/templates/migration/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/active_bookings/templates/migration/migration.rb', line 2

def change
  create_table :bookings do |t|
    t.references :bookable, polymorphic: true, index: { name: 'index_active_bookings_bookable' }
    t.references :booker, polymorphic: true, index: { name: 'index_active_bookings_booker' }
    t.column :amount, :integer
    t.column :schedule, :text
    t.column :time_start, :datetime
    t.column :time_end, :datetime
    t.column :time, :datetime

    t.timestamps
  end
end