Implement persistent Line ordering for project specs and update bible

This commit is contained in:
2026-02-21 07:09:38 +03:00
parent 3c46cd7bf0
commit e5b6902c9e
22 changed files with 891 additions and 111 deletions

View File

@@ -0,0 +1,18 @@
ALTER TABLE qt_configurations
ADD COLUMN IF NOT EXISTS line_no INT NULL AFTER only_in_stock;
UPDATE qt_configurations q
JOIN (
SELECT
id,
ROW_NUMBER() OVER (
PARTITION BY COALESCE(NULLIF(TRIM(project_uuid), ''), '__NO_PROJECT__')
ORDER BY created_at ASC, id ASC
) AS rn
FROM qt_configurations
WHERE line_no IS NULL OR line_no <= 0
) ranked ON ranked.id = q.id
SET q.line_no = ranked.rn * 10;
ALTER TABLE qt_configurations
ADD INDEX IF NOT EXISTS idx_qt_configurations_project_line_no (project_uuid, line_no);