на оценку 4
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-11-22 23:33:11 +03:00
parent 20afc2c790
commit cc41f601e3
207 changed files with 22098 additions and 120 deletions
@@ -0,0 +1,25 @@
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;