Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
b676923b
Commit
b676923b
authored
12 years ago
by
Pradeep Nayak
Browse files
Options
Downloads
Patches
Plain Diff
--fixed for CRM-12141
parent
095467d8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Upgrade/Incremental/php/FourThree.php
+29
-0
29 additions, 0 deletions
CRM/Upgrade/Incremental/php/FourThree.php
xml/schema/Financial/EntityFinancialTrxn.xml
+10
-0
10 additions, 0 deletions
xml/schema/Financial/EntityFinancialTrxn.xml
with
39 additions
and
0 deletions
CRM/Upgrade/Incremental/php/FourThree.php
+
29
−
0
View file @
b676923b
...
...
@@ -139,6 +139,9 @@ WHERE entity_value = '' OR entity_value IS NULL
function
upgrade_4_3_alpha1
(
$rev
)
{
self
::
task_4_3_alpha1_checkDBConstraints
();
// add indexes for civicrm_entity_financial_trxn
// CRM-12141
$this
->
addTask
(
ts
(
'Check/Add indexes for civicrm_entity_financial_trxn'
),
'task_4_3_x_checkIndexes'
,
$rev
);
// task to process sql
$this
->
addTask
(
ts
(
'Upgrade DB to 4.3.alpha1: SQL'
),
'task_4_3_x_runSql'
,
$rev
);
...
...
@@ -206,6 +209,9 @@ WHERE entity_value = '' OR entity_value IS NULL
function
upgrade_4_3_beta4
(
$rev
)
{
$this
->
addTask
(
ts
(
'Upgrade DB to 4.3.beta4: SQL'
),
'task_4_3_x_runSql'
,
$rev
);
// add indexes for civicrm_entity_financial_trxn
// CRM-12141
$this
->
addTask
(
ts
(
'Check/Add indexes for civicrm_entity_financial_trxn'
),
'task_4_3_x_checkIndexes'
,
$rev
);
}
//CRM-11636
...
...
@@ -348,6 +354,9 @@ FROM civicrm_entity_financial_account ceft
INNER JOIN civicrm_option_group cog ON cog.id = cov.option_group_id
WHERE cog.name = 'payment_instrument'"
;
CRM_Core_DAO
::
executeQuery
(
$sql
);
//CRM-12141
$sql
=
"ALTER TABLE
{
$tempTableName1
}
ADD INDEX index_instrument_id (instrument_id);"
;
CRM_Core_DAO
::
executeQuery
(
$sql
);
//create temp table to process completed / cancelled contribution
$tempTableName2
=
CRM_Core_DAO
::
createTempTableName
();
...
...
@@ -379,6 +388,9 @@ FROM civicrm_contribution con
ON con.payment_instrument_id = tpi.instrument_id
WHERE con.contribution_status_id IN (
{
$completedStatus
}
,
{
$cancelledStatus
}
)"
;
CRM_Core_DAO
::
executeQuery
(
$sql
);
// CRM-12141
$sql
=
"ALTER TABLE
{
$tempTableName2
}
ADD INDEX index_action (action);"
;
CRM_Core_DAO
::
executeQuery
(
$sql
);
//handling for completed contribution and cancelled contribution
//insertion of new records
...
...
@@ -771,6 +783,23 @@ AND TABLE_SCHEMA = '{$dbUf['database']}'";
return
TRUE
;
}
/**
* Check/Add INDEX CRM-12141
*
* @return bool TRUE for success
*/
function
task_4_3_x_checkIndexes
(
CRM_Queue_TaskContext
$ctx
)
{
$query
=
"SHOW KEYS FROM `civicrm_entity_financial_trxn`
WHERE key_name IN ('UI_entity_financial_trxn_entity_table', 'UI_entity_financial_trxn_entity_id');"
;
$dao
=
CRM_Core_DAO
::
executeQuery
(
$query
);
if
(
!
$dao
->
N
)
{
CRM_Core_DAO
::
executeQuery
(
"ALTER TABLE civicrm_entity_financial_trxn
ADD INDEX UI_entity_financial_trxn_entity_table (entity_table),
ADD INDEX UI_entity_financial_trxn_entity_id (entity_id);"
);
}
return
TRUE
;
}
/**
* Update phones CRM-11292
*
...
...
This diff is collapsed.
Click to expand it.
xml/schema/Financial/EntityFinancialTrxn.xml
+
10
−
0
View file @
b676923b
...
...
@@ -62,5 +62,15 @@
<add>
3.2
</add>
<drop>
4.3
</drop>
</field>
<index>
<name>
UI_entity_financial_trxn_entity_table
</name>
<fieldName>
entity_table
</fieldName>
<add>
4.3
</add>
</index>
<index>
<name>
UI_entity_financial_trxn_entity_id
</name>
<fieldName>
entity_id
</fieldName>
<add>
4.3
</add>
</index>
</table>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment