nidus-sync/db/migrations/00148_communications_from_reports.sql
Eli Ribble fcd95f1a25
Get back to compiling, but using new jet for publicreport
This was an epically long change, and a terrible idea, but it compiles.
This was essentially a cascade that came about because I can't blend jet
and bob in the same transaction. In for a penny, I guess...
2026-05-07 10:39:17 +00:00

36 lines
528 B
SQL

-- +goose Up
INSERT INTO communication (
created,
--id,
organization_id,
response_email_log_id,
response_text_log_id,
source_email_log_id,
source_report_id,
source_text_log_id,
status
) SELECT
created,
organization_id,
NULL,
NULL,
NULL,
id,
NULL,
'new'
FROM publicreport.report;
INSERT INTO communication_log_entry (
communication_id,
created,
--id,
type_,
user_
) SELECT
id,
created,
'created',
NULL
FROM communication;
-- +goose Down
DELETE FROM communication_log_entry;
DELETE FROM communication;