Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#2575 remove / improve indexes #20245

Merged
merged 1 commit into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions CRM/Core/DAO/EntityFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/EntityFile.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:76720cd19bd7b5bbbf1461184198acc5)
* (GenCodeChecksum:37cc0051ec4b2d54eeeefe4c4d004b6d)
*/

/**
Expand Down Expand Up @@ -231,25 +231,16 @@ public static function &export($prefix = FALSE) {
*/
public static function indices($localize = TRUE) {
$indices = [
'index_entity' => [
'name' => 'index_entity',
'UI_entity_id_entity_table_file_id' => [
'name' => 'UI_entity_id_entity_table_file_id',
'field' => [
0 => 'entity_table',
1 => 'entity_id',
],
'localizable' => FALSE,
'sig' => 'civicrm_entity_file::0::entity_table::entity_id',
],
'UI_entity_table_entity_id_file_id' => [
'name' => 'UI_entity_table_entity_id_file_id',
'field' => [
0 => 'entity_table',
1 => 'entity_id',
0 => 'entity_id',
1 => 'entity_table',
2 => 'file_id',
],
'localizable' => FALSE,
'unique' => TRUE,
'sig' => 'civicrm_entity_file::1::entity_table::entity_id::file_id',
'sig' => 'civicrm_entity_file::1::entity_id::entity_table::file_id',
],
];
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
Expand Down
14 changes: 2 additions & 12 deletions CRM/Financial/DAO/FinancialType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Financial/FinancialType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:4f25c751d874b9438009c8685f8d6843)
* (GenCodeChecksum:035576414ddb721b2607522dc5d874e4)
*/

/**
Expand Down Expand Up @@ -287,17 +287,7 @@ public static function &export($prefix = FALSE) {
* @return array
*/
public static function indices($localize = TRUE) {
$indices = [
'UI_id' => [
'name' => 'UI_id',
'field' => [
0 => 'id',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UM what?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - so that is the duplicate index - duplicates the primary key

],
'localizable' => FALSE,
'unique' => TRUE,
'sig' => 'civicrm_financial_type::1::id',
],
];
$indices = [];
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
}

Expand Down
17 changes: 4 additions & 13 deletions CRM/Price/DAO/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Price/LineItem.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:ce105cf63ee265d470ed263f959a7706)
* (GenCodeChecksum:1c10b6b406bb73014b2fbe6ceb95fda3)
*/

/**
Expand Down Expand Up @@ -511,27 +511,18 @@ public static function &export($prefix = FALSE) {
*/
public static function indices($localize = TRUE) {
$indices = [
'index_entity' => [
'name' => 'index_entity',
'field' => [
0 => 'entity_table',
1 => 'entity_id',
],
'localizable' => FALSE,
'sig' => 'civicrm_line_item::0::entity_table::entity_id',
],
'UI_line_item_value' => [
'name' => 'UI_line_item_value',
'field' => [
0 => 'entity_table',
1 => 'entity_id',
0 => 'entity_id',
1 => 'entity_table',
2 => 'contribution_id',
3 => 'price_field_value_id',
4 => 'price_field_id',
],
'localizable' => FALSE,
'unique' => TRUE,
'sig' => 'civicrm_line_item::1::entity_table::entity_id::contribution_id::price_field_value_id::price_field_id',
'sig' => 'civicrm_line_item::1::entity_id::entity_table::contribution_id::price_field_value_id::price_field_id',
],
];
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
Expand Down
10 changes: 2 additions & 8 deletions xml/schema/Core/EntityFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@
<typeColumn>entity_table</typeColumn>
<add>1.5</add>
</dynamicForeignKey>
<index>
<name>index_entity</name>
<fieldName>entity_table</fieldName>
<fieldName>entity_id</fieldName>
<add>1.5</add>
</index>
<field>
<name>file_id</name>
<title>File ID</title>
Expand All @@ -67,9 +61,9 @@
<add>1.5</add>
</foreignKey>
<index>
<name>UI_entity_table_entity_id_file_id</name>
<fieldName>entity_table</fieldName>
<name>UI_entity_id_entity_table_file_id</name>
<fieldName>entity_id</fieldName>
<fieldName>entity_table</fieldName>
<fieldName>file_id</fieldName>
<unique>true</unique>
<add>1.1</add>
Expand Down
6 changes: 0 additions & 6 deletions xml/schema/Financial/FinancialType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,4 @@
<label>Enabled?</label>
</html>
</field>
<index>
<name>UI_id</name>
<fieldName>id</fieldName>
<unique>true</unique>
<add>4.3</add>
</index>
</table>
10 changes: 2 additions & 8 deletions xml/schema/Price/LineItem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,10 @@
<add>3.2</add>

</field>
<index>
<name>index_entity</name>
<fieldName>entity_table</fieldName>
<fieldName>entity_id</fieldName>
<add>1.7</add>
</index>
<index>
<index>
<name>UI_line_item_value</name>
<fieldName>entity_table</fieldName>
<fieldName>entity_id</fieldName>
<fieldName>entity_table</fieldName>
<fieldName>contribution_id</fieldName>
<fieldName>price_field_value_id</fieldName>
<fieldName>price_field_id</fieldName>
Expand Down