на оценку 5

This commit is contained in:
2026-11-10 16:21:46 +03:00
parent 276dbdad8a
commit 7110afc598
170 changed files with 21149 additions and 30 deletions
@@ -0,0 +1,24 @@
BEGIN;
DROP TABLE IF EXISTS attachment_jobs;
DROP TABLE IF EXISTS attachment_variants;
ALTER TABLE attachments
DROP CONSTRAINT attachments_status_supported,
DROP CONSTRAINT attachments_status_error_consistency,
DROP CONSTRAINT attachments_staging_key_not_blank,
DROP CONSTRAINT attachments_staging_key_unique,
DROP CONSTRAINT attachments_pipeline_version_positive,
DROP COLUMN pipeline_version,
DROP COLUMN staging_key;
UPDATE attachments SET status = 'pending' WHERE status IN ('queued', 'processing');
ALTER TABLE attachments
ADD CONSTRAINT attachments_status_supported CHECK (status IN ('pending', 'ready', 'failed')),
ADD CONSTRAINT attachments_status_error_consistency CHECK (
(status = 'failed' AND error_code IS NOT NULL AND btrim(error_code) <> '')
OR (status IN ('pending', 'ready') AND error_code IS NULL)
);
COMMIT;