storage: minor code simplification; re-add schema setting to postgres test config
This commit is contained in:
parent
c0c6b10e94
commit
94c515a191
2 changed files with 10 additions and 12 deletions
|
@ -80,17 +80,14 @@
|
||||||
tr))
|
tr))
|
||||||
|
|
||||||
(defun create-table (cont)
|
(defun create-table (cont)
|
||||||
(let*
|
(let* ((st (storage cont))
|
||||||
((st (storage cont))
|
|
||||||
(tn (table-name cont))
|
(tn (table-name cont))
|
||||||
(table (storage:qualified-table-name st tn))
|
(table (storage:qualified-table-name st tn))
|
||||||
(head-fields (item-head-fields cont))
|
|
||||||
(params (storage:params st))
|
(params (storage:params st))
|
||||||
(id-type (getf params :id-type))
|
(id-type (getf params :id-type))
|
||||||
(json-type (getf params :json-type))
|
(json-type (getf params :json-type))
|
||||||
(hf-def (mapcar #'(lambda (x)
|
(hf-def (mapcar #'(lambda (x) (list x :type 'text :not-null t :default '|''|))
|
||||||
(list x :type 'text :not-null t :default '|''|))
|
(item-head-fields cont))))
|
||||||
head-fields)))
|
|
||||||
(storage:do-sql st
|
(storage:do-sql st
|
||||||
(sxql:make-statement :create-table table
|
(sxql:make-statement :create-table table
|
||||||
(nconc
|
(nconc
|
||||||
|
|
|
@ -19,4 +19,5 @@
|
||||||
|
|
||||||
(config:add :storage :class 'storage:config :setup #'storage:setup
|
(config:add :storage :class 'storage:config :setup #'storage:setup
|
||||||
:db-type :postgres
|
:db-type :postgres
|
||||||
:connect-args postgres-connect-args)
|
:connect-args postgres-connect-args
|
||||||
|
:options '(:schema "testing"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue