Refactored some more migrations
parent
62d9f31d14
commit
fed59f988f
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v250\AddUserAgentAndScreenResToTickets;
|
||||
|
||||
|
||||
class AddScreenResHeightToStageTickets extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` ADD COLUMN `screen_resolution_height` INT");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` DROP COLUMN `screen_resolution_height`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v250\AddUserAgentAndScreenResToTickets;
|
||||
|
||||
|
||||
class AddScreenResHeightToTickets extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `screen_resolution_height` INT");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP COLUMN `screen_resolution_height`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v250\AddUserAgentAndScreenResToTickets;
|
||||
|
||||
|
||||
class AddScreenResWidthToStageTickets extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` ADD COLUMN `screen_resolution_width` INT");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` DROP COLUMN `screen_resolution_width`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v250\AddUserAgentAndScreenResToTickets;
|
||||
|
||||
|
||||
class AddScreenResWidthToTickets extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `screen_resolution_width` INT");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP COLUMN `screen_resolution_width`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v250\AddUserAgentAndScreenResToTickets;
|
||||
|
||||
|
||||
class AddUserAgentToStageTickets extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` ADD COLUMN `user_agent` TEXT");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` DROP COLUMN `user_agent`");
|
||||
}
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace v250;
|
||||
namespace v250\AddUserAgentAndScreenResToTickets;
|
||||
|
||||
|
||||
class AddUserAgentAndScreenResToTickets extends \AbstractMigration {
|
||||
class AddUserAgentToTickets extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `user_agent` TEXT");
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v250\AddUserAgentAndScreenResToTickets;
|
||||
|
||||
|
||||
class InsertSetting extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('display_user_agent_information', '0')");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'display_user_agent_information'");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddApiTables;
|
||||
|
||||
|
||||
class InsertSetting extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('public_api', '0')");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'public_api'");
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace v260;
|
||||
|
||||
|
||||
class AddCalendarModule extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`start` DATETIME,
|
||||
`end` DATETIME,
|
||||
`all_day` ENUM('0','1') NOT NULL,
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`location` VARCHAR(255),
|
||||
`comments` MEDIUMTEXT,
|
||||
`category` INT NOT NULL) ENGINE = MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");
|
||||
$this->executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event_reminder` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`user_id` INT NOT NULL,
|
||||
`event_id` INT NOT NULL,
|
||||
`amount` INT NOT NULL,
|
||||
`unit` INT NOT NULL,
|
||||
`email_sent` ENUM('0', '1') NOT NULL DEFAULT '0') ENGINE = MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `due_date` DATETIME");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `overdue_email_sent` ENUM('0','1')");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `color` VARCHAR(7)");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `usage` INT NOT NULL DEFAULT 0");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` ADD COLUMN `notify_overdue_unassigned` ENUM('0', '1') NOT NULL DEFAULT '0' AFTER `notify_note_unassigned`");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` ADD COLUMN `default_calendar_view` INT NOT NULL DEFAULT '0' AFTER `notify_note_unassigned`");
|
||||
$this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('enable_calendar', '1')");
|
||||
$this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('first_day_of_week', '0')");
|
||||
$this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('default_calendar_view', 'month')");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event`");
|
||||
$this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event_reminder`");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP COLUMN `due_date`");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP COLUMN `overdue_email_sent`");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` DROP COLUMN `color`");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` DROP COLUMN `usage`");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `notify_overdue_unassigned`");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `default_calendar_view`");
|
||||
$this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'enable_calendar'");
|
||||
$this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'first_day_of_week'");
|
||||
$this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'default_calendar_view'");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class AddColorColumnToCategories extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `color` VARCHAR(7)");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` DROP COLUMN `color`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class AddDefaultCalendarViewToUsers extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` ADD COLUMN `default_calendar_view` INT NOT NULL DEFAULT '0' AFTER `notify_note_unassigned`");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `default_calendar_view`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class AddDueDateColumnToTickets extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `due_date` DATETIME");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP COLUMN `due_date`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class AddNotifyOverdueUnassignedColumnToUsers extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` ADD COLUMN `notify_overdue_unassigned` ENUM('0', '1') NOT NULL DEFAULT '0' AFTER `notify_note_unassigned`");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `notify_overdue_unassigned`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class AddOverdueEmailSentColumnToTickets extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `overdue_email_sent` ENUM('0','1')");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP COLUMN `overdue_email_sent`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class AddUsageColumnToCategories extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `usage` INT NOT NULL DEFAULT 0");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` DROP COLUMN `usage`");
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class CreateCalendarEventReminderTable extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event_reminder` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`user_id` INT NOT NULL,
|
||||
`event_id` INT NOT NULL,
|
||||
`amount` INT NOT NULL,
|
||||
`unit` INT NOT NULL,
|
||||
`email_sent` ENUM('0', '1') NOT NULL DEFAULT '0') ENGINE = MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event_reminder`");
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class CreateCalendarEventTable extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`start` DATETIME,
|
||||
`end` DATETIME,
|
||||
`all_day` ENUM('0','1') NOT NULL,
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`location` VARCHAR(255),
|
||||
`comments` MEDIUMTEXT,
|
||||
`category` INT NOT NULL) ENGINE = MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event`");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class InsertDefaultCalendarViewSetting extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('default_calendar_view', 'month')");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'default_calendar_view'");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class InsertEnableCalendarSetting extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('enable_calendar', '1')");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'enable_calendar'");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v260\AddCalendarModule;
|
||||
|
||||
|
||||
class InsertFirstDayOfWeekSetting extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('first_day_of_week', '0')");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` WHERE `Key` = 'first_day_of_week'");
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v262\AddMissingColumnsToStageTickets;
|
||||
|
||||
|
||||
class AddDueDateColumn extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` ADD COLUMN `due_date` DATETIME");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` DROP COLUMN `due_date`");
|
||||
}
|
||||
}
|
@ -1,17 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace v262;
|
||||
namespace v262\AddMissingColumnsToStageTickets;
|
||||
|
||||
|
||||
class AddMissingColumnsToStageTickets extends \AbstractMigration {
|
||||
class AddOverdueEmailSentColumn extends \AbstractMigration {
|
||||
|
||||
function up($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` ADD COLUMN `due_date` DATETIME");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` ADD COLUMN `overdue_email_sent` ENUM('0','1')");
|
||||
}
|
||||
|
||||
function down($hesk_settings) {
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` DROP COLUMN `due_date`");
|
||||
$this->executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` DROP COLUMN `overdue_email_sent`");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue