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

View File

@@ -0,0 +1,24 @@
package models
import (
"github.com/google/uuid"
"gorm.io/gorm"
"time"
)
// Document represents the structure of the documents table in the database.
type Document struct {
ID uint `gorm:"primaryKey"` // Primary key for the document
Name string `gorm:"column:name"` // Name of the document
IdFile uuid.UUID `gorm:"type:uuid;column:id_file;unique"` // Unique identifier for the document's file
Fingerprint string `gorm:"column:fingerprint;unique"` // Unique fingerprint (hash) for the document
CreatedAt time.Time `gorm:"column:created_at"` // Timestamp of when the document was created
UpdatedAt time.Time `gorm:"column:updated_at"` // Timestamp of when the document was last updated
DeletedAt gorm.DeletedAt `gorm:"index;column:deleted_at"` // Timestamp for soft deletion (if applicable)
}
// TableName overrides the default table name used by GORM.
func (Document) TableName() string {
// Returns the name of the table where documents are stored
return "documents"
}