class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base

Upgrade logic for 4.7

Constants

BATCH_SIZE

Methods

bool
verifyPreDBstate($errors)

Verify DB state.

setPreUpgradeMessage($preUpgradeMessage, string $rev, null $currentVer = NULL)

Compute any messages which should be displayed beforeupgrade.

setPostUpgradeMessage(string $postUpgradeMessage, string $rev)

Compute any messages which should be displayed after upgrade.

static bool
runSql( $ctx, string $rev)

(Queue Task Callback)

addTask(string $title, string $funcName)

Syntactic sugar for adding a task.

static bool
removePaymentProcessorType( $ctx, string $name)

Remove a payment processor if not in use

static bool
checkFKExists(string $table_name, string $constraint_name)

No description

static bool
addColumn(CRM_Queue_TaskContext $ctx, string $table, string $column, string $properties)

Add a column to a table if it doesn't already exist

static bool
dropColumn(CRM_Queue_TaskContext $ctx, string $table, string $column)

Drop a column from a table if it exist.

static bool
addIndex(CRM_Queue_TaskContext $ctx, string $table, string|array $column)

Add a index to a table column.

static bool
dropIndex(CRM_Queue_TaskContext $ctx, string $table, string $indexName)

Drop a index from a table if it exist.

upgrade_4_7_alpha1(string $rev)

Upgrade function.

upgrade_4_7_alpha4(string $rev)

Upgrade function.

upgrade_4_7_beta2(string $rev)

Upgrade function.

upgrade_4_7_beta6(string $rev)

Upgrade function.

upgrade_4_7_1(string $rev)

Upgrade function.

upgrade_4_7_2(string $rev)

Upgrade function.

upgrade_4_7_3(string $rev)

Upgrade function.

upgrade_4_7_4(string $rev)

Upgrade function.

upgrade_4_7_7(string $rev)

Upgrade function.

upgrade_4_7_8(string $rev)

Upgrade function.

upgrade_4_7_10(string $rev)

Upgrade function.

upgrade_4_7_11(string $rev)

Upgrade function.

upgrade_4_7_12(string $rev)

Upgrade function.

upgrade_4_7_13(string $rev)

Upgrade function.

upgrade_4_7_14(string $rev)

Upgrade function.

upgrade_4_7_15(string $rev)

Upgrade function.

upgrade_4_7_16(string $rev)

Upgrade function.

upgrade_4_7_18(string $rev)

Upgrade function.

upgrade_4_7_19(string $rev)

Upgrade function.

upgrade_4_7_20(string $rev)

Upgrade function.

static int
updateWysiwyg()

CRM-16354

static bool
migrateSettings( $ctx)

Migrate any last remaining options from civicrm_domain.config_backend to civicrm_setting.

static array
convertBackendToSettings(int $domainId, string $config_backend)

Take a config_backend blob and produce an equivalent list of settings.

static bool
addGettingStartedDashlet( $ctx)

Add Getting Started dashlet to dashboard

static bool
migrateOnBehalfOfInfo( $ctx)

Migrate on-behalf information to uf_join.module_data as on-behalf columns will be dropped on DB upgrade

static bool
migrateRemoteSubmissionsSetting( $ctx)

v4.7.11 adds a new setting "remote_profile_submissions". This is long-standing feature that existing sites may be using; however, it's a bit prone to abuse. For new sites, the default is to disable it (since that is more secure). For existing sites, the default is to enable it (since that is more compatible).

static bool
fixContactTypeInSmartGroups( $ctx)

CRM-11782 - Get rid of VALUE_SEPARATOR character in saved search form values

static bool
deleteVersionCheckCacheFile( $ctx)

CRM-17637 - Ths file location has been moved; delete the old one

static bool
disableFlexibleJobsExtension( $ctx)

CRM-17669 and CRM-17686, make scheduled jobs more flexible, disable the 4.6 extension if installed

static bool
addIndexFinancialTrxnTrxnID( $ctx)

CRM-17752 add index to civicrm_financial_trxn.trxn_id (deliberately non-unique).

static bool
addIndexContributionCreditNoteID( $ctx)

CRM-17882 Add index to civicrm_contribution.credit_note_id.

static bool
addCombinedIndexFinancialItemEntityIDEntityType()

CRM-17775 Add correct index for table civicrm_financial_item.

static 
addRefundAndChargeBackAccountsIfNotExist()

CRM-17951 Add accounts option values for refund and chargeback.

static bool
addIndexContributionSource( $ctx)

CRM-17999 Add index to civicrm_contribution.source.

static bool
addIndexContributionAmount( $ctx)

CRM-18124 Add index to civicrm_contribution.total_amount.

static bool
addDeletedByMergeActivityType( $ctx)

CRM-18124 Add index to civicrm_contribution.total_amount.

static bool
addHelpPreAndHelpPostFieldsPriceFieldValue( $ctx)

CRM-12252 Add Help Pre and Help Post Fields for Price Field Value Table.

static bool
dropActionScheudleMappingForeignKey( $ctx)

CRM-18464 Check if Foreign key exists and also drop any index of same name accidentially created.

static bool
upgradeMailingFKs( $ctx)

CRM-18345 Don't delete mailing data on email/phone deletion Implemented here in CRM-18526

static bool
dashboardSchemaUpdate( $ctx)

CRM-17663 - Dashboard schema changes

static bool
alterIndexAndTypeForImageURL()

CRM-19100 - Alter Index and Type for Image URL

static bool
addMailingTemplateType()

Add mailing template type.

static bool
addDataTypeColumnToOptionGroupTable()

CRM-18651 Add DataType column to Option Group Table

static bool
addWysiwygPresets()

CRM-19372 Add field to store accepted credit credit cards for a payment processor.

static 
updateKenyanProvinces( $ctx)

Update Kenyan Provinces to reflect changes per CRM-20062

static 
deprecateStateProvinces(int $countryID, array $provinces)

Deprecate provinces that no longer exist.

static 
populateSMSProviderDomainId()

CRM-19961 Poputate newly added domain id column and add foriegn key onto table.

static bool
addChangeCaseSubjectActivityType( $ctx)

CRM-16633 - Add activity type for Change Case Status

static 
fixSchemaOnCiviCRMActionSchedule()

CRM-19986 fix schema differnces in civicrm_action_schedule

Details

bool verifyPreDBstate($errors)

Verify DB state.

Parameters

$errors

Return Value

bool

at line 43
setPreUpgradeMessage($preUpgradeMessage, string $rev, null $currentVer = NULL)

Compute any messages which should be displayed beforeupgrade.

Note: This function is called iteratively for each upcoming revision to the database.

Parameters

$preUpgradeMessage
string $rev a version number, e.g. '4.8.alpha1', '4.8.beta3', '4.8.0'.
null $currentVer

at line 75
setPostUpgradeMessage(string $postUpgradeMessage, string $rev)

Compute any messages which should be displayed after upgrade.

Parameters

string $postUpgradeMessage alterable.
string $rev an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs.

static bool runSql( $ctx, string $rev)

(Queue Task Callback)

Parameters

$ctx
string $rev

Return Value

bool

protected addTask(string $title, string $funcName)

Syntactic sugar for adding a task.

Task is (a) in this class and (b) has a high priority.

After passing the $funcName, you can also pass parameters that will go to the function. Note that all params must be serializable.

Parameters

string $title
string $funcName

static bool removePaymentProcessorType( $ctx, string $name)

Remove a payment processor if not in use

Parameters

$ctx
string $name

Return Value

bool

Exceptions

CiviCRM_API3_Exception

static bool checkFKExists(string $table_name, string $constraint_name)

Parameters

string $table_name
string $constraint_name

Return Value

bool

static bool addColumn(CRM_Queue_TaskContext $ctx, string $table, string $column, string $properties)

Add a column to a table if it doesn't already exist

Parameters

CRM_Queue_TaskContext $ctx
string $table
string $column
string $properties

Return Value

bool

static bool dropColumn(CRM_Queue_TaskContext $ctx, string $table, string $column)

Drop a column from a table if it exist.

Parameters

CRM_Queue_TaskContext $ctx
string $table
string $column

Return Value

bool

static bool addIndex(CRM_Queue_TaskContext $ctx, string $table, string|array $column)

Add a index to a table column.

Parameters

CRM_Queue_TaskContext $ctx
string $table
string|array $column

Return Value

bool

static bool dropIndex(CRM_Queue_TaskContext $ctx, string $table, string $indexName)

Drop a index from a table if it exist.

Parameters

CRM_Queue_TaskContext $ctx
string $table
string $indexName

Return Value

bool

at line 132
upgrade_4_7_alpha1(string $rev)

Upgrade function.

Parameters

string $rev

at line 145
upgrade_4_7_alpha4(string $rev)

Upgrade function.

Parameters

string $rev

at line 156
upgrade_4_7_beta2(string $rev)

Upgrade function.

Parameters

string $rev

at line 166
upgrade_4_7_beta6(string $rev)

Upgrade function.

Parameters

string $rev

at line 177
upgrade_4_7_1(string $rev)

Upgrade function.

Parameters

string $rev

at line 187
upgrade_4_7_2(string $rev)

Upgrade function.

Parameters

string $rev

at line 199
upgrade_4_7_3(string $rev)

Upgrade function.

Parameters

string $rev

at line 209
upgrade_4_7_4(string $rev)

Upgrade function.

Parameters

string $rev

at line 219
upgrade_4_7_7(string $rev)

Upgrade function.

Parameters

string $rev

at line 232
upgrade_4_7_8(string $rev)

Upgrade function.

Parameters

string $rev

at line 242
upgrade_4_7_10(string $rev)

Upgrade function.

Parameters

string $rev

at line 253
upgrade_4_7_11(string $rev)

Upgrade function.

Parameters

string $rev

at line 264
upgrade_4_7_12(string $rev)

Upgrade function.

Parameters

string $rev

at line 273
upgrade_4_7_13(string $rev)

Upgrade function.

Parameters

string $rev

at line 284
upgrade_4_7_14(string $rev)

Upgrade function.

Parameters

string $rev

at line 294
upgrade_4_7_15(string $rev)

Upgrade function.

Parameters

string $rev

at line 305
upgrade_4_7_16(string $rev)

Upgrade function.

Parameters

string $rev

at line 323
upgrade_4_7_18(string $rev)

Upgrade function.

Parameters

string $rev

at line 333
upgrade_4_7_19(string $rev)

Upgrade function.

Parameters

string $rev

at line 356
upgrade_4_7_20(string $rev)

Upgrade function.

Parameters

string $rev

at line 386
static int updateWysiwyg()

CRM-16354

Return Value

int

at line 403
static bool migrateSettings( $ctx)

Migrate any last remaining options from civicrm_domain.config_backend to civicrm_setting.

Cleanup setting schema.

Parameters

$ctx

Return Value

bool

at line 473
static array convertBackendToSettings(int $domainId, string $config_backend)

Take a config_backend blob and produce an equivalent list of settings.

Parameters

int $domainId Domain ID.
string $config_backend Serialized blob.

Return Value

array

at line 503
static bool addGettingStartedDashlet( $ctx)

Add Getting Started dashlet to dashboard

Parameters

$ctx

Return Value

bool

at line 529
static bool migrateOnBehalfOfInfo( $ctx)

Migrate on-behalf information to uf_join.module_data as on-behalf columns will be dropped on DB upgrade

Parameters

$ctx

Return Value

bool TRUE for success

at line 599
static bool migrateRemoteSubmissionsSetting( $ctx)

v4.7.11 adds a new setting "remote_profile_submissions". This is long-standing feature that existing sites may be using; however, it's a bit prone to abuse. For new sites, the default is to disable it (since that is more secure). For existing sites, the default is to enable it (since that is more compatible).

Parameters

$ctx

Return Value

bool

at line 624
static bool fixContactTypeInSmartGroups( $ctx)

CRM-11782 - Get rid of VALUE_SEPARATOR character in saved search form values

Parameters

$ctx

Return Value

bool

at line 649
static bool deleteVersionCheckCacheFile( $ctx)

CRM-17637 - Ths file location has been moved; delete the old one

Parameters

$ctx

Return Value

bool

at line 665
static bool disableFlexibleJobsExtension( $ctx)

CRM-17669 and CRM-17686, make scheduled jobs more flexible, disable the 4.6 extension if installed

Parameters

$ctx

Return Value

bool

at line 683
static bool addIndexFinancialTrxnTrxnID( $ctx)

CRM-17752 add index to civicrm_financial_trxn.trxn_id (deliberately non-unique).

Parameters

$ctx

Return Value

bool

at line 696
static bool addIndexContributionCreditNoteID( $ctx)

CRM-17882 Add index to civicrm_contribution.credit_note_id.

Parameters

$ctx

Return Value

bool

at line 711
static bool addCombinedIndexFinancialItemEntityIDEntityType()

CRM-17775 Add correct index for table civicrm_financial_item.

Note that the entity ID should always precede the entity_table as it is more unique. This is better for performance and does not cause fallback to no index if table it omitted.

Return Value

bool

at line 726
static addRefundAndChargeBackAccountsIfNotExist()

CRM-17951 Add accounts option values for refund and chargeback.

Add Chargeback contribution status and Chargeback and Contra account relationships, checking first if one exists.

at line 759
static bool addIndexContributionSource( $ctx)

CRM-17999 Add index to civicrm_contribution.source.

Parameters

$ctx

Return Value

bool

at line 774
static bool addIndexContributionAmount( $ctx)

CRM-18124 Add index to civicrm_contribution.total_amount.

Note that I made this a combined index with receive_date because the issue included both criteria and they seemed likely to be used in conjunction to me in other cases.

Parameters

$ctx

Return Value

bool

at line 791
static bool addDeletedByMergeActivityType( $ctx)

CRM-18124 Add index to civicrm_contribution.total_amount.

Note that I made this a combined index with receive_date because the issue included both criteria and they seemed likely to be used in conjunction to me in other cases.

Parameters

$ctx

Return Value

bool

at line 810
static bool addHelpPreAndHelpPostFieldsPriceFieldValue( $ctx)

CRM-12252 Add Help Pre and Help Post Fields for Price Field Value Table.

Parameters

$ctx

Return Value

bool

at line 847
static bool dropActionScheudleMappingForeignKey( $ctx)

CRM-18464 Check if Foreign key exists and also drop any index of same name accidentially created.

Parameters

$ctx

Return Value

bool

at line 860
static bool upgradeMailingFKs( $ctx)

CRM-18345 Don't delete mailing data on email/phone deletion Implemented here in CRM-18526

Parameters

$ctx

Return Value

bool

at line 919
static bool dashboardSchemaUpdate( $ctx)

CRM-17663 - Dashboard schema changes

Parameters

$ctx

Return Value

bool

at line 956
static bool alterIndexAndTypeForImageURL()

CRM-19100 - Alter Index and Type for Image URL

Return Value

bool

at line 972
static bool addMailingTemplateType()

Add mailing template type.

Return Value

bool

at line 987
static bool addDataTypeColumnToOptionGroupTable()

CRM-18651 Add DataType column to Option Group Table

Return Value

bool

at line 1008
static bool addWysiwygPresets()

CRM-19372 Add field to store accepted credit credit cards for a payment processor.

Return Value

bool

at line 1044
static updateKenyanProvinces( $ctx)

Update Kenyan Provinces to reflect changes per CRM-20062

Parameters

$ctx

at line 1063
static deprecateStateProvinces(int $countryID, array $provinces)

Deprecate provinces that no longer exist.

Parameters

int $countryID
array $provinces

at line 1095
static populateSMSProviderDomainId()

CRM-19961 Poputate newly added domain id column and add foriegn key onto table.

at line 1119
static bool addChangeCaseSubjectActivityType( $ctx)

CRM-16633 - Add activity type for Change Case Status

Parameters

$ctx

Return Value

bool

at line 1134
static fixSchemaOnCiviCRMActionSchedule()

CRM-19986 fix schema differnces in civicrm_action_schedule