Support :autoincrement for Postgres on table creation by rebuilding what Postgres...
[clsql.git] / sql / oodml.lisp
index dc010fb886cb4507b01a5689bcf415bc9f86906d..b570cedcbb96d6aa8e6ac9b10012ae33e47d2f71 100644 (file)
                                  :database database)
 
                  (when (and pk-slot (not pk))
-                   (setf pk (if (member :auto-increment (listify (view-class-slot-db-constraints pk-slot)))
+                   (setf pk (if (or (member :auto-increment (listify (view-class-slot-db-constraints pk-slot)))
+                                    (not (null (view-class-slot-autoincrement-sequence pk-slot))))
                                 (setf (slot-value obj (slot-definition-name pk-slot))
                                       (database-last-auto-increment-id database
                                                                       table