251209:1453 Frontend: progress nest = UAT & Bug Fixing
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-09 14:53:42 +07:00
parent 8aceced902
commit aa96cd90e3
125 changed files with 11052 additions and 785 deletions

View File

@@ -1008,10 +1008,9 @@ CREATE TABLE document_number_counters (
-- Foreign Keys
FOREIGN KEY (project_id) REFERENCES projects (id) ON DELETE CASCADE,
FOREIGN KEY (originator_organization_id) REFERENCES organizations (id) ON DELETE CASCADE,
FOREIGN KEY (recipient_organization_id) REFERENCES organizations (id) ON DELETE CASCADE,
-- NOTE: recipient_organization_id uses -1 as sentinel for "all organizations"
-- Therefore NO FK constraint is applied here (would fail for -1)
FOREIGN KEY (correspondence_type_id) REFERENCES correspondence_types (id) ON DELETE CASCADE,
-- ใช้ CHECK constraint เพื่อไม่ให้ตรวจสอบเมื่อเป็น -1
CONSTRAINT fk_recipient_when_not_all FOREIGN KEY (recipient_organization_id) REFERENCES organizations (id) ON DELETE CASCADE,
-- [v1.5.1 NEW] Performance Indexes
INDEX idx_counter_lookup (
project_id,