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
13 lines
300 B
Ruby
13 lines
300 B
Ruby
class CreateFavoriteProjects < ActiveRecord::Migration[6.0]
|
|
def change
|
|
create_table :favorite_projects, primary_key: [:id, :user_id] do |t|
|
|
t.integer :id, null: false
|
|
t.belongs_to :user
|
|
t.string :title
|
|
t.string :personal_annotation
|
|
|
|
t.timestamps
|
|
end
|
|
end
|
|
end
|