Created
June 3, 2011 07:44
-
-
Save marijnh/1006016 to your computer and use it in GitHub Desktop.
deftable example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defclass test-data () | |
((id :col-type serial :initarg :id :accessor test-id) | |
(a :col-type (or (varchar 100) db-null) :initarg :a :accessor test-a) | |
(b :col-type boolean :col-default nil :initarg :b :accessor test-b)) | |
(:metaclass dao-class) | |
(:table-name dao-test) | |
(:keys id)) | |
(deftable test-data | |
(!dao-def) | |
(!foreign other-table (a))) | |
;; Now (create-table 'test-data) will run the SQL code to create the test_data table and give it a foreign key to the other_table table. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment