nidus-sync/db/migrations/00148_communications_from_reports.sql
Eli Ribble a82732a49c
Return communication database rows from communication API
This is a pretty big refactor of how communication works to start moving
us in the direction we want to go long-term. This adds the new
communication row and migrates existing reports to add rows for
communication.

There's also a bunch of automatic fixes from the new linter. I should
have added them separately, but whatever.
2026-05-01 21:00:23 +00:00

37 lines
482 B
SQL

-- +goose Up
INSERT INTO communication (
closed,
closed_by,
created,
--id,
invalidated,
invalidated_by,
opened,
opened_by,
organization_id,
response_email_log_id,
response_text_log_id,
set_pending,
set_pending_by,
source_email_log_id,
source_report_id,
source_text_log_id
) SELECT
NULL,
NULL,
created,
NULL,
NULL,
NULL,
NULL,
organization_id,
NULL,
NULL,
NULL,
NULL,
NULL,
id,
NULL
FROM publicreport.report;
-- +goose Down
DELETE FROM communication;