-- ============================================================= -- Project contacts: pick contacts from the linked companies -- (a project no longer shows ALL contacts of the customer) -- Table: yz_backend_crm_project -- 1) upstream_contact_ids : JSON array of contact IDs picked from -- the customer's address book (upstream). -- 2) downstream_contact_ids : JSON array of contact IDs picked from -- the counterpart's address book -- (downstream for type=2 / midstream for type=3). -- Contact details always come from yz_backend_erp_contact in real time; -- only the picked ID references are stored here. Empty array -> ''. -- Run: mysql -h -P -u -p < alter_project_contacts.sql -- (re-running only reports "Duplicate column name", which is safe) -- NOTE: keep this file ASCII-only; piping through some shells mangles non-ASCII. -- ============================================================= ALTER TABLE `yz_backend_crm_project` ADD COLUMN `upstream_contact_ids` TEXT NULL COMMENT 'picked contact IDs (JSON array) from customer address book' AFTER `downstream_phone`; ALTER TABLE `yz_backend_crm_project` ADD COLUMN `downstream_contact_ids` TEXT NULL COMMENT 'picked contact IDs (JSON array) from counterpart address book (downstream/midstream)' AFTER `upstream_contact_ids`;