You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mods-for-HESK-Netsyms/install/migrations/v320/AddDescriptionToCategoriesA.../AddDescriptionToCustomField...

29 lines
1.0 KiB
PHP

<?php
namespace v320\AddDescriptionToCategoriesAndCustomFields;
class AddDescriptionToCustomFields extends \AbstractMigration {
function up($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_fields`
ADD COLUMN `mfh_description` TEXT");
// Purge the custom field caches as we're adding a new field
foreach ($hesk_settings['languages'] as $key => $value) {
$language_hash = sha1($key);
hesk_unlink(HESK_PATH . "cache/cf_{$language_hash}.cache.php");
}
}
function down($hesk_settings) {
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_fields`
DROP COLUMN `mfh_description`");
// Purge the custom field caches as we're adding a new field
foreach ($hesk_settings['languages'] as $key => $value) {
$language_hash = sha1($key);
hesk_unlink(HESK_PATH . "cache/cf_{$language_hash}.cache.php");
}
}
}