Added db configurations and Dockerfile

This commit is contained in:
Fabio Scotto di Santolo
2025-06-03 18:17:47 +02:00
parent 0c17486015
commit eab9c25885
17 changed files with 889 additions and 51 deletions

13
scripts/database/db.sql Normal file
View File

@@ -0,0 +1,13 @@
CREATE TABLE IF NOT EXISTS documents
(
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
id_file UUID UNIQUE NOT NULL,
fingerprint TEXT UNIQUE NOT NULL,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now(),
updated_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now(),
deleted_at TIMESTAMP WITHOUT TIME ZONE
);
-- Crea un indice su deleted_at per il supporto soft delete
CREATE INDEX IF NOT EXISTS idx_documents_deleted_at ON documents (deleted_at);