feat: consolidate backend and docker-compose setup
This commit is contained in:
commit
ff3753a745
306 files changed
+35450
No files matched your search
@@ -0,0 +1,29 @@
|
||||
-- Migration: 001_init_schema
|
||||
-- Description: Initialize schema for documents and ocr_items
|
||||
|
||||
CREATE TABLE IF NOT EXISTS documents (
|
||||
id SERIAL PRIMARY KEY,
|
||||
filename VARCHAR(255) UNIQUE NOT NULL,
|
||||
upload_time TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
size INTEGER NOT NULL DEFAULT 0,
|
||||
parsed BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
metadata JSONB,
|
||||
layout_parsing_result JSONB,
|
||||
is_sample BOOLEAN NOT NULL DEFAULT FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ocr_items (
|
||||
id SERIAL PRIMARY KEY,
|
||||
document_id INTEGER NOT NULL REFERENCES documents(id) ON DELETE CASCADE,
|
||||
row_index INTEGER NOT NULL,
|
||||
kode_barang_original VARCHAR(255),
|
||||
kode_barang VARCHAR(255),
|
||||
nama_barang VARCHAR(255),
|
||||
banyak_original VARCHAR(255),
|
||||
banyak VARCHAR(255),
|
||||
jumlah_original VARCHAR(255),
|
||||
jumlah VARCHAR(255),
|
||||
is_flagged BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
remark VARCHAR(1000),
|
||||
UNIQUE(document_id, row_index)
|
||||
);
|
||||
Reference in new issue
Block a user