diff --git a/api.cfm b/api.cfm index 05228bd..610ff18 100644 --- a/api.cfm +++ b/api.cfm @@ -85,6 +85,22 @@ + + + CREATE TABLE IF NOT EXISTS upload_chunks ( + id SERIAL PRIMARY KEY, + upload_id TEXT NOT NULL, + chunk_index INTEGER NOT NULL, + total_chunks INTEGER DEFAULT 0, + filename TEXT DEFAULT '', + data TEXT NOT NULL, + contract_id TEXT DEFAULT '', + created_at TIMESTAMPTZ DEFAULT now() + ) + + + + #preserveSingleQuotes(url.sql)# diff --git a/chunk.cfm b/chunk.cfm new file mode 100644 index 0000000..d3818ef --- /dev/null +++ b/chunk.cfm @@ -0,0 +1,113 @@ + + + + + +OK + + + + + + + + + + + + + + + INSERT INTO upload_chunks (upload_id, chunk_index, total_chunks, filename, data, contract_id) + VALUES ( + , + , + , + , + , + + ) + + + + + + + + + + + SELECT chunk_index, data, filename, total_chunks, contract_id + FROM upload_chunks + WHERE upload_id = + ORDER BY chunk_index + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO documents (filename, mime_type, original_bytes, status) + VALUES (,,,'uploaded') + + + SELECT id FROM documents WHERE filename= AND status='uploaded' ORDER BY created_at DESC LIMIT 1 + + + + + + INSERT INTO contracts (number, client) VALUES (,'') + + + SELECT id FROM contracts ORDER BY created_at DESC LIMIT 1 + + + + + + INSERT INTO supplements (contract_id, document_id, type) VALUES (,,) + + + + + DELETE FROM upload_chunks WHERE upload_id = + + + + + + + + + + + + + +#serializeJSON(result)# diff --git a/index.cfm b/index.cfm index 3c562bd..040407b 100644 --- a/index.cfm +++ b/index.cfm @@ -8,6 +8,7 @@ Сверка договоров +