83 lines
4.7 KiB
PHP
83 lines
4.7 KiB
PHP
<?php /** @noinspection ALL */
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class AddHistoricTicket extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
//HistoricTicket Table
|
|
$historicTicket = $this->table("HistoricTicket", ["signed" => true]);
|
|
|
|
$historicTicket->addColumn("ticket_number", "", ["null" => true]);
|
|
$historicTicket->addColumn("ticket_verifier", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("priority", "", ["null" => false, "default" => "1"]);
|
|
$historicTicket->addColumn("status_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("status", "string", ["null" => true]);
|
|
$historicTicket->addColumn("type_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("type", "string", ["null" => true]);
|
|
$historicTicket->addColumn("user_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("agent_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("contact_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("company", "", ["null" => false]);
|
|
$historicTicket->addColumn("company_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("first_name", "", ["null" => false]);
|
|
$historicTicket->addColumn("middle_name", "", ["null" => false]);
|
|
$historicTicket->addColumn("last_name", "", ["null" => false]);
|
|
$historicTicket->addColumn("email", "", ["null" => false]);
|
|
$historicTicket->addColumn("phone", "", ["null" => false]);
|
|
$historicTicket->addColumn("subject", "", ["null" => false]);
|
|
$historicTicket->addColumn("ctime", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("mtime", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("muser_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("files_folder_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("unseen", "", ["null" => false, "default" => "1"]);
|
|
$historicTicket->addColumn("group_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("order_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("last_response_time", "", ["null" => false, "default" => "0"]);
|
|
$historicTicket->addColumn("cc_addresses", "string", ["null" => false]);
|
|
$historicTicket->save();
|
|
|
|
//HistoricTicketMessage Table
|
|
$historicTicketMessage = $this->table("HistoricTicketMessage", ["signed" => true]);
|
|
|
|
$historicTicketMessage->addColumn("ticket_id", "", ["null" => false]);
|
|
$historicTicketMessage->addColumn("status_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicketMessage->addColumn("type_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicketMessage->addColumn("has_status", "", ["null" => false, "default" => "0"]);
|
|
$historicTicketMessage->addColumn("has_type", "", ["null" => false, "default" => "0"]);
|
|
$historicTicketMessage->addColumn("content", "text", ["null" => true]);
|
|
$historicTicketMessage->addColumn("attachments", "", ["null" => false]);
|
|
$historicTicketMessage->addColumn("is_note", "", ["null" => false, "default" => "0"]);
|
|
$historicTicketMessage->addColumn("user_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicketMessage->addColumn("ctime", "", ["null" => false]);
|
|
$historicTicketMessage->addColumn("mtime", "", ["null" => false]);
|
|
$historicTicketMessage->addColumn("rate_id", "", ["null" => false, "default" => "0"]);
|
|
$historicTicketMessage->addColumn("rate_amount", "", ["null" => false, "default" => "0"]);
|
|
$historicTicketMessage->addColumn("rate_hours", "", ["null" => false, "default" => "0"]);
|
|
$historicTicketMessage->addColumn("rate_name", "", ["null" => false]);
|
|
$historicTicketMessage->addColumn("rate_cost_code", "", ["null" => true]);
|
|
$historicTicketMessage->save();
|
|
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
$this->table("HistoricTicket")->drop()->save();
|
|
$this->table("HistoricTicketMessage")->drop()->save();
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
|
|
}
|
|
}
|
|
}
|