diff --git a/ritherdon-archive.asd b/ritherdon-archive.asd index 533170e..b525a1d 100644 --- a/ritherdon-archive.asd +++ b/ritherdon-archive.asd @@ -54,6 +54,7 @@ (:file "models/user") (:file "models/site-settings") (:file "models/pages") + (:file "models/files") (:file "auth") (:file "validation") (:file "nera") ; (Name of Database) diff --git a/src/models/files.lisp b/src/models/files.lisp new file mode 100644 index 0000000..9f79783 --- /dev/null +++ b/src/models/files.lisp @@ -0,0 +1,35 @@ +(in-package #:cl-user) +(defpackage #:files + (:use #:cl + #:ritherdon-archive.db + #:app-constants + #:mito) + (:export #:storage-file)) +(in-package #:files) + +(defclass storage-file () + ((name + :documentation "The filename of the file being stored in /storage/media." + :col-type (or :text :null) + :initarg :name + :initform :null + :accessor name-of) + + (slug + :documentation "The slugified version of the file's `NAME'. This is what is + used when constructing links and accessing the file from the browser." + :col-type (or :text :null) + :initarg :slug + :initform :null + :accessor slug-of) + + (file-type + :documentation "The MIME type of the file (E.G. 'image/png." + :col-type (or :text :null) + :initarg :file-type + :initform :null + :accessor file-type-of)) + + (:documentation "Model describing the 'storage_file' table in the database -- + used by Mito.") + (:metaclass mito:dao-table-class))