From 7a7025362ff17e750f783435f33b46e086929614 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 28 May 2012 11:50:41 -0500 Subject: [PATCH] IDEMPIERE-274 Database seed missing Generate_UUID function --- db/ddlutils/postgresql/uuid-ossp.sql | 8 +++++++- migration/360lts-release/postgresql/840_IDEMPIERE-274.sql | 8 +++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/db/ddlutils/postgresql/uuid-ossp.sql b/db/ddlutils/postgresql/uuid-ossp.sql index d8f31a002d..7f7ca6b244 100644 --- a/db/ddlutils/postgresql/uuid-ossp.sql +++ b/db/ddlutils/postgresql/uuid-ossp.sql @@ -1,7 +1,13 @@ +/* iDempiere NOTE: +Use this script to enable uuid generation JUST on postgresql versions prior to 9.1 +For Postgresql 9.1, run the CREATE EXTENSION "uuid-ossp" sql command instead of using this script +*/ + + /* $PostgreSQL: pgsql/contrib/uuid-ossp/uuid-ossp.sql.in,v 1.6 2007/11/13 04:24:29 momjian Exp $ */ -- Adjust this setting to control where the objects get created. -SET search_path = public; +SET search_path = adempiere; CREATE OR REPLACE FUNCTION uuid_nil() RETURNS uuid diff --git a/migration/360lts-release/postgresql/840_IDEMPIERE-274.sql b/migration/360lts-release/postgresql/840_IDEMPIERE-274.sql index 5113228b20..b58144cff0 100644 --- a/migration/360lts-release/postgresql/840_IDEMPIERE-274.sql +++ b/migration/360lts-release/postgresql/840_IDEMPIERE-274.sql @@ -1,16 +1,18 @@ -- You must activate the uuid-ossp extension before running this script. --- For PostgreSQL 9.0 and earlier, run contrib/uuid-ossp.sql to activate the extension. --- For Postgresql 9.1, run the CREATE EXTENSION "uuid-ossp" sql command t activate the extension. +-- For PostgreSQL 9.0 and earlier, run db/ddlutils/postgresql/uuid-ossp.sql to activate the extension. +-- For Postgresql 9.1, run the CREATE EXTENSION "uuid-ossp" sql command to activate the extension. -- May 28, 2012 02:05:39 PM MYT -- IDEMPIERE-274 Database seed missing Generate_UUID function CREATE OR REPLACE FUNCTION generate_uuid() RETURNS char(36) AS $$ BEGIN - return public.uuid_generate_v4()::char(36); + return uuid_generate_v4()::char(36); END; $$ LANGUAGE plpgsql IMMUTABLE STRICT; +SET search_path = adempiere, pg_catalog, public; + UPDATE AD_System SET LastMigrationScriptApplied='840_IDEMPIERE-274.sql' WHERE LastMigrationScriptApplied<'840_IDEMPIERE-274.sql'