tiss2go/db/migrate/20200421152314_create_favorite_people.rb
Pfingstfrosch ca38d7260d fixed bugfix where another user could not store the same object again
fixed the primary keys => all the classes have now composite primary key which contais an id + user_id, necessary gem: 'composite_primary_keys'
fixed the user_id relation => every class now "belongs_to" user

pls kill me know
2020-06-05 00:35:04 +02:00

14 lines
364 B
Ruby

class CreateFavoritePeople < ActiveRecord::Migration[6.0]
def change
create_table :favorite_people, primary_key: [:tiss_id, :user_id] do |t|
t.integer :tiss_id, null: false
t.belongs_to :user
t.string :first_name
t.string :last_name
t.string :picture_uri
t.string :personal_annotation
t.timestamps
end
end
end