Add schedule model
This commit is contained in:
parent
a716eae7e8
commit
f34b03d64b
|
@ -0,0 +1,3 @@
|
|||
class Hall < ActiveRecord::Base
|
||||
belongs_to :conference
|
||||
end
|
|
@ -0,0 +1,4 @@
|
|||
class Slot < ActiveRecord::Base
|
||||
belongs_to :hall
|
||||
belongs_to :event
|
||||
end
|
|
@ -0,0 +1,10 @@
|
|||
class CreateHalls < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :halls do |t|
|
||||
t.references :conference, index: true
|
||||
t.string :name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,12 @@
|
|||
class CreateSlots < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :slots do |t|
|
||||
t.references :hall, index: true
|
||||
t.timestamp :starts_at, null: false
|
||||
t.timestamp :ends_at, null: false
|
||||
t.references :event, index: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue