Skip to content

Instantly share code, notes, and snippets.

@wildermuthn
Created January 31, 2014 23:03
Show Gist options
  • Save wildermuthn/8745089 to your computer and use it in GitHub Desktop.
Save wildermuthn/8745089 to your computer and use it in GitHub Desktop.
(make-table user
((id serial)
(first-name string)
(last-name string)
(email string)
(phone string)
(image-id integer)
(creation-date integer (timestamp-to-unix (now))))
(projects tasks)
(id project-id))
(defclass user () ((id :col-type serial :accessor id)
(first-name :col-type string :initarg :first-name :accessor first-name)
(last-name :col-type string :initarg :last-name :accessor last-name)
(email :col-type string :initarg :email :accessor email)
(phone :col-type string :initarg :phone :accessor phone)
(image-id :col-type integer :initarg :image-id :accessor image-id)
(creation-date :col-type integer :initform (timestamp-to-unix (now))) (projects :initarg :projects :accessor projects :initform '())
(tasks :initarg :tasks :accessor tasks :initform '()) )
(:metaclass dao-class)
(:keys id))
defun create-user (&key first-name last-name email phone image-id)
(make-dao 'organization :first-name first-name :last-name last-name :email email :phone phone :image-id image-id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment