From: Aron Roberts Date: Thu, 3 Jan 2013 03:23:18 +0000 (-0800) Subject: CSPACE-5765: Finishing up leftover work on the ID Generators table creation SQL script. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=2f9e960963929bdd05bab81e20f471c13e9b9469;p=tmp%2Fjakarta-migration.git CSPACE-5765: Finishing up leftover work on the ID Generators table creation SQL script. --- diff --git a/services/common/src/main/resources/db/postgresql/create_id_generators_table.sql b/services/common/src/main/resources/db/postgresql/create_id_generators_table.sql index d087fd5fe..7b4598341 100644 --- a/services/common/src/main/resources/db/postgresql/create_id_generators_table.sql +++ b/services/common/src/main/resources/db/postgresql/create_id_generators_table.sql @@ -20,14 +20,18 @@ * * Creates the "id_generators" table, used by the ID Service, * and sets the access permissions of that table. - * - * $LastChangedRevision$ - * $LastChangedDate$ */ --- DROP TABLE IF EXISTS id_generators; +-- Temporarily suppress messages of NOTICE level and below +SET SESSION client_min_messages=WARNING; --- 'CREATE TABLE ... IF NOT EXISTS' requires PostgreSQL 9.1 or later +-- 'CREATE TABLE ... IF NOT EXISTS' requires PostgreSQL 9.1 or later. +-- +-- To adapt this script for use with PostgreSQL 9.0 or earlier (untested), +-- try substituting the following two lines for the line below: +-- DROP TABLE IF EXISTS id_generators; +-- CREATE TABLE id_generators ... +-- CREATE TABLE IF NOT EXISTS id_generators ( csid character varying(80) NOT NULL, @@ -39,7 +43,7 @@ CREATE TABLE IF NOT EXISTS id_generators modified timestamp without time zone NOT NULL DEFAULT now(), CONSTRAINT id_generators_pkey PRIMARY KEY (csid) ) WITH ( - OIDS=FALSE -- See http://www.postgresql.org/docs/8.4/static/sql-createtable.html + OIDS=FALSE -- See "Notes" on http://www.postgresql.org/docs/9.1/static/sql-createtable.html ); CREATE OR REPLACE FUNCTION update_modified_column() @@ -47,6 +51,7 @@ CREATE OR REPLACE FUNCTION update_modified_column() 'BEGIN NEW.modified = now(); RETURN NEW; END;' LANGUAGE 'plpgsql'; +DROP TRIGGER IF EXISTS update_customer_modtime ON id_generators; CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON id_generators FOR EACH ROW EXECUTE PROCEDURE update_modified_column();