class CreateActiveBookings

Public Instance Methods

change() click to toggle source
# 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