diff --git a/app/models/hall.rb b/app/models/hall.rb new file mode 100644 index 0000000..9661672 --- /dev/null +++ b/app/models/hall.rb @@ -0,0 +1,3 @@ +class Hall < ActiveRecord::Base + belongs_to :conference +end diff --git a/app/models/slot.rb b/app/models/slot.rb new file mode 100644 index 0000000..bb5509c --- /dev/null +++ b/app/models/slot.rb @@ -0,0 +1,4 @@ +class Slot < ActiveRecord::Base + belongs_to :hall + belongs_to :event +end diff --git a/db/migrate/20141012100900_create_halls.rb b/db/migrate/20141012100900_create_halls.rb new file mode 100644 index 0000000..6825079 --- /dev/null +++ b/db/migrate/20141012100900_create_halls.rb @@ -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 diff --git a/db/migrate/20141012101004_create_slots.rb b/db/migrate/20141012101004_create_slots.rb new file mode 100644 index 0000000..379cd0b --- /dev/null +++ b/db/migrate/20141012101004_create_slots.rb @@ -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