From 14085d6218b2936cd776a3f6c3e8e5f05fc51e54 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 4 Sep 2012 15:19:45 -0500 Subject: [PATCH] IDEMPIERE-420 Improve the way to register migration scripts applied --- .../functions/register_migration_script.sql | 47 ++++++++++++++++ .../functions/register_migration_script.sql | 53 ++++++++++++++++++ .../oracle/901_IDEMPIERE-420.sql | 50 +++++++++++++++++ .../postgresql/901_IDEMPIERE-420.sql | 56 +++++++++++++++++++ 4 files changed, 206 insertions(+) create mode 100644 db/ddlutils/oracle/functions/register_migration_script.sql create mode 100644 db/ddlutils/postgresql/functions/register_migration_script.sql create mode 100644 migration/360lts-release/oracle/901_IDEMPIERE-420.sql create mode 100644 migration/360lts-release/postgresql/901_IDEMPIERE-420.sql diff --git a/db/ddlutils/oracle/functions/register_migration_script.sql b/db/ddlutils/oracle/functions/register_migration_script.sql new file mode 100644 index 0000000000..027a10095a --- /dev/null +++ b/db/ddlutils/oracle/functions/register_migration_script.sql @@ -0,0 +1,47 @@ +CREATE OR REPLACE FUNCTION register_migration_script +( + p_script IN VARCHAR2 +) +RETURN VARCHAR2 +IS + PRAGMA AUTONOMOUS_TRANSACTION; + v_return VARCHAR2(255); + v_scriptid INTEGER; +BEGIN + v_return := p_script || ' successfully registered'; + UPDATE AD_System + SET LastMigrationScriptApplied=p_script + WHERE LastMigrationScriptApplied