Introduce an association between User and Event
Introduce an association between User and Event for the user schedule. As there was already a relation call users in Event the new relation is called public_users. And for the same reason the relation in Event is called public_events.
This commit is contained in:
parent
6e276b2787
commit
39e05a29fa
4 changed files with 18 additions and 0 deletions
8
db/migrate/20160811143427_create_events_users.rb
Normal file
8
db/migrate/20160811143427_create_events_users.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
class CreateEventsUsers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :events_users, id: false do |t|
|
||||
t.references :event
|
||||
t.references :user
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -263,6 +263,11 @@ ActiveRecord::Schema[7.0].define(version: 2024_11_21_114727) do
|
|||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
create_table "events_users", id: false, force: :cascade do |t|
|
||||
t.integer "event_id"
|
||||
t.integer "user_id"
|
||||
end
|
||||
|
||||
create_table "lodgings", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.text "description"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue