From ed6a4133e082ca00d65acab7dfa83f9c3b8422f8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 17 Jun 2019 12:33:04 +0200 Subject: [PATCH] IDEMPIERE-2389 - foreign key --- .../oracle/201906171230_IDEMPIERE-2389.sql | 27 +++++++++++++++++++ .../201906171230_IDEMPIERE-2389.sql | 24 +++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 migration/i6.2/oracle/201906171230_IDEMPIERE-2389.sql create mode 100644 migration/i6.2/postgresql/201906171230_IDEMPIERE-2389.sql diff --git a/migration/i6.2/oracle/201906171230_IDEMPIERE-2389.sql b/migration/i6.2/oracle/201906171230_IDEMPIERE-2389.sql new file mode 100644 index 0000000000..e8c2f3c620 --- /dev/null +++ b/migration/i6.2/oracle/201906171230_IDEMPIERE-2389.sql @@ -0,0 +1,27 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2389 +-- Jun 17, 2019, 12:28:14 PM CEST +INSERT INTO AD_TableIndex (AD_Client_ID,AD_Org_ID,AD_TableIndex_ID,AD_TableIndex_UU,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Table_ID,IsCreateConstraint,IsUnique,Processing,TableIndexDrop,IsKey) VALUES (0,0,201072,'abd39a4e-0ebf-4708-bfe1-415abfc22bcd',TO_DATE('2019-06-17 12:28:14','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','ad_language_id_idx',TO_DATE('2019-06-17 12:28:14','YYYY-MM-DD HH24:MI:SS'),100,111,'Y','Y','N','N','N') +; + +-- Jun 17, 2019, 12:28:29 PM CEST +INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,AD_Column_ID,AD_TableIndex_ID,SeqNo) VALUES (0,0,201387,'0be76e53-2809-420c-bb7a-8c4b48edcc74',TO_DATE('2019-06-17 12:28:29','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',TO_DATE('2019-06-17 12:28:29','YYYY-MM-DD HH24:MI:SS'),100,9622,201072,10) +; + +-- Jun 17, 2019, 12:28:32 PM CEST +ALTER TABLE AD_Language ADD CONSTRAINT ad_language_id_idx UNIQUE (AD_Language_ID) +; + +-- Jun 17, 2019, 12:29:47 PM CEST +UPDATE AD_Column SET FKConstraintName='ADLanguage_ADPInstance', FKConstraintType='N',Updated=TO_DATE('2019-06-17 12:29:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211868 +; + +-- Jun 17, 2019, 12:30:06 PM CEST +ALTER TABLE AD_PInstance ADD CONSTRAINT ADLanguage_ADPInstance FOREIGN KEY (AD_Language_ID) REFERENCES AD_Language (AD_Language_ID) DEFERRABLE INITIALLY DEFERRED +; + +SELECT register_migration_script('201906171230_IDEMPIERE-2389.sql') FROM dual +; + diff --git a/migration/i6.2/postgresql/201906171230_IDEMPIERE-2389.sql b/migration/i6.2/postgresql/201906171230_IDEMPIERE-2389.sql new file mode 100644 index 0000000000..a2e0fbc93f --- /dev/null +++ b/migration/i6.2/postgresql/201906171230_IDEMPIERE-2389.sql @@ -0,0 +1,24 @@ +-- IDEMPIERE-2389 +-- Jun 17, 2019, 12:28:14 PM CEST +INSERT INTO AD_TableIndex (AD_Client_ID,AD_Org_ID,AD_TableIndex_ID,AD_TableIndex_UU,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Table_ID,IsCreateConstraint,IsUnique,Processing,TableIndexDrop,IsKey) VALUES (0,0,201072,'abd39a4e-0ebf-4708-bfe1-415abfc22bcd',TO_TIMESTAMP('2019-06-17 12:28:14','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','ad_language_id_idx',TO_TIMESTAMP('2019-06-17 12:28:14','YYYY-MM-DD HH24:MI:SS'),100,111,'Y','Y','N','N','N') +; + +-- Jun 17, 2019, 12:28:29 PM CEST +INSERT INTO AD_IndexColumn (AD_Client_ID,AD_Org_ID,AD_IndexColumn_ID,AD_IndexColumn_UU,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,AD_Column_ID,AD_TableIndex_ID,SeqNo) VALUES (0,0,201387,'0be76e53-2809-420c-bb7a-8c4b48edcc74',TO_TIMESTAMP('2019-06-17 12:28:29','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',TO_TIMESTAMP('2019-06-17 12:28:29','YYYY-MM-DD HH24:MI:SS'),100,9622,201072,10) +; + +-- Jun 17, 2019, 12:28:32 PM CEST +ALTER TABLE AD_Language ADD CONSTRAINT ad_language_id_idx UNIQUE (AD_Language_ID) +; + +-- Jun 17, 2019, 12:29:47 PM CEST +UPDATE AD_Column SET FKConstraintName='ADLanguage_ADPInstance', FKConstraintType='N',Updated=TO_TIMESTAMP('2019-06-17 12:29:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=211868 +; + +-- Jun 17, 2019, 12:30:06 PM CEST +ALTER TABLE AD_PInstance ADD CONSTRAINT ADLanguage_ADPInstance FOREIGN KEY (AD_Language_ID) REFERENCES AD_Language (AD_Language_ID) DEFERRABLE INITIALLY DEFERRED +; + +SELECT register_migration_script('201906171230_IDEMPIERE-2389.sql') FROM dual +; +