diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-26 14:51:23 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-26 14:51:23 +0100 |
| commit | 620f081325c4e181a011781b5e72d251079b4271 (patch) | |
| tree | ce8ad2c6c0c0e2bca9585454eb61a68b2b05fbb0 /admin/upgrades | |
| parent | 3ce59b8686582a514406b1a57574e846ce83a7c1 (diff) | |
| download | contact-620f081325c4e181a011781b5e72d251079b4271.tar.gz contact-620f081325c4e181a011781b5e72d251079b4271.tar.bz2 contact-620f081325c4e181a011781b5e72d251079b4271.zip | |
Migrate contact xref to liberty_xref tables; add address_postcode to schema
5.0.1 upgrade migrates contact_xref_type/source/xref data into
liberty_xref_group/item/xref with content_type_guid='contact'.
5.0.2 upgrade drops the old contact_xref* tables.
schema_inc.php updated for fresh installs:
- Removes contact_xref, contact_xref_source, contact_xref_type tables
- Adds address_postcode table (UK postcode lookup, LEFT JOIN'd in queries)
- Defaults now INSERT into liberty_xref_group and liberty_xref_item directly
- dependencies => 'liberty' ensures correct install ordering
PHP and templates: source→item, xref_type→group rename throughout.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'admin/upgrades')
| -rw-r--r-- | admin/upgrades/5.0.1.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/admin/upgrades/5.0.1.php b/admin/upgrades/5.0.1.php index 538e498..b40ddc9 100644 --- a/admin/upgrades/5.0.1.php +++ b/admin/upgrades/5.0.1.php @@ -15,15 +15,15 @@ $gBitInstaller->registerPackageUpgrade( [ 'QUERY' => [ 'SQL92' => [ // contact_xref_type: integer xref_type becomes sort_order; text source becomes the xref_type key - "INSERT INTO `" . BIT_DB_PREFIX . "liberty_xref_type` - (`xref_type`, `content_type_guid`, `title`, `sort_order`, `role_id`, `type_href`) + "INSERT INTO `" . BIT_DB_PREFIX . "liberty_xref_group` + (`x_group`, `content_type_guid`, `title`, `sort_order`, `role_id`, `type_href`) SELECT `source`, 'contact', `title`, `xref_type`, `role_id`, `type_href` FROM `" . BIT_DB_PREFIX . "contact_xref_type`", // contact_xref_source: integer xref_type joined to get the text key - "INSERT INTO `" . BIT_DB_PREFIX . "liberty_xref_source` - (`source`, `content_type_guid`, `xref_type`, `cross_ref_title`, `multi`, `role_id`, `cross_ref_href`, `template`, `data`) + "INSERT INTO `" . BIT_DB_PREFIX . "liberty_xref_item` + (`item`, `content_type_guid`, `x_group`, `cross_ref_title`, `multiple`, `role_id`, `cross_ref_href`, `template`, `data`) SELECT cs.`source`, 'contact', ct.`source`, cs.`cross_ref_title`, cs.`multi`, cs.`role_id`, cs.`cross_ref_href`, cs.`template`, cs.`data` FROM `" . BIT_DB_PREFIX . "contact_xref_source` cs @@ -31,7 +31,7 @@ $gBitInstaller->registerPackageUpgrade( // contact_xref: direct column mapping, xref_id preserved "INSERT INTO `" . BIT_DB_PREFIX . "liberty_xref` - (`xref_id`, `content_id`, `source`, `xorder`, `xref`, `xkey`, `xkey_ext`, `data`, `start_date`, `last_update_date`, `entry_date`, `end_date`) + (`xref_id`, `content_id`, `item`, `xorder`, `xref`, `xkey`, `xkey_ext`, `data`, `start_date`, `last_update_date`, `entry_date`, `end_date`) SELECT `xref_id`, `content_id`, `source`, `xorder`, `xref`, `xkey`, `xkey_ext`, `data`, `start_date`, `last_update_date`, `entry_date`, `end_date` FROM `" . BIT_DB_PREFIX . "contact_xref`", |
