Update AddHistoricTicket Migration
This commit is contained in:
@@ -3,80 +3,77 @@ declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddHistoricTicket extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
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->addColumn("ticket_number", "integer", ["null" => true]);
|
||||
$historicTicket->addColumn("ticket_verifier", "string", ["null" => false, "default" => "0", "limit" => 255]);
|
||||
$historicTicket->addColumn("priority", "integer", ["null" => false, "default" => "1"]);
|
||||
$historicTicket->addColumn("status_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("status", "string", ["null" => true, "limit" => 255]);
|
||||
$historicTicket->addColumn("type_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("type", "string", ["null" => true, "limit" => 255]);
|
||||
$historicTicket->addColumn("user_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("agent_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("contact_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("company", "string", ["null" => false, "limit" => 255]);
|
||||
$historicTicket->addColumn("company_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("first_name", "string", ["null" => false, "limit" => 255]);
|
||||
$historicTicket->addColumn("middle_name", "string", ["null" => false, "limit" => 255]);
|
||||
$historicTicket->addColumn("last_name", "string", ["null" => false, "limit" => 255]);
|
||||
$historicTicket->addColumn("email", "string", ["null" => false, "limit" => 255]);
|
||||
$historicTicket->addColumn("phone", "string", ["null" => false, "limit" => 255]);
|
||||
$historicTicket->addColumn("subject", "string", ["null" => false, "limit" => 255]);
|
||||
$historicTicket->addColumn("ctime", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("mtime", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("muser_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("files_folder_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("unseen", "integer", ["null" => false, "default" => "1"]);
|
||||
$historicTicket->addColumn("group_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("order_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("last_response_time", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicket->addColumn("cc_addresses", "string", ["null" => false, "limit" => 255]);
|
||||
$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("ticket_id", "integer", ["null" => false]);
|
||||
$historicTicketMessage->addColumn("status_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicketMessage->addColumn("type_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicketMessage->addColumn("has_status", "integer", ["null" => false, "default" => "0", "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]);
|
||||
$historicTicketMessage->addColumn("has_type", "integer", ["null" => false, "default" => "0", "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]);
|
||||
$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->addColumn("attachments", "string", ["null" => false, "limit" => 255]);
|
||||
$historicTicketMessage->addColumn("is_note", "integer", ["null" => false, "default" => "0", "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]);
|
||||
$historicTicketMessage->addColumn("user_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicketMessage->addColumn("ctime", "integer", ["null" => false]);
|
||||
$historicTicketMessage->addColumn("mtime", "integer", ["null" => false]);
|
||||
$historicTicketMessage->addColumn("rate_id", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicketMessage->addColumn("rate_amount", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicketMessage->addColumn("rate_hours", "integer", ["null" => false, "default" => "0"]);
|
||||
$historicTicketMessage->addColumn("rate_name", "string", ["null" => false, "limit" => 255]);
|
||||
$historicTicketMessage->addColumn("rate_cost_code", "string", ["null" => true, "limit" => 255]);
|
||||
$historicTicketMessage->save();
|
||||
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
public function down(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$this->table("HistoricTicket")->drop()->save();
|
||||
$this->table("HistoricTicketMessage")->drop()->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user