mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Attempt to fix MS SQL drop view for Mat Views facility.
It seems that the current open-coding of the materialized views data structure is still causing some confusion, so use the same code as in the MySQL support in the MS SQL parts of the code when trying to fix #950. See #950.
This commit is contained in:
parent
70b6845852
commit
6dbe62af1c
@ -242,14 +242,10 @@
|
||||
(let ((views (remove-if #'null views-alist :key #'cdr)))
|
||||
(when views
|
||||
(let ((sql
|
||||
(with-output-to-string (sql)
|
||||
(format sql "DROP VIEW ")
|
||||
(loop :for view-definition :in views
|
||||
:for i :from 0
|
||||
:do (destructuring-bind (name . def) view-definition
|
||||
(declare (ignore def))
|
||||
(format sql
|
||||
"~@[, ~]~@[~s.~]~s"
|
||||
(not (zerop i)) (car name) (cdr name)))))))
|
||||
(log-message :info "PostgreSQL Source: ~a" sql)
|
||||
(format nil "DROP VIEW ~{~a~^, ~};"
|
||||
(mapcar (lambda (qname)
|
||||
(format nil "~@[~s.~]~a"
|
||||
(car qname) (cdr qname)))
|
||||
(mapcar #'car views)))))
|
||||
(log-message :info "MSSQL: ~a" sql)
|
||||
(mssql-query sql))))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user