mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Validation in EventSchedule
Validation to avoid scheduling the same event twice for the same schedule.
This commit is contained in:
parent
2b4bf2fff7
commit
f0a7f3c59b
3 changed files with 8 additions and 1 deletions
5
db/migrate/20160815140302_add_index_to_event_schedule.rb
Normal file
5
db/migrate/20160815140302_add_index_to_event_schedule.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexToEventSchedule < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :event_schedules, [:event_id, :schedule_id], unique: true
|
||||
end
|
||||
end
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160704092023) do
|
||||
ActiveRecord::Schema.define(version: 20160815140302) do
|
||||
|
||||
create_table "ahoy_events", force: :cascade do |t|
|
||||
t.uuid "visit_id", limit: 16
|
||||
|
|
@ -185,6 +185,7 @@ ActiveRecord::Schema.define(version: 20160704092023) do
|
|||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
add_index "event_schedules", ["event_id", "schedule_id"], name: "index_event_schedules_on_event_id_and_schedule_id", unique: true
|
||||
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue