diff --git a/db/ddlutils/postgresql/functions/trunc.sql b/db/ddlutils/postgresql/functions/trunc.sql index 8134292d54..891e8d0319 100644 --- a/db/ddlutils/postgresql/functions/trunc.sql +++ b/db/ddlutils/postgresql/functions/trunc.sql @@ -26,6 +26,13 @@ BEGIN END; $$ LANGUAGE plpgsql IMMUTABLE; +CREATE OR REPLACE FUNCTION trunc(datetime TIMESTAMP WITHOUT TIME ZONE) +RETURNS TIMESTAMP WITHOUT TIME ZONE AS $$ +BEGIN + RETURN CAST(datetime AS DATE); +END; +$$ LANGUAGE plpgsql IMMUTABLE; + CREATE OR REPLACE FUNCTION trunc(datetime TIMESTAMP WITH TIME ZONE, format varchar) RETURNS DATE AS $$ BEGIN diff --git a/migration/i4.1/oracle/201708251228_IDEMPIERE-3453.sql b/migration/i4.1/oracle/201708251228_IDEMPIERE-3453.sql new file mode 100644 index 0000000000..46c5943d88 --- /dev/null +++ b/migration/i4.1/oracle/201708251228_IDEMPIERE-3453.sql @@ -0,0 +1,31 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3453 +-- Aug 25, 2017 12:23:30 PM CEST +UPDATE AD_IndexColumn SET ColumnSQL='TRUNC(DateAcct)',Updated=TO_DATE('2017-08-25 12:23:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200741 +; + +-- Aug 25, 2017 12:23:35 PM CEST +DROP INDEX fact_acct_trunc_dateacct +; + +-- Aug 25, 2017 12:23:35 PM CEST +CREATE INDEX fact_acct_trunc_dateacct ON Fact_Acct (TRUNC(DateAcct)) +; + +-- Aug 25, 2017 12:27:32 PM CEST +UPDATE AD_IndexColumn SET ColumnSQL='upper(columnname)',Updated=TO_DATE('2017-08-25 12:27:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200079 +; + +-- Aug 25, 2017 12:27:46 PM CEST +DROP INDEX ad_element_uppercolumnname +; + +-- Aug 25, 2017 12:27:46 PM CEST +CREATE UNIQUE INDEX ad_element_uppercolumnname ON AD_Element (upper(columnname)) +; + +SELECT register_migration_script('201708251228_IDEMPIERE-3453.sql') FROM dual +; + diff --git a/migration/i4.1/postgresql/201708251228_IDEMPIERE-3453.sql b/migration/i4.1/postgresql/201708251228_IDEMPIERE-3453.sql new file mode 100644 index 0000000000..e1a07a7954 --- /dev/null +++ b/migration/i4.1/postgresql/201708251228_IDEMPIERE-3453.sql @@ -0,0 +1,36 @@ +-- IDEMPIERE-3453 + +CREATE OR REPLACE FUNCTION trunc(datetime TIMESTAMP WITHOUT TIME ZONE) +RETURNS TIMESTAMP WITHOUT TIME ZONE AS $$ +BEGIN + RETURN CAST(datetime AS DATE); +END; +$$ LANGUAGE plpgsql IMMUTABLE; + +-- Aug 25, 2017 12:23:30 PM CEST +UPDATE AD_IndexColumn SET ColumnSQL='TRUNC(DateAcct)',Updated=TO_TIMESTAMP('2017-08-25 12:23:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200741 +; + +-- Aug 25, 2017 12:23:35 PM CEST +DROP INDEX fact_acct_trunc_dateacct +; + +-- Aug 25, 2017 12:23:35 PM CEST +CREATE INDEX fact_acct_trunc_dateacct ON Fact_Acct (TRUNC(DateAcct)) +; + +-- Aug 25, 2017 12:27:32 PM CEST +UPDATE AD_IndexColumn SET ColumnSQL='upper(columnname)',Updated=TO_TIMESTAMP('2017-08-25 12:27:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200079 +; + +-- Aug 25, 2017 12:27:46 PM CEST +DROP INDEX ad_element_uppercolumnname +; + +-- Aug 25, 2017 12:27:46 PM CEST +CREATE UNIQUE INDEX ad_element_uppercolumnname ON AD_Element (upper(columnname)) +; + +SELECT register_migration_script('201708251228_IDEMPIERE-3453.sql') FROM dual +; +