install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0323'); -- senator
+INSERT INTO config.upgrade_log (version) VALUES ('0324'); -- berick
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
END;
$func$ LANGUAGE PLPGSQL;
+CREATE OR REPLACE FUNCTION action.usr_visible_circ_copies( user_id INTEGER ) RETURNS SETOF INTEGER AS $$
+ DECLARE
+ copy INTEGER;
+ BEGIN
+ FOR copy IN SELECT DISTINCT(target_copy) FROM action.usr_visible_circs(user_id) LOOP
+ RETURN NEXT copy;
+ END LOOP;
+ END;
+$$ LANGUAGE plpgsql;
+
CREATE OR REPLACE FUNCTION action.usr_visible_holds (usr_id INT) RETURNS SETOF action.hold_request AS $func$
DECLARE
h action.hold_request%ROWTYPE;
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0324');
+
+-- returns the distinct set of target copy IDs from a user's visible circulation history
+CREATE OR REPLACE FUNCTION action.usr_visible_circ_copies( user_id INTEGER ) RETURNS SETOF INTEGER AS $$
+ DECLARE
+ copy INTEGER;
+ BEGIN
+ FOR copy IN SELECT DISTINCT(target_copy) FROM action.usr_visible_circs(user_id) LOOP
+ RETURN NEXT copy;
+ END LOOP;
+ END;
+$$ LANGUAGE plpgsql;
+
+COMMIT;