Files
mkd/backend/migrations/add_closing_docs_files_to_payment_invoices.sql
2026-02-04 00:17:04 +05:00

18 lines
637 B
SQL
Executable File

-- Миграция для добавления массива файлов закрывающих документов в payment_invoices
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_name = 'payment_invoices'
AND column_name = 'closing_docs_files'
) THEN
ALTER TABLE payment_invoices
ADD COLUMN closing_docs_files JSONB DEFAULT '[]';
COMMENT ON COLUMN payment_invoices.closing_docs_files IS 'Список файлов закрывающих документов: [{filename, url, size, mimetype, uploadedAt, storedFilename}]';
END IF;
END $$;