demarches-normaliennes/db/migrate/20220520134042_create_targeted_user_links.rb
Martin cb890343ff feat(targeted_user_link): add targeted user link to wrap expert invitation in order to avoid access issue when the expert is connected with another account
feat(user.merge): ensure to merge user.targeted_user_link

Update app/models/targeted_user_link.rb

Co-authored-by: LeSim <mail@simon.lehericey.net>

Update app/models/targeted_user_link.rb

Co-authored-by: LeSim <mail@simon.lehericey.net>

Update app/models/targeted_user_link.rb

Co-authored-by: LeSim <mail@simon.lehericey.net>

feat(db/create_targeted_user_links): ensure not null with fk
2022-05-31 14:50:31 +02:00

13 lines
403 B
Ruby

class CreateTargetedUserLinks < ActiveRecord::Migration[6.1]
def change
# avoid target links with pk sequence
create_table :targeted_user_links, id: :uuid do |t|
t.string :target_context, null: false
t.bigint :target_model_id, null: false
t.string :target_model_type, null: false
t.references :user, foreign_key: true, null: false
t.timestamps
end
end
end