class CRM_Upgrade_Incremental_php_FourSix extends CRM_Upgrade_Incremental_Base

Upgrade logic for 4.6

Constants

BATCH_SIZE

Methods

bool
verifyPreDBstate($errors)

Verify DB state.

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

Compute any messages which should be displayed before upgrade.

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_6_alpha3(string $rev)

CRM-16846 - This function incorrectly omits running the 4.6.alpha3 sql file.

static bool
updateReferenceDate( $ctx)

Add new column reference_date to civicrm_action_log in order to track.

upgrade_4_6_1(string $rev)

Upgrade function.

upgrade_4_6_6(string $rev)

Upgrade function.

static bool
fixCaseLog( $ctx)

Remove special characters from case_type_id column in log_civicrm_case.

static bool
task_4_6_x_runOnlySql( $ctx, string $rev)

Queue Task Callback for CRM-16846

Details

bool verifyPreDBstate($errors)

Verify DB state.

Parameters

$errors

Return Value

bool

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

Compute any messages which should be displayed before upgrade.

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 41
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 59
upgrade_4_6_alpha3(string $rev)

CRM-16846 - This function incorrectly omits running the 4.6.alpha3 sql file.

Instead of correcting it here (which would not run again for sites already on 4.6), the file is re-run conditionally during 4.6.6

Parameters

string $rev

See also

upgrade_4_6_6

at line 73
static bool updateReferenceDate( $ctx)

Add new column reference_date to civicrm_action_log in order to track.

CRM-15728, actual action_start_date for membership entity for only those schedule reminders which are not repeatable

Parameters

$ctx

Return Value

bool

at line 130
upgrade_4_6_1(string $rev)

Upgrade function.

Parameters

string $rev

at line 140
upgrade_4_6_6(string $rev)

Upgrade function.

Parameters

string $rev

at line 161
static bool fixCaseLog( $ctx)

Remove special characters from case_type_id column in log_civicrm_case.

CRM-16289 - If logging enabled and upgrading from 4.4 or earlier, log_civicrm_case.case_type_id will contain special characters. This will cause ALTER TABLE to fail when changing this column to an INT

Parameters

$ctx

Return Value

bool

at line 189
static bool task_4_6_x_runOnlySql( $ctx, string $rev)

Queue Task Callback for CRM-16846

Run a sql file without resetting locale to that version

Parameters

$ctx
string $rev

Return Value

bool