New associations and models: schedule versioning
For the schedule versioning in the admin interface (having multiple possible shcedules) we need to change some models and associations. It has also been create a rake:move_events_attributes task to migrate the data. User Interface addapted to make use of the introduced associations and models
This commit is contained in:
parent
e34a1904e0
commit
c047ffd699
21 changed files with 165 additions and 49 deletions
9
db/migrate/20160704091928_create_schedules.rb
Normal file
9
db/migrate/20160704091928_create_schedules.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
class CreateSchedules < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :schedules do |t|
|
||||
t.belongs_to :program, index: true
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_column :programs, :selected_schedule, :integer # Selected schedule ID
|
||||
end
|
||||
end
|
||||
11
db/migrate/20160704092023_create_event_schedules.rb
Normal file
11
db/migrate/20160704092023_create_event_schedules.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class CreateEventSchedules < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :event_schedules do |t|
|
||||
t.belongs_to :event, index: true
|
||||
t.belongs_to :schedule, index: true
|
||||
t.belongs_to :room, index: true
|
||||
t.datetime :start_time
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
24
db/schema.rb
24
db/schema.rb
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160624151257) do
|
||||
ActiveRecord::Schema.define(version: 20160704092023) do
|
||||
|
||||
create_table "ahoy_events", force: :cascade do |t|
|
||||
t.uuid "visit_id", limit: 16
|
||||
|
|
@ -176,6 +176,19 @@ ActiveRecord::Schema.define(version: 20160624151257) do
|
|||
t.text "cfp_dates_updated_body"
|
||||
end
|
||||
|
||||
create_table "event_schedules", force: :cascade do |t|
|
||||
t.integer "event_id"
|
||||
t.integer "schedule_id"
|
||||
t.integer "room_id"
|
||||
t.datetime "start_time"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
add_index "event_schedules", ["event_id"], name: "index_event_schedules_on_event_id"
|
||||
add_index "event_schedules", ["room_id"], name: "index_event_schedules_on_room_id"
|
||||
add_index "event_schedules", ["schedule_id"], name: "index_event_schedules_on_schedule_id"
|
||||
|
||||
create_table "event_types", force: :cascade do |t|
|
||||
t.string "title", null: false
|
||||
t.integer "length", default: 30
|
||||
|
|
@ -261,6 +274,7 @@ ActiveRecord::Schema.define(version: 20160624151257) do
|
|||
t.boolean "blind_voting", default: false
|
||||
t.datetime "voting_start_date"
|
||||
t.datetime "voting_end_date"
|
||||
t.integer "selected_schedule"
|
||||
end
|
||||
|
||||
create_table "qanswers", force: :cascade do |t|
|
||||
|
|
@ -335,6 +349,14 @@ ActiveRecord::Schema.define(version: 20160624151257) do
|
|||
t.integer "venue_id", null: false
|
||||
end
|
||||
|
||||
create_table "schedules", force: :cascade do |t|
|
||||
t.integer "program_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
add_index "schedules", ["program_id"], name: "index_schedules_on_program_id"
|
||||
|
||||
create_table "splashpages", force: :cascade do |t|
|
||||
t.integer "conference_id"
|
||||
t.boolean "public"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue