Files
34047007@qq.com b95053c52c init: 初始化 dpb 桃育种系统代码库
前后端 + 后端 FastAPI 全量源码、部署脚本与文档。
2026-08-06 00:17:49 +08:00

14 lines
939 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- ============================================================
-- P1.2: tree 育种单株 —— 新增育种阶段/世代/关联种质/参试条目(规格 §4 line 563
-- ------------------------------------------------------------
-- 幂等。bre_tree 表已由 bre_tables.sql 建好。
-- germplasm_id 由「入选晋升」回填,entry_id 由定植单写点派生,均不手填。
-- ============================================================
ALTER TABLE bre_tree ADD COLUMN IF NOT EXISTS stage varchar(32);
ALTER TABLE bre_tree ADD COLUMN IF NOT EXISTS generation varchar(16);
ALTER TABLE bre_tree ADD COLUMN IF NOT EXISTS germplasm_id integer REFERENCES bre_germplasm(id);
CREATE INDEX IF NOT EXISTS ix_bre_tree_germplasm_id ON bre_tree (germplasm_id);
ALTER TABLE bre_tree ADD COLUMN IF NOT EXISTS entry_id integer REFERENCES bre_trial_study_entry(id);
CREATE INDEX IF NOT EXISTS ix_bre_tree_entry_id ON bre_tree (entry_id);