$$ LANGUAGE plpgsql;
\echo 'exception matrix table'
-CREATE TABLE sitka.age_circ_exception_matrix (
+CREATE TABLE IF NOT EXISTS sitka.age_circ_exception_matrix (
id SERIAL NOT NULL,
active BOOLEAN NOT NULL DEFAULT TRUE,
org_unit INT REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
\echo 'table for aged circs'
-CREATE TABLE sitka.aged_circs (
+CREATE TABLE IF NOT EXISTS sitka.aged_circs (
id BIGINT NOT NULL,
delete_date DATE NOT NULL
);
\echo 'table for aged circ count'
-CREATE TABLE sitka.aged_circs_by_user (
+CREATE TABLE IF NOT EXISTS sitka.aged_circs_by_user (
usr BIGINT NOT NULL,
month INT NOT NULL,
year INT NOT NULL,