I released verion .21, which should solve your first two problems. Haven't quite decided on the syntax for foreign keys, maybe :create-table can look like defclass too:<br><br>(:create-table 'my-table<br> ((slot-a :type integer :foreign-key (my-other-table id) :default 55)
<br> (slot-b :type (or null (string 24)))<br> (:primary-key slot-a)<br> (:foreign-key (slot-a slot-b) (yet-another-table a b)<br> (:unique-index slot-b)) ;; Not really part of CREATE TABLE, but hey, why not?<br><br>Then deftable doesn't have to do as much transforming on the definition and can remain simple.
<br><br>Also, I'm not sure how to handle the creation of a set of tables that contain foreign keys -- since they have to be created in the right order. Altering them is even more tricky. Maybe I'll default to deferrable foreign keys, and turn on deferring when messing with the table scheme.
<br><br>Let me know what you think.<br><br>Marijn<br><br>