diff --git a/migration/360lts-release/oracle/840_IDEMPIERE-274.sql b/migration/360lts-release/oracle/840_IDEMPIERE-274.sql new file mode 100644 index 0000000000..c776d28aea --- /dev/null +++ b/migration/360lts-release/oracle/840_IDEMPIERE-274.sql @@ -0,0 +1,16 @@ +-- May 28, 2012 02:05:39 PM MYT +-- IDEMPIERE-274 Database seed missing Generate_UUID function +create or replace function generate_uuid return varchar as +guid varchar(32); +uuid varchar(36); +begin + guid := lower(sys_guid()); + uuid := substr(guid, 1, 8) || '-' || substr(guid, 9, 4) || '-' || substr(guid, 13, 4) || '-' || substr(guid, 17, 4) || '-' || substr(guid, 21, 12); + return uuid; +end; + +UPDATE AD_System + SET LastMigrationScriptApplied='840_IDEMPIERE-274.sql' +WHERE LastMigrationScriptApplied<'840_IDEMPIERE-274.sql' + OR LastMigrationScriptApplied IS NULL +; diff --git a/migration/360lts-release/postgresql/840_IDEMPIERE-274.sql b/migration/360lts-release/postgresql/840_IDEMPIERE-274.sql new file mode 100644 index 0000000000..4dbc1b8ca5 --- /dev/null +++ b/migration/360lts-release/postgresql/840_IDEMPIERE-274.sql @@ -0,0 +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. + +-- 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 uuid_generate_v4()::char(36); +END; +$$ LANGUAGE plpgsql IMMUTABLE STRICT; + +UPDATE AD_System + SET LastMigrationScriptApplied='840_IDEMPIERE-274.sql' +WHERE LastMigrationScriptApplied<'840_IDEMPIERE-274.sql' + OR LastMigrationScriptApplied IS NULL +;