Jack S
2 years ago
4 changed files with 34 additions and 1 deletions
@ -0,0 +1,4 @@
|
||||
class DataSharingAgreement < ApplicationRecord |
||||
belongs_to :organisation |
||||
belongs_to :data_protection_officer, class_name: "User" |
||||
end |
@ -0,0 +1,17 @@
|
||||
class AddDataSharingAgreement < ActiveRecord::Migration[7.0] |
||||
def change |
||||
create_table :data_sharing_agreements do |t| |
||||
t.belongs_to :organisation |
||||
t.belongs_to :data_protection_officer, class_name: "User" |
||||
|
||||
t.datetime :signed_at, null: false |
||||
|
||||
t.timestamps |
||||
end |
||||
|
||||
add_index :data_sharing_agreements, |
||||
%i[organisation_id data_protection_officer_id], |
||||
unique: true, |
||||
name: "data_sharing_agreements_unique" |
||||
end |
||||
end |
Loading…
Reference in new issue