diff --git a/backend/app/models/models.py b/backend/app/models/models.py index 4b7f1e50..246bcd08 100644 --- a/backend/app/models/models.py +++ b/backend/app/models/models.py @@ -1451,6 +1451,8 @@ class BizProtocolPartyCustomer(Base): id = Column(String(64), primary_key=True, comment="主键ID") collection_protocol_id = Column(String(64), nullable=False, comment="采集协议单ID") customer_id = Column(String(64), nullable=True, comment="客户ID") + father_customer_id = Column(String(64), nullable=True, comment="父亲客户ID") + newborn_customer_id = Column(String(64), nullable=True, comment="子女客户ID") mother_name = Column(String(100), nullable=True, comment="母亲姓名") mother_phone = Column(String(32), nullable=True, comment="母亲电话") mother_id_card = Column(String(32), nullable=True, comment="母亲身份证号") diff --git a/backend/app/models/research_donation.py b/backend/app/models/research_donation.py index 4b0a3cb8..0f988ee8 100644 --- a/backend/app/models/research_donation.py +++ b/backend/app/models/research_donation.py @@ -71,7 +71,9 @@ class BizResearchDonationParty(Base): id = Column(String(64), primary_key=True, comment="主键ID") research_donation_id = Column(String(64), nullable=False, comment="科研捐赠ID") - customer_id = Column(String(64), nullable=True, comment="客户ID") + customer_id = Column(String(64), nullable=True, comment="母亲客户ID") + father_customer_id = Column(String(64), nullable=True, comment="父亲客户ID") + newborn_customer_id = Column(String(64), nullable=True, comment="子女客户ID") mother_name = Column(String(100), nullable=True, comment="母亲姓名") mother_phone = Column(String(32), nullable=True, comment="母亲电话") mother_id_card = Column(String(32), nullable=True, comment="母亲身份证号") diff --git a/docs/sql/migrations/2026-10-07-party-father-newborn-customer-id.sql b/docs/sql/migrations/2026-10-07-party-father-newborn-customer-id.sql new file mode 100644 index 00000000..4017da06 --- /dev/null +++ b/docs/sql/migrations/2026-10-07-party-father-newborn-customer-id.sql @@ -0,0 +1,9 @@ +-- 采集协议当事人:父亲/子女客户 ID(母亲沿用 customer_id) +ALTER TABLE biz_protocol_party_customer + ADD COLUMN father_customer_id VARCHAR(64) DEFAULT NULL COMMENT '父亲客户ID' AFTER customer_id, + ADD COLUMN newborn_customer_id VARCHAR(64) DEFAULT NULL COMMENT '子女客户ID' AFTER father_customer_id; + +-- 科研捐赠当事人:同上 +ALTER TABLE biz_research_donation_party + ADD COLUMN father_customer_id VARCHAR(64) DEFAULT NULL COMMENT '父亲客户ID' AFTER customer_id, + ADD COLUMN newborn_customer_id VARCHAR(64) DEFAULT NULL COMMENT '子女客户ID' AFTER father_customer_id;