 
 
 
-(defn make-log-table-trigger-function []
+(defn make-log-table-insert-trigger-function []
     (let [coils-trigger-fn-exists-result      (korma.core/exec-raw
                                                   ["select exists(select * from pg_proc where proname = 'trigger_function_afterinsert');" []]
                                                   :results)






(defn do-real [& {:keys [:table-name]}]
  (println "table name: " table-name)
  (make-admin-table )
  (make-log-table   )
  ( make-log-table-trigger-function)
  (create-realtime-trigger  :table-name  table-name)
)


        (if (not coils-trigger-exists )
        (do
            (korma.core/exec-raw   [sql-to-insert-trigger-row [table-name  coils-tables-trigger-version]]   [])
            (korma.core/exec-raw   [sql-to-drop-trigger []]   [])
            (korma.core/exec-raw   [sql-to-create-insert-trigger []]   [])
            (korma.core/exec-raw   [sql-to-create-update-trigger []]   [])

                      )
                      nil
