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.
29 lines
1.0 KiB
PHTML
29 lines
1.0 KiB
PHTML
7 years ago
|
<?php
|
||
|
|
||
7 years ago
|
namespace v320\AddDescriptionToCategoriesAndCustomFields;
|
||
7 years ago
|
|
||
|
|
||
7 years ago
|
class AddDescriptionToCustomFields extends \AbstractMigration {
|
||
7 years ago
|
|
||
|
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");
|
||
|
}
|
||
|
}
|
||
|
}
|