UNPKG

@damourlabs/euro-clinical-trials

Version:

A Nuxt 3 application for visualizing and managing clinical trials data in Europe, built with modern web technologies.

1,744 lines 114 kB
{ "id": "4d9efa2f-5a1f-49d1-961a-b69987049c9f", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { "public.adverse_events": { "name": "adverse_events", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "patient_uuid": { "name": "patient_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": true }, "event_date": { "name": "event_date", "type": "date", "primaryKey": false, "notNull": true, "default": "CURRENT_DATE" }, "adverse_event_severity": { "name": "adverse_event_severity", "type": "adverse_event_severity_enum", "primaryKey": false, "notNull": true, "default": "'Mild'" }, "adverse_event_outcome": { "name": "adverse_event_outcome", "type": "adverse_event_outcome_enum", "primaryKey": false, "notNull": true, "default": "'Ongoing'" }, "related_to_trial": { "name": "related_to_trial", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "reported_at": { "name": "reported_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "resolved_at": { "name": "resolved_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "idx_adverse_events_patient": { "name": "idx_adverse_events_patient", "columns": [ { "expression": "patient_uuid", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} }, "idx_adverse_events_date": { "name": "idx_adverse_events_date", "columns": [ { "expression": "event_date", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "adverse_events_patient_uuid_patients_uuid_fk": { "name": "adverse_events_patient_uuid_patients_uuid_fk", "tableFrom": "adverse_events", "tableTo": "patients", "columnsFrom": [ "patient_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": { "adverse_events_description_not_empty": { "name": "adverse_events_description_not_empty", "value": "LENGTH(TRIM(\"adverse_events\".\"description\")) > 0" }, "adverse_events_resolution_logic": { "name": "adverse_events_resolution_logic", "value": "(\"adverse_events\".\"adverse_event_outcome\" = 'Resolved' AND \"adverse_events\".\"resolved_at\" IS NOT NULL) OR (\"adverse_events\".\"adverse_event_outcome\" != 'Resolved' AND \"adverse_events\".\"resolved_at\" IS NULL)" } }, "isRLSEnabled": false }, "public.audit_log_details": { "name": "audit_log_details", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "audit_log_uuid": { "name": "audit_log_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "consent_uuid": { "name": "consent_uuid", "type": "uuid", "primaryKey": false, "notNull": false }, "patient_uuid": { "name": "patient_uuid", "type": "uuid", "primaryKey": false, "notNull": false }, "legal_basis": { "name": "legal_basis", "type": "legal_basis_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'Legal_obligation'" } }, "indexes": {}, "foreignKeys": { "audit_log_details_audit_log_uuid_audit_logs_uuid_fk": { "name": "audit_log_details_audit_log_uuid_audit_logs_uuid_fk", "tableFrom": "audit_log_details", "tableTo": "audit_logs", "columnsFrom": [ "audit_log_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "audit_log_details_consent_uuid_gdpr_consents_uuid_fk": { "name": "audit_log_details_consent_uuid_gdpr_consents_uuid_fk", "tableFrom": "audit_log_details", "tableTo": "gdpr_consents", "columnsFrom": [ "consent_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "audit_log_details_patient_uuid_patients_uuid_fk": { "name": "audit_log_details_patient_uuid_patients_uuid_fk", "tableFrom": "audit_log_details", "tableTo": "patients", "columnsFrom": [ "patient_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "audit_log_details_audit_log_uuid_unique": { "name": "audit_log_details_audit_log_uuid_unique", "nullsNotDistinct": false, "columns": [ "audit_log_uuid" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.audit_logs": { "name": "audit_logs", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "trial_uuid": { "name": "trial_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "user_uuid": { "name": "user_uuid", "type": "uuid", "primaryKey": false, "notNull": false }, "audit_action": { "name": "audit_action", "type": "audit_action_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'View'" }, "audit_entity_type": { "name": "audit_entity_type", "type": "audit_entity_type_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'Trial'" }, "entity_uuid": { "name": "entity_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "old_values": { "name": "old_values", "type": "jsonb", "primaryKey": false, "notNull": false }, "new_values": { "name": "new_values", "type": "jsonb", "primaryKey": false, "notNull": false }, "changes": { "name": "changes", "type": "jsonb", "primaryKey": false, "notNull": true, "default": "'[]'::jsonb" }, "timestamp": { "name": "timestamp", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "ip_address": { "name": "ip_address", "type": "inet", "primaryKey": false, "notNull": false }, "user_agent": { "name": "user_agent", "type": "text", "primaryKey": false, "notNull": false }, "session_id": { "name": "session_id", "type": "uuid", "primaryKey": false, "notNull": false } }, "indexes": { "idx_audit_logs_timestamp": { "name": "idx_audit_logs_timestamp", "columns": [ { "expression": "timestamp", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} }, "idx_audit_logs_entity": { "name": "idx_audit_logs_entity", "columns": [ { "expression": "audit_entity_type", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "entity_uuid", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "audit_logs_trial_uuid_trials_uuid_fk": { "name": "audit_logs_trial_uuid_trials_uuid_fk", "tableFrom": "audit_logs", "tableTo": "trials", "columnsFrom": [ "trial_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "audit_logs_user_uuid_users_uuid_fk": { "name": "audit_logs_user_uuid_users_uuid_fk", "tableFrom": "audit_logs", "tableTo": "users", "columnsFrom": [ "user_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.documents": { "name": "documents", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "title": { "name": "title", "type": "varchar(255)", "primaryKey": false, "notNull": true }, "url": { "name": "url", "type": "text", "primaryKey": false, "notNull": true }, "document_type": { "name": "document_type", "type": "document_type_enum", "primaryKey": false, "notNull": true, "default": "'Other'" }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, "upload_date": { "name": "upload_date", "type": "date", "primaryKey": false, "notNull": true, "default": "CURRENT_DATE" }, "uploaded_by": { "name": "uploaded_by", "type": "uuid", "primaryKey": false, "notNull": true }, "trial_uuid": { "name": "trial_uuid", "type": "uuid", "primaryKey": false, "notNull": false }, "site_uuid": { "name": "site_uuid", "type": "uuid", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "documents_uploaded_by_users_uuid_fk": { "name": "documents_uploaded_by_users_uuid_fk", "tableFrom": "documents", "tableTo": "users", "columnsFrom": [ "uploaded_by" ], "columnsTo": [ "uuid" ], "onDelete": "restrict", "onUpdate": "no action" }, "documents_trial_uuid_trials_uuid_fk": { "name": "documents_trial_uuid_trials_uuid_fk", "tableFrom": "documents", "tableTo": "trials", "columnsFrom": [ "trial_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "documents_site_uuid_sites_uuid_fk": { "name": "documents_site_uuid_sites_uuid_fk", "tableFrom": "documents", "tableTo": "sites", "columnsFrom": [ "site_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": { "documents_title_not_empty": { "name": "documents_title_not_empty", "value": "LENGTH(TRIM(\"documents\".\"title\")) > 0" }, "documents_url_not_empty": { "name": "documents_url_not_empty", "value": "LENGTH(TRIM(\"documents\".\"url\")) > 0" } }, "isRLSEnabled": false }, "public.regulatory_documents": { "name": "regulatory_documents", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "regulatory_approval_uuid": { "name": "regulatory_approval_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "document_uuid": { "name": "document_uuid", "type": "uuid", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "regulatory_documents_regulatory_approval_uuid_regulatory_approvals_uuid_fk": { "name": "regulatory_documents_regulatory_approval_uuid_regulatory_approvals_uuid_fk", "tableFrom": "regulatory_documents", "tableTo": "regulatory_approvals", "columnsFrom": [ "regulatory_approval_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "regulatory_documents_document_uuid_documents_uuid_fk": { "name": "regulatory_documents_document_uuid_documents_uuid_fk", "tableFrom": "regulatory_documents", "tableTo": "documents", "columnsFrom": [ "document_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "regulatory_documents_unique": { "name": "regulatory_documents_unique", "nullsNotDistinct": false, "columns": [ "regulatory_approval_uuid", "document_uuid" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.conditions": { "name": "conditions", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "name": { "name": "name", "type": "varchar(255)", "primaryKey": false, "notNull": true }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "conditions_name_unique": { "name": "conditions_name_unique", "nullsNotDistinct": false, "columns": [ "name" ] } }, "policies": {}, "checkConstraints": { "conditions_name_not_empty": { "name": "conditions_name_not_empty", "value": "LENGTH(TRIM(\"conditions\".\"name\")) > 0" } }, "isRLSEnabled": false }, "public.criteria": { "name": "criteria", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "eligibility_criteria_uuid": { "name": "eligibility_criteria_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": true }, "criteria_type": { "name": "criteria_type", "type": "criteria_type_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'Inclusion'" }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "criteria_eligibility_criteria_uuid_eligibility_criteria_uuid_fk": { "name": "criteria_eligibility_criteria_uuid_eligibility_criteria_uuid_fk", "tableFrom": "criteria", "tableTo": "eligibility_criteria", "columnsFrom": [ "eligibility_criteria_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": { "criteria_description_not_empty": { "name": "criteria_description_not_empty", "value": "LENGTH(TRIM(\"criteria\".\"description\")) > 0" } }, "isRLSEnabled": false }, "public.eligibility_conditions": { "name": "eligibility_conditions", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "eligibility_criteria_uuid": { "name": "eligibility_criteria_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "condition_uuid": { "name": "condition_uuid", "type": "uuid", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "eligibility_conditions_eligibility_criteria_uuid_eligibility_criteria_uuid_fk": { "name": "eligibility_conditions_eligibility_criteria_uuid_eligibility_criteria_uuid_fk", "tableFrom": "eligibility_conditions", "tableTo": "eligibility_criteria", "columnsFrom": [ "eligibility_criteria_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "eligibility_conditions_condition_uuid_conditions_uuid_fk": { "name": "eligibility_conditions_condition_uuid_conditions_uuid_fk", "tableFrom": "eligibility_conditions", "tableTo": "conditions", "columnsFrom": [ "condition_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "eligibility_conditions_unique": { "name": "eligibility_conditions_unique", "nullsNotDistinct": false, "columns": [ "eligibility_criteria_uuid", "condition_uuid" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.eligibility_criteria": { "name": "eligibility_criteria", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "trial_uuid": { "name": "trial_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "min_age": { "name": "min_age", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "max_age": { "name": "max_age", "type": "integer", "primaryKey": false, "notNull": true, "default": 100 }, "sex": { "name": "sex", "type": "sex_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'All'" }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "eligibility_criteria_trial_uuid_trials_uuid_fk": { "name": "eligibility_criteria_trial_uuid_trials_uuid_fk", "tableFrom": "eligibility_criteria", "tableTo": "trials", "columnsFrom": [ "trial_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": { "eligibility_criteria_age_range": { "name": "eligibility_criteria_age_range", "value": "\"eligibility_criteria\".\"min_age\" <= \"eligibility_criteria\".\"max_age\"" }, "eligibility_criteria_age_positive": { "name": "eligibility_criteria_age_positive", "value": "\"eligibility_criteria\".\"min_age\" >= 0 AND \"eligibility_criteria\".\"max_age\" >= 0" } }, "isRLSEnabled": false }, "public.participant_enrollment": { "name": "participant_enrollment", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "trial_uuid": { "name": "trial_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "current_enrollment": { "name": "current_enrollment", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "target_enrollment": { "name": "target_enrollment", "type": "integer", "primaryKey": false, "notNull": true, "default": 100 }, "eligibility_criteria_uuid": { "name": "eligibility_criteria_uuid", "type": "uuid", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "participant_enrollment_trial_uuid_trials_uuid_fk": { "name": "participant_enrollment_trial_uuid_trials_uuid_fk", "tableFrom": "participant_enrollment", "tableTo": "trials", "columnsFrom": [ "trial_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "participant_enrollment_eligibility_criteria_uuid_eligibility_criteria_uuid_fk": { "name": "participant_enrollment_eligibility_criteria_uuid_eligibility_criteria_uuid_fk", "tableFrom": "participant_enrollment", "tableTo": "eligibility_criteria", "columnsFrom": [ "eligibility_criteria_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "restrict", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "participant_enrollment_trial_uuid_unique": { "name": "participant_enrollment_trial_uuid_unique", "nullsNotDistinct": false, "columns": [ "trial_uuid" ] } }, "policies": {}, "checkConstraints": { "participant_enrollment_numbers_positive": { "name": "participant_enrollment_numbers_positive", "value": "\"participant_enrollment\".\"current_enrollment\" >= 0 AND \"participant_enrollment\".\"target_enrollment\" >= 0" }, "participant_enrollment_realistic": { "name": "participant_enrollment_realistic", "value": "\"participant_enrollment\".\"current_enrollment\" <= \"participant_enrollment\".\"target_enrollment\"" } }, "isRLSEnabled": false }, "public.data_anonymization_log": { "name": "data_anonymization_log", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "patient_uuid": { "name": "patient_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "trial_uuid": { "name": "trial_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "anonymization_date": { "name": "anonymization_date", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "anonymization_method": { "name": "anonymization_method", "type": "anonymization_method_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'DataPseudonymization'" }, "anonymized_fields": { "name": "anonymized_fields", "type": "jsonb", "primaryKey": false, "notNull": true }, "performed_by": { "name": "performed_by", "type": "uuid", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "data_anonymization_log_trial_uuid_trials_uuid_fk": { "name": "data_anonymization_log_trial_uuid_trials_uuid_fk", "tableFrom": "data_anonymization_log", "tableTo": "trials", "columnsFrom": [ "trial_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "data_anonymization_log_performed_by_users_uuid_fk": { "name": "data_anonymization_log_performed_by_users_uuid_fk", "tableFrom": "data_anonymization_log", "tableTo": "users", "columnsFrom": [ "performed_by" ], "columnsTo": [ "uuid" ], "onDelete": "restrict", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.data_retention_policies": { "name": "data_retention_policies", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "trial_uuid": { "name": "trial_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "data_type": { "name": "data_type", "type": "data_type_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'PersonalData'" }, "retention_period_years": { "name": "retention_period_years", "type": "integer", "primaryKey": false, "notNull": true }, "deletion_trigger": { "name": "deletion_trigger", "type": "deletion_trigger_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'PolicyBased'" }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "data_retention_policies_trial_uuid_trials_uuid_fk": { "name": "data_retention_policies_trial_uuid_trials_uuid_fk", "tableFrom": "data_retention_policies", "tableTo": "trials", "columnsFrom": [ "trial_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "data_retention_policies_unique_per_trial": { "name": "data_retention_policies_unique_per_trial", "nullsNotDistinct": false, "columns": [ "trial_uuid", "data_type" ] } }, "policies": {}, "checkConstraints": { "data_retention_policies_retention_positive": { "name": "data_retention_policies_retention_positive", "value": "\"data_retention_policies\".\"retention_period_years\" > 0" } }, "isRLSEnabled": false }, "public.data_subject_requests": { "name": "data_subject_requests", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "patient_uuid": { "name": "patient_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "request_type": { "name": "request_type", "type": "data_subject_request_type_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'Access'" }, "status": { "name": "status", "type": "data_subject_request_status_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'Pending'" }, "requested_at": { "name": "requested_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "processed_at": { "name": "processed_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "processed_by": { "name": "processed_by", "type": "uuid", "primaryKey": false, "notNull": false }, "response_data": { "name": "response_data", "type": "jsonb", "primaryKey": false, "notNull": true }, "notes": { "name": "notes", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": {}, "foreignKeys": { "data_subject_requests_patient_uuid_patients_uuid_fk": { "name": "data_subject_requests_patient_uuid_patients_uuid_fk", "tableFrom": "data_subject_requests", "tableTo": "patients", "columnsFrom": [ "patient_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "data_subject_requests_processed_by_users_uuid_fk": { "name": "data_subject_requests_processed_by_users_uuid_fk", "tableFrom": "data_subject_requests", "tableTo": "users", "columnsFrom": [ "processed_by" ], "columnsTo": [ "uuid" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.gdpr_consents": { "name": "gdpr_consents", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "trial_uuid": { "name": "trial_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "patient_uuid": { "name": "patient_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "consent_given": { "name": "consent_given", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "consent_date": { "name": "consent_date", "type": "date", "primaryKey": false, "notNull": true, "default": "CURRENT_DATE" }, "legal_basis": { "name": "legal_basis", "type": "legal_basis_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'Consent'" }, "consent_type": { "name": "consent_type", "type": "consent_type_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'Data_processing'" }, "purpose": { "name": "purpose", "type": "purpose_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'Clinical_trial_management'" }, "retention_period": { "name": "retention_period", "type": "integer", "primaryKey": false, "notNull": true, "default": 5 }, "data_processing_details": { "name": "data_processing_details", "type": "text", "primaryKey": false, "notNull": true, "default": "'Data will be processed for the purpose of clinical trial management and regulatory compliance'" }, "user_agent": { "name": "user_agent", "type": "text", "primaryKey": false, "notNull": false }, "consent_status": { "name": "consent_status", "type": "consent_status_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'NotConsented'" }, "withdrawal_date": { "name": "withdrawal_date", "type": "date", "primaryKey": false, "notNull": false }, "withdrawal_method": { "name": "withdrawal_method", "type": "withdrawal_method_enum", "typeSchema": "public", "primaryKey": false, "notNull": true }, "withdrawal_reason": { "name": "withdrawal_reason", "type": "withdrawal_reason_enum", "typeSchema": "public", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": { "idx_gdpr_consents_patient": { "name": "idx_gdpr_consents_patient", "columns": [ { "expression": "patient_uuid", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} }, "idx_gdpr_consents_trial": { "name": "idx_gdpr_consents_trial", "columns": [ { "expression": "trial_uuid", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "gdpr_consents_trial_uuid_trials_uuid_fk": { "name": "gdpr_consents_trial_uuid_trials_uuid_fk", "tableFrom": "gdpr_consents", "tableTo": "trials", "columnsFrom": [ "trial_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "gdpr_consents_patient_uuid_patients_uuid_fk": { "name": "gdpr_consents_patient_uuid_patients_uuid_fk", "tableFrom": "gdpr_consents", "tableTo": "patients", "columnsFrom": [ "patient_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": { "gdpr_consents_retention_positive": { "name": "gdpr_consents_retention_positive", "value": "\"gdpr_consents\".\"retention_period\" > 0" }, "gdpr_consents_withdrawal_logic": { "name": "gdpr_consents_withdrawal_logic", "value": "(\"gdpr_consents\".\"consent_status\" = 'Withdrawn' AND \"gdpr_consents\".\"withdrawal_date\" IS NOT NULL) OR (\"gdpr_consents\".\"consent_status\" != 'Withdrawn' AND \"gdpr_consents\".\"withdrawal_date\" IS NULL)" } }, "isRLSEnabled": false }, "public.gdpr_data_categories": { "name": "gdpr_data_categories", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "consent_uuid": { "name": "consent_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "category": { "name": "category", "type": "gdpr_data_category_enum", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'Health_data'" } }, "indexes": {}, "foreignKeys": { "gdpr_data_categories_consent_uuid_gdpr_consents_uuid_fk": { "name": "gdpr_data_categories_consent_uuid_gdpr_consents_uuid_fk", "tableFrom": "gdpr_data_categories", "tableTo": "gdpr_consents", "columnsFrom": [ "consent_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "gdpr_data_categories_unique_per_consent": { "name": "gdpr_data_categories_unique_per_consent", "nullsNotDistinct": false, "columns": [ "consent_uuid", "category" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.users": { "name": "users", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "email": { "name": "email", "type": "varchar(255)", "primaryKey": false, "notNull": true }, "name": { "name": "name", "type": "varchar(100)", "primaryKey": false, "notNull": true }, "phone_number": { "name": "phone_number", "type": "varchar(20)", "primaryKey": false, "notNull": false }, "institution": { "name": "institution", "type": "varchar(100)", "primaryKey": false, "notNull": true, "default": "'Unknown Institution'" }, "role": { "name": "role", "type": "varchar(50)", "primaryKey": false, "notNull": true, "default": "'Patient'" }, "is_active": { "name": "is_active", "type": "boolean", "primaryKey": false, "notNull": true, "default": true }, "email_verified": { "name": "email_verified", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "email_verification_token": { "name": "email_verification_token", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "email_verification_expires": { "name": "email_verification_expires", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "magic_link_token": { "name": "magic_link_token", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "magic_link_expires": { "name": "magic_link_expires", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "two_factor_enabled": { "name": "two_factor_enabled", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "two_factor_secret": { "name": "two_factor_secret", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "two_factor_token": { "name": "two_factor_token", "type": "varchar(10)", "primaryKey": false, "notNull": false }, "two_factor_expires": { "name": "two_factor_expires", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "login_attempts": { "name": "login_attempts", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "account_locked_until": { "name": "account_locked_until", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "last_login_at": { "name": "last_login_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "github_id": { "name": "github_id", "type": "varchar(100)", "primaryKey": false, "notNull": false }, "gdpr_consent_given": { "name": "gdpr_consent_given", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "gdpr_consent_date": { "name": "gdpr_consent_date", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "users_email_unique": { "name": "users_email_unique", "nullsNotDistinct": false, "columns": [ "email" ] } }, "policies": {}, "checkConstraints": { "users_email_format": { "name": "users_email_format", "value": "\"users\".\"email\" ~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$'" }, "users_name_not_empty": { "name": "users_name_not_empty", "value": "LENGTH(TRIM(\"users\".\"name\")) > 0" }, "users_login_attempts_non_negative": { "name": "users_login_attempts_non_negative", "value": "\"users\".\"login_attempts\" >= 0" } }, "isRLSEnabled": false }, "public.trial_administrative_info": { "name": "trial_administrative_info", "schema": "", "columns": { "uuid": { "name": "uuid", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "trial_uuid": { "name": "trial_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "sponsor_uuid": { "name": "sponsor_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "principal_investigator_uuid": { "name": "principal_investigator_uuid", "type": "uuid", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": { "trial_administrative_info_trial_uuid_trials_uuid_fk": { "name": "trial_administrative_info_trial_uuid_trials_uuid_fk", "tableFrom": "trial_administrative_info", "tableTo": "trials", "columnsFrom": [ "trial_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "cascade", "onUpdate": "no action" }, "trial_administrative_info_sponsor_uuid_users_uuid_fk": { "name": "trial_administrative_info_sponsor_uuid_users_uuid_fk", "tableFrom": "trial_administrative_info", "tableTo": "users", "columnsFrom": [ "sponsor_uuid" ], "columnsTo": [ "uuid" ], "onDelete": "restrict", "onUpdate": "no action" }, "trial_administrative_info_principal_investigator_uuid_users_uuid_fk": { "name": "trial_administrative_info_principal_investigator_uuid_users_uuid_fk", "tableFrom": "trial_administrative_info", "tableTo": "users", "columnsFrom": [ "principal_investigator_uuid" ], "columnsT