2012-05-28 13:15:36 +07:00
|
|
|
-- You must activate the uuid-ossp extension before running this script.
|
2012-05-28 23:50:41 +07:00
|
|
|
-- 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.
|
2012-05-28 13:15:36 +07:00
|
|
|
|
|
|
|
-- 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
|
2012-05-28 23:50:41 +07:00
|
|
|
return uuid_generate_v4()::char(36);
|
2012-05-28 13:15:36 +07:00
|
|
|
END;
|
|
|
|
$$ LANGUAGE plpgsql IMMUTABLE STRICT;
|
|
|
|
|
2012-05-28 23:50:41 +07:00
|
|
|
SET search_path = adempiere, pg_catalog, public;
|
|
|
|
|
2012-05-28 13:15:36 +07:00
|
|
|
UPDATE AD_System
|
|
|
|
SET LastMigrationScriptApplied='840_IDEMPIERE-274.sql'
|
|
|
|
WHERE LastMigrationScriptApplied<'840_IDEMPIERE-274.sql'
|
|
|
|
OR LastMigrationScriptApplied IS NULL
|
|
|
|
;
|