From 97b57a8f0aefb7fdfbb3a3a69d1772dc2f04c0fa Mon Sep 17 00:00:00 2001 From: Rayna-Yu Date: Thu, 13 Nov 2025 17:42:05 -0500 Subject: [PATCH 1/7] add reports --- apps/backend/db/db_setup.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/backend/db/db_setup.sql b/apps/backend/db/db_setup.sql index 8d98851..c8210ef 100644 --- a/apps/backend/db/db_setup.sql +++ b/apps/backend/db/db_setup.sql @@ -58,6 +58,13 @@ CREATE TABLE expenditures ( created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); +CREATE TABLE reports ( + report_id SERIAL PRIMARY KEY, + project_id INT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + object_url TEXT NOT NULL, + date_created DATE NOT NULL DEFAULT CURRENT_DATE +); + INSERT INTO users (name, email, is_admin) VALUES ('Ashley Duggan', 'ashley@branch.org', TRUE), ('Renee Reddy', 'renee@branch.org', TRUE), From 09cc0e8900d02cfa9e65a4b0c1d34a0c5d95eb25 Mon Sep 17 00:00:00 2001 From: Rayna-Yu Date: Thu, 29 Jan 2026 19:11:42 -0500 Subject: [PATCH 2/7] add mock data --- apps/backend/db/db_setup.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/backend/db/db_setup.sql b/apps/backend/db/db_setup.sql index c8210ef..9e42e47 100644 --- a/apps/backend/db/db_setup.sql +++ b/apps/backend/db/db_setup.sql @@ -94,3 +94,10 @@ INSERT INTO expenditures (project_id, entered_by, amount, category, description, (1, 1, 5000, 'Travel', 'Conference attendance', '2025-02-10'), (2, 2, 3000, 'Equipment', 'Purchase of recording devices', '2025-04-05'), (3, 3, 2500, 'Supplies', 'Educational materials', '2025-07-12'); + +INSERT INTO reports (project_id, object_url, date_created) VALUES +(1, 1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf', '2025-06-30'), +(2, 2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf', '2025-09-30'), +(3, 3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf', '2025-12-31'); +(4, 2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf', '2025-02-19'); +(5, 2, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf', '2025-01-12'); From 484483320ed3f72612312d91ab46f5435f9ba403 Mon Sep 17 00:00:00 2001 From: Rayna-Yu Date: Thu, 29 Jan 2026 19:15:52 -0500 Subject: [PATCH 3/7] edit the seed data --- apps/backend/db/db_setup.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/backend/db/db_setup.sql b/apps/backend/db/db_setup.sql index 9e42e47..553ef80 100644 --- a/apps/backend/db/db_setup.sql +++ b/apps/backend/db/db_setup.sql @@ -96,8 +96,8 @@ INSERT INTO expenditures (project_id, entered_by, amount, category, description, (3, 3, 2500, 'Supplies', 'Educational materials', '2025-07-12'); INSERT INTO reports (project_id, object_url, date_created) VALUES -(1, 1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf', '2025-06-30'), -(2, 2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf', '2025-09-30'), -(3, 3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf', '2025-12-31'); -(4, 2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf', '2025-02-19'); -(5, 2, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf', '2025-01-12'); +(1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf', '2025-06-30'), +(2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf', '2025-09-30'), +(3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf', '2025-12-31'); +(2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf', '2025-02-19'); +(3, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf', '2025-01-12'); From 92ca30d95c8a7e6b3b03ee680e95f2e30ad3257d Mon Sep 17 00:00:00 2001 From: Rayna-Yu Date: Thu, 29 Jan 2026 19:18:10 -0500 Subject: [PATCH 4/7] final seed data --- apps/backend/db/db_setup.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/backend/db/db_setup.sql b/apps/backend/db/db_setup.sql index 553ef80..03fb09e 100644 --- a/apps/backend/db/db_setup.sql +++ b/apps/backend/db/db_setup.sql @@ -95,9 +95,9 @@ INSERT INTO expenditures (project_id, entered_by, amount, category, description, (2, 2, 3000, 'Equipment', 'Purchase of recording devices', '2025-04-05'), (3, 3, 2500, 'Supplies', 'Educational materials', '2025-07-12'); -INSERT INTO reports (project_id, object_url, date_created) VALUES -(1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf', '2025-06-30'), -(2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf', '2025-09-30'), -(3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf', '2025-12-31'); -(2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf', '2025-02-19'); -(3, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf', '2025-01-12'); +INSERT INTO reports (project_id, object_url) VALUES +(1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf'), +(2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf'), +(3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf'); +(2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf'); +(3, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf'); From 13658c94460f22ab8f3c04b5b295a44e9b20bfe6 Mon Sep 17 00:00:00 2001 From: Rayna Yu <69086254+Rayna-Yu@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:43:47 -0500 Subject: [PATCH 5/7] Comment out report insertion SQL statements Comment out the INSERT INTO reports statements in db_setup.sql --- apps/backend/db/db_setup.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/backend/db/db_setup.sql b/apps/backend/db/db_setup.sql index 9ef82f0..f64978a 100644 --- a/apps/backend/db/db_setup.sql +++ b/apps/backend/db/db_setup.sql @@ -96,9 +96,9 @@ INSERT INTO expenditures (project_id, entered_by, amount, category, description, (2, 2, 3000, 'Equipment', 'Purchase of recording devices', '2025-04-05'), (3, 3, 2500, 'Supplies', 'Educational materials', '2025-07-12'); -INSERT INTO reports (project_id, object_url) VALUES -(1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf'), -(2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf'), -(3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf'); -(2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf'); -(3, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf'); +-- INSERT INTO reports (project_id, object_url) VALUES +-- (1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf'), +-- (2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf'), +-- (3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf'); +-- (2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf'); +-- (3, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf'); From 86e5f7cf0093d5238a833b3af5fa0293dd1ae9b2 Mon Sep 17 00:00:00 2001 From: Rayna Yu <69086254+Rayna-Yu@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:52:15 -0500 Subject: [PATCH 6/7] Update SQL insert statements for reports --- apps/backend/db/db_setup.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/backend/db/db_setup.sql b/apps/backend/db/db_setup.sql index f64978a..d61a55b 100644 --- a/apps/backend/db/db_setup.sql +++ b/apps/backend/db/db_setup.sql @@ -96,9 +96,9 @@ INSERT INTO expenditures (project_id, entered_by, amount, category, description, (2, 2, 3000, 'Equipment', 'Purchase of recording devices', '2025-04-05'), (3, 3, 2500, 'Supplies', 'Educational materials', '2025-07-12'); --- INSERT INTO reports (project_id, object_url) VALUES --- (1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf'), --- (2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf'), --- (3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf'); --- (2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf'); +INSERT INTO reports (project_id, object_url) VALUES +(1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf'), +(2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf'), +(3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf'); +(2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf'); -- (3, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf'); From 46892b0acb6095b850336e0d88a0bf45d4dba48f Mon Sep 17 00:00:00 2001 From: Rayna-Yu Date: Fri, 13 Feb 2026 10:28:28 -0500 Subject: [PATCH 7/7] fixed extra semicolon --- apps/backend/db/db_setup.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/backend/db/db_setup.sql b/apps/backend/db/db_setup.sql index d61a55b..0cef946 100644 --- a/apps/backend/db/db_setup.sql +++ b/apps/backend/db/db_setup.sql @@ -99,6 +99,6 @@ INSERT INTO expenditures (project_id, entered_by, amount, category, description, INSERT INTO reports (project_id, object_url) VALUES (1, 'https://s3.amazonaws.com/branch-reports/clinician_communication_study_report.pdf'), (2, 'https://s3.amazonaws.com/branch-reports/health_education_initiative_report.pdf'), -(3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf'); -(2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf'); --- (3, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf'); +(3, 'https://s3.amazonaws.com/branch-reports/policy_advocacy_program_report.pdf'), +(2, 'https://s3.amazonaws.com/branch-reports/research_program_reports.pdf'), +(3, 'https://s3.amazonaws.com/branch-reports/health_care_data_reports.pdf');