intranet/migrations/Version20230614214032.php
Audrey Jensen 632199009d init
2023-06-28 15:38:14 +00:00

45 lines
3.0 KiB
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230614214032 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE ticket (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, created_by_id INTEGER DEFAULT NULL, assigned_to_id INTEGER DEFAULT NULL, master_ticket_id INTEGER DEFAULT NULL, summary VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, priority INTEGER DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, closed_at DATETIME DEFAULT NULL, viewed_at DATETIME DEFAULT NULL, reopened BOOLEAN DEFAULT NULL, category VARCHAR(255) DEFAULT NULL, status_updated_at DATETIME DEFAULT NULL, due_at DATETIME DEFAULT NULL, synced_at DATETIME DEFAULT NULL, first_response_secs INTEGER DEFAULT NULL, CONSTRAINT FK_97A0ADA3B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_97A0ADA3F4BD7827 FOREIGN KEY (assigned_to_id) REFERENCES user (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_97A0ADA339FE49F FOREIGN KEY (master_ticket_id) REFERENCES ticket (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('CREATE INDEX IDX_97A0ADA3B03A8386 ON ticket (created_by_id)');
$this->addSql('CREATE INDEX IDX_97A0ADA3F4BD7827 ON ticket (assigned_to_id)');
$this->addSql('CREATE INDEX IDX_97A0ADA339FE49F ON ticket (master_ticket_id)');
$this->addSql('CREATE TABLE user (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, firstname VARCHAR(64) DEFAULT NULL, last_name VARCHAR(64) DEFAULT NULL, email VARCHAR(80) NOT NULL, display_name VARCHAR(255) DEFAULT NULL, registered DATETIME DEFAULT NULL, title VARCHAR(255) DEFAULT NULL)');
$this->addSql('CREATE TABLE messenger_messages (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, body CLOB NOT NULL, headers CLOB NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
, available_at DATETIME NOT NULL --(DC2Type:datetime_immutable)
, delivered_at DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
)');
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
$this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)');
$this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE ticket');
$this->addSql('DROP TABLE user');
$this->addSql('DROP TABLE messenger_messages');
}
}