db: enforce unique signal_role per equipment on point

Prevents accidentally binding two points with the same role to the
same equipment at the database level.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
caoqianming 2026-03-26 22:14:27 +08:00
parent 45b2317ee8
commit 1354f89204
1 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1,2 @@
ALTER TABLE point
ADD CONSTRAINT uq_equipment_signal_role UNIQUE (equipment_id, signal_role);