Documentation

block.crmUpgradeSnapshot.php

Table of Contents

Functions

smarty_block_crmUpgradeSnapshot()  : string|null
Generate a pre-upgrade data-snapshot -- if the local policy supports them.

Functions

smarty_block_crmUpgradeSnapshot()

Generate a pre-upgrade data-snapshot -- if the local policy supports them.

smarty_block_crmUpgradeSnapshot(array<string|int, mixed> $params, string|null $text, CRM_Core_Smarty &$smarty, bool &$repeat) : string|null

(Rule of thumb: Small databases enable snapshots. Large databases and multi-lingual databases do not. Some sysadmins may force-enable or force-disable snapshots.)

Example: Before modifying civicrm_foobar.some_field, make a snapshot of that column

{crmUpgradeSnapshot name=foobar} SELECT id, some_field FROM civicrm_foobar {/crmUpgradeSnapshot} UPDATE civicrm_foobar SET some_field = 999 WHERE some_field = 666;

TIP: If you are modifying a large table (like civicrm_contact or civicrm_mailing_event_queue), then you probably shouldn't use *.mysql.tpl because it doesn't paginate operations. Similarly, {crmUpgradeSnapshot} doesn't paginate. For pagination, use non-Smarty upgrade-tasks.

Parameters
$params : array<string|int, mixed>
$text : string|null

The SELECT query which supplies the interesting data to be stored in the snapshot.

$smarty : CRM_Core_Smarty
$repeat : bool

Repeat is true for the opening tag, false for the closing tag

Tags
see
CRM_Upgrade_Snapshot
throws
CRM_Core_Exception
Return values
string|null

        
On this page

Search results