Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/lobos/backends/postgresql.clj
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@
(defmethod compile [:postgresql ColumnDefinition]
[definition]
(let [{:keys [db-spec cname data-type default
auto-inc not-null others]} definition]
auto-inc not-null others alter]} definition]
(apply join \space
(as-identifier db-spec cname)
(when alter "TYPE")
(if auto-inc
(if (= :bigint (:dtype data-type))
"BIGSERIAL"
Expand Down
2 changes: 1 addition & 1 deletion src/lobos/compiler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
(defmethod compile [::standard AlterModifyDataTypeAndOptionsAction]
[action]
(let [{:keys [db-spec element]} action]
(str "ALTER COLUMN " (compile element))))
(str "ALTER COLUMN " (compile (assoc element :alter :alter)))))

(defmethod compile [::standard AlterModifyDefaultAction]
[action]
Expand Down