<?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 Version20220727095335 extends AbstractMigration
{
public function getDescription(): string
{
return 'Initial migration';
}
public function isTransactional(): bool
{
return false;
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE alert (id INT AUTO_INCREMENT NOT NULL, employee_id INT DEFAULT NULL, ticket_id INT DEFAULT NULL, ticket_competence_id INT DEFAULT NULL, ticket_customer_id INT DEFAULT NULL, date_to_notification DATETIME NOT NULL, subject VARCHAR(255) NOT NULL, type INT NOT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_17FD46C1D1B862B8 (hash), INDEX IDX_17FD46C18C03F15C (employee_id), INDEX IDX_17FD46C1700047D2 (ticket_id), INDEX IDX_17FD46C154B2B137 (ticket_competence_id), INDEX IDX_17FD46C1FF05C58C (ticket_customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE article (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, type INT NOT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_23A0E66D1B862B8 (hash), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE assessor (competence_id INT NOT NULL, customer_id INT NOT NULL, employee_id INT NOT NULL, INDEX IDX_BD48CAB15761DAB (competence_id), INDEX IDX_BD48CAB9395C3F3 (customer_id), INDEX IDX_BD48CAB8C03F15C (employee_id), PRIMARY KEY(competence_id, customer_id, employee_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE city (id INT AUTO_INCREMENT NOT NULL, region_id INT NOT NULL, name VARCHAR(255) NOT NULL, hash VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2D5B0234D1B862B8 (hash), INDEX IDX_2D5B023498260155 (region_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE competence (id INT AUTO_INCREMENT NOT NULL, alias VARCHAR(20) NOT NULL, title VARCHAR(255) NOT NULL, hash VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_94D4687FE16C6B94 (alias), UNIQUE INDEX UNIQ_94D4687FD1B862B8 (hash), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE competence_subject (id INT AUTO_INCREMENT NOT NULL, competence_id INT NOT NULL, title VARCHAR(255) NOT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_EF868150D1B862B8 (hash), INDEX IDX_EF86815015761DAB (competence_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE cron_job (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(191) NOT NULL, command VARCHAR(1024) NOT NULL, schedule VARCHAR(191) NOT NULL, description VARCHAR(191) NOT NULL, enabled TINYINT(1) NOT NULL, UNIQUE INDEX un_name (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE cron_report (id INT AUTO_INCREMENT NOT NULL, job_id INT DEFAULT NULL, run_at DATETIME NOT NULL, run_time DOUBLE PRECISION NOT NULL, exit_code INT NOT NULL, output LONGTEXT NOT NULL, error LONGTEXT NOT NULL, INDEX IDX_B6C6A7F5BE04EA9 (job_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(50) NOT NULL, password VARCHAR(255) NOT NULL, name VARCHAR(255) DEFAULT NULL, surname VARCHAR(255) DEFAULT NULL, avatar VARCHAR(255) DEFAULT NULL, birthday DATE DEFAULT NULL, phone VARCHAR(255) DEFAULT NULL, address_type INT NOT NULL, bank_name VARCHAR(255) DEFAULT NULL, bank_account VARCHAR(255) DEFAULT NULL, is_freelance TINYINT(1) NOT NULL, base_general_amount INT NOT NULL, base_saving_amount INT NOT NULL, has_couple TINYINT(1) NOT NULL, couple_fullname VARCHAR(255) DEFAULT NULL, is_family_monoparental TINYINT(1) NOT NULL, is_family_large TINYINT(1) NOT NULL, family_large_type INT NOT NULL, family_large_number VARCHAR(255) DEFAULT NULL, is_investing_stocks TINYINT(1) NOT NULL, investing_stocks_amount INT NOT NULL, is_investing_abroad TINYINT(1) NOT NULL, investing_abroad_amount INT NOT NULL, is_investing_cripto TINYINT(1) NOT NULL, investing_cripto_amount INT NOT NULL, is_investing_pension TINYINT(1) NOT NULL, investing_pension_amount INT NOT NULL, subscription_service_alias VARCHAR(255) NOT NULL, subscription_date_finish DATE DEFAULT NULL, subscription_last_date_finish DATE DEFAULT NULL, subscription_recurrent_enabled TINYINT(1) NOT NULL, stripe_subscription_id VARCHAR(255) DEFAULT NULL, stripe_customer_id VARCHAR(255) DEFAULT NULL, migration_user_id VARCHAR(255) DEFAULT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, document_type INT NOT NULL, document_number VARCHAR(255) DEFAULT NULL, document_number_support VARCHAR(255) DEFAULT NULL, document_date_valid DATE DEFAULT NULL, address_region VARCHAR(255) DEFAULT NULL, address_city VARCHAR(255) DEFAULT NULL, address_street VARCHAR(255) DEFAULT NULL, address_postal VARCHAR(255) DEFAULT NULL, disability_degree INT NOT NULL, couple_document_type INT NOT NULL, couple_document_number VARCHAR(255) DEFAULT NULL, couple_document_number_support VARCHAR(255) DEFAULT NULL, couple_document_date_valid DATE DEFAULT NULL, couple_disability_degree INT NOT NULL, UNIQUE INDEX UNIQ_81398E09E7927C74 (email), UNIQUE INDEX UNIQ_81398E09D1B862B8 (hash), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer_ancestor (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, name VARCHAR(255) NOT NULL, birthday DATETIME DEFAULT NULL, hash VARCHAR(255) NOT NULL, document_type INT NOT NULL, document_number VARCHAR(255) DEFAULT NULL, document_number_support VARCHAR(255) DEFAULT NULL, document_date_valid DATE DEFAULT NULL, disability_degree INT NOT NULL, UNIQUE INDEX UNIQ_27812694D1B862B8 (hash), INDEX IDX_278126949395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer_child (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, name VARCHAR(255) NOT NULL, birthday DATETIME NOT NULL, is_kindergarten TINYINT(1) NOT NULL, kindergarten_amount INT NOT NULL, hash VARCHAR(255) NOT NULL, disability_degree INT NOT NULL, UNIQUE INDEX UNIQ_EC862112D1B862B8 (hash), INDEX IDX_EC8621129395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer_job (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, current_company VARCHAR(255) DEFAULT NULL, current_position VARCHAR(255) DEFAULT NULL, current_salary INT NOT NULL, hash VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_B42BBE0ED1B862B8 (hash), INDEX IDX_B42BBE0E9395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer_property (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, cadastral_is_protected TINYINT(1) NOT NULL, cadastral_reference VARCHAR(255) DEFAULT NULL, cadastral_value_amount INT NOT NULL, cadastral_is_revised TINYINT(1) NOT NULL, purchase_date DATETIME DEFAULT NULL, purchase_amount INT NOT NULL, rent_is_rented TINYINT(1) NOT NULL, rent_is_family TINYINT(1) NOT NULL, rent_amount INT NOT NULL, hash VARCHAR(255) NOT NULL, address_region VARCHAR(255) DEFAULT NULL, address_city VARCHAR(255) DEFAULT NULL, address_street VARCHAR(255) DEFAULT NULL, address_postal VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_A7375FF1D1B862B8 (hash), INDEX IDX_A7375FF19395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer_recovery (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, token VARCHAR(255) NOT NULL, expiration DATETIME NOT NULL, INDEX IDX_DF86D0E69395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer_rent (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, date_start DATETIME NOT NULL, date_finish DATETIME DEFAULT NULL, amount INT NOT NULL, hash VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_56E9E9BBD1B862B8 (hash), INDEX IDX_56E9E9BB9395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer_service_available (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, service_id INT NOT NULL, is_unlimited_tickets TINYINT(1) NOT NULL, num_available_tickets INT NOT NULL, date_finish DATE DEFAULT NULL, hash VARCHAR(255) NOT NULL, cdate DATETIME NOT NULL, UNIQUE INDEX UNIQ_E90F63D2D1B862B8 (hash), INDEX IDX_E90F63D29395C3F3 (customer_id), INDEX IDX_E90F63D2ED5CA9E6 (service_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer_subscription (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, service_id INT NOT NULL, date_start DATE NOT NULL, date_finish DATE NOT NULL, stripe_subscription_id VARCHAR(255) DEFAULT NULL, hash VARCHAR(255) NOT NULL, cdate DATETIME NOT NULL, UNIQUE INDEX UNIQ_AD1EA7CAD1B862B8 (hash), INDEX IDX_AD1EA7CA9395C3F3 (customer_id), INDEX IDX_AD1EA7CAED5CA9E6 (service_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE customer_vehicle (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, model VARCHAR(255) DEFAULT NULL, combustion_type INT NOT NULL, registration VARCHAR(255) DEFAULT NULL, registration_year VARCHAR(255) DEFAULT NULL, hash VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_75D4038D1B862B8 (hash), INDEX IDX_75D40389395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE email (id INT AUTO_INCREMENT NOT NULL, subject VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, date_to_send DATETIME DEFAULT NULL, date_last_sent DATETIME DEFAULT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_E7927C74D1B862B8 (hash), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE email_customer_assigned (email_id INT NOT NULL, customer_id INT NOT NULL, INDEX IDX_72549072A832C1C9 (email_id), INDEX IDX_725490729395C3F3 (customer_id), PRIMARY KEY(email_id, customer_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE employee (id INT AUTO_INCREMENT NOT NULL, role INT NOT NULL, email VARCHAR(50) NOT NULL, password VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, surname VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, avatar VARCHAR(255) DEFAULT NULL, num_max_customers INT NOT NULL, num_tickets_answered INT NOT NULL, sum_tickets_answered_hours INT NOT NULL, migration_staff_id VARCHAR(255) DEFAULT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_5D9F75A1E7927C74 (email), UNIQUE INDEX UNIQ_5D9F75A1D1B862B8 (hash), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE employee_competence (employee_id INT NOT NULL, competence_id INT NOT NULL, INDEX IDX_C03D8AB8C03F15C (employee_id), INDEX IDX_C03D8AB15761DAB (competence_id), PRIMARY KEY(employee_id, competence_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE employee_recovery (id INT AUTO_INCREMENT NOT NULL, employee_id INT NOT NULL, token VARCHAR(255) NOT NULL, expiration DATETIME NOT NULL, INDEX IDX_637CC20E8C03F15C (employee_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE orders (id INT AUTO_INCREMENT NOT NULL, invoice_id INT DEFAULT NULL, customer_id INT NOT NULL, service_id INT NOT NULL, title VARCHAR(255) NOT NULL, subtotal NUMERIC(10, 2) NOT NULL, tax NUMERIC(10, 2) NOT NULL, tax_amount NUMERIC(10, 2) NOT NULL, discount_amount NUMERIC(10, 2) NOT NULL, total NUMERIC(10, 2) NOT NULL, payment_method INT NOT NULL, stripe_session_id VARCHAR(255) DEFAULT NULL, stripe_invoice_id VARCHAR(255) DEFAULT NULL, stripe_subscription_id VARCHAR(255) DEFAULT NULL, stripe_expired_at DATETIME DEFAULT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_E52FFDEED1B862B8 (hash), UNIQUE INDEX UNIQ_E52FFDEE2989F1FD (invoice_id), INDEX IDX_E52FFDEE9395C3F3 (customer_id), INDEX IDX_E52FFDEEED5CA9E6 (service_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE orders_invoice (id INT AUTO_INCREMENT NOT NULL, order_id INT DEFAULT NULL, year INT NOT NULL, year_number INT NOT NULL, number VARCHAR(25) NOT NULL, customer_name VARCHAR(255) NOT NULL, customer_document VARCHAR(255) NOT NULL, customer_address VARCHAR(255) NOT NULL, order_title VARCHAR(255) NOT NULL, order_subtotal NUMERIC(10, 2) NOT NULL, order_tax NUMERIC(10, 2) NOT NULL, order_tax_amount NUMERIC(10, 2) NOT NULL, order_discount_amount NUMERIC(10, 2) NOT NULL, order_total NUMERIC(10, 2) NOT NULL, payment_method INT NOT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_6110653FD1B862B8 (hash), UNIQUE INDEX UNIQ_6110653F8D9F6D38 (order_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE region (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(5) NOT NULL, name VARCHAR(255) NOT NULL, hash VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_F62F176D1B862B8 (hash), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE service (id INT AUTO_INCREMENT NOT NULL, alias VARCHAR(50) DEFAULT NULL, title VARCHAR(255) NOT NULL, slug VARCHAR(255) DEFAULT NULL, stripe_price_id VARCHAR(255) DEFAULT NULL, fake_old NUMERIC(10, 2) NOT NULL, fake_discount NUMERIC(10, 2) NOT NULL, fake_new NUMERIC(10, 2) NOT NULL, is_unlimited_tickets TINYINT(1) NOT NULL, num_available_tickets INT NOT NULL, type INT NOT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_E19D9AD2D1B862B8 (hash), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE service_competence (service_id INT NOT NULL, competence_id INT NOT NULL, INDEX IDX_28551CBED5CA9E6 (service_id), INDEX IDX_28551CB15761DAB (competence_id), PRIMARY KEY(service_id, competence_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ticket (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, service_id INT NOT NULL, competence_id INT NOT NULL, competence_subject_id INT DEFAULT NULL, subject VARCHAR(255) NOT NULL, first_response_hours INT NOT NULL, migration_ticket_id VARCHAR(255) DEFAULT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_97A0ADA3D1B862B8 (hash), INDEX IDX_97A0ADA39395C3F3 (customer_id), INDEX IDX_97A0ADA3ED5CA9E6 (service_id), INDEX IDX_97A0ADA315761DAB (competence_id), INDEX IDX_97A0ADA32CBE6470 (competence_subject_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ticket_file (id INT AUTO_INCREMENT NOT NULL, ticket_id INT NOT NULL, customer_id INT NOT NULL, message_id INT DEFAULT NULL, created_by_customer_id INT DEFAULT NULL, created_by_employee_id INT DEFAULT NULL, file VARCHAR(255) NOT NULL, name VARCHAR(255) DEFAULT NULL, mime VARCHAR(255) DEFAULT NULL, size INT NOT NULL, is_edited TINYINT(1) NOT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_BE442328D1B862B8 (hash), INDEX IDX_BE442328700047D2 (ticket_id), INDEX IDX_BE4423289395C3F3 (customer_id), INDEX IDX_BE442328537A1329 (message_id), INDEX IDX_BE44232833AC7893 (created_by_customer_id), INDEX IDX_BE4423282C3A4A3C (created_by_employee_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ticket_message (id INT AUTO_INCREMENT NOT NULL, ticket_id INT NOT NULL, customer_id INT NOT NULL, created_by_customer_id INT DEFAULT NULL, created_by_employee_id INT DEFAULT NULL, content LONGTEXT NOT NULL, is_edited TINYINT(1) NOT NULL, migration_message_id VARCHAR(255) DEFAULT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_BA71692DD1B862B8 (hash), INDEX IDX_BA71692D700047D2 (ticket_id), INDEX IDX_BA71692D9395C3F3 (customer_id), INDEX IDX_BA71692D33AC7893 (created_by_customer_id), INDEX IDX_BA71692D2C3A4A3C (created_by_employee_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE alert ADD CONSTRAINT FK_17FD46C18C03F15C FOREIGN KEY (employee_id) REFERENCES employee (id)');
$this->addSql('ALTER TABLE alert ADD CONSTRAINT FK_17FD46C1700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
$this->addSql('ALTER TABLE alert ADD CONSTRAINT FK_17FD46C154B2B137 FOREIGN KEY (ticket_competence_id) REFERENCES competence (id)');
$this->addSql('ALTER TABLE alert ADD CONSTRAINT FK_17FD46C1FF05C58C FOREIGN KEY (ticket_customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE assessor ADD CONSTRAINT FK_BD48CAB15761DAB FOREIGN KEY (competence_id) REFERENCES competence (id)');
$this->addSql('ALTER TABLE assessor ADD CONSTRAINT FK_BD48CAB9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE assessor ADD CONSTRAINT FK_BD48CAB8C03F15C FOREIGN KEY (employee_id) REFERENCES employee (id)');
$this->addSql('ALTER TABLE city ADD CONSTRAINT FK_2D5B023498260155 FOREIGN KEY (region_id) REFERENCES region (id)');
$this->addSql('ALTER TABLE competence_subject ADD CONSTRAINT FK_EF86815015761DAB FOREIGN KEY (competence_id) REFERENCES competence (id)');
$this->addSql('ALTER TABLE cron_report ADD CONSTRAINT FK_B6C6A7F5BE04EA9 FOREIGN KEY (job_id) REFERENCES cron_job (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE customer_ancestor ADD CONSTRAINT FK_278126949395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE customer_child ADD CONSTRAINT FK_EC8621129395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE customer_job ADD CONSTRAINT FK_B42BBE0E9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE customer_property ADD CONSTRAINT FK_A7375FF19395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE customer_recovery ADD CONSTRAINT FK_DF86D0E69395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE customer_rent ADD CONSTRAINT FK_56E9E9BB9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE customer_service_available ADD CONSTRAINT FK_E90F63D29395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE customer_service_available ADD CONSTRAINT FK_E90F63D2ED5CA9E6 FOREIGN KEY (service_id) REFERENCES service (id)');
$this->addSql('ALTER TABLE customer_subscription ADD CONSTRAINT FK_AD1EA7CA9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE customer_subscription ADD CONSTRAINT FK_AD1EA7CAED5CA9E6 FOREIGN KEY (service_id) REFERENCES service (id)');
$this->addSql('ALTER TABLE customer_vehicle ADD CONSTRAINT FK_75D40389395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE email_customer_assigned ADD CONSTRAINT FK_72549072A832C1C9 FOREIGN KEY (email_id) REFERENCES email (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE email_customer_assigned ADD CONSTRAINT FK_725490729395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE employee_competence ADD CONSTRAINT FK_C03D8AB8C03F15C FOREIGN KEY (employee_id) REFERENCES employee (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE employee_competence ADD CONSTRAINT FK_C03D8AB15761DAB FOREIGN KEY (competence_id) REFERENCES competence (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE employee_recovery ADD CONSTRAINT FK_637CC20E8C03F15C FOREIGN KEY (employee_id) REFERENCES employee (id)');
$this->addSql('ALTER TABLE orders ADD CONSTRAINT FK_E52FFDEE2989F1FD FOREIGN KEY (invoice_id) REFERENCES orders_invoice (id)');
$this->addSql('ALTER TABLE orders ADD CONSTRAINT FK_E52FFDEE9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE orders ADD CONSTRAINT FK_E52FFDEEED5CA9E6 FOREIGN KEY (service_id) REFERENCES service (id)');
$this->addSql('ALTER TABLE orders_invoice ADD CONSTRAINT FK_6110653F8D9F6D38 FOREIGN KEY (order_id) REFERENCES orders (id)');
$this->addSql('ALTER TABLE service_competence ADD CONSTRAINT FK_28551CBED5CA9E6 FOREIGN KEY (service_id) REFERENCES service (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE service_competence ADD CONSTRAINT FK_28551CB15761DAB FOREIGN KEY (competence_id) REFERENCES competence (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA39395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA3ED5CA9E6 FOREIGN KEY (service_id) REFERENCES service (id)');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA315761DAB FOREIGN KEY (competence_id) REFERENCES competence (id)');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA32CBE6470 FOREIGN KEY (competence_subject_id) REFERENCES competence_subject (id)');
$this->addSql('ALTER TABLE ticket_file ADD CONSTRAINT FK_BE442328700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
$this->addSql('ALTER TABLE ticket_file ADD CONSTRAINT FK_BE4423289395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE ticket_file ADD CONSTRAINT FK_BE442328537A1329 FOREIGN KEY (message_id) REFERENCES ticket_message (id)');
$this->addSql('ALTER TABLE ticket_file ADD CONSTRAINT FK_BE44232833AC7893 FOREIGN KEY (created_by_customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE ticket_file ADD CONSTRAINT FK_BE4423282C3A4A3C FOREIGN KEY (created_by_employee_id) REFERENCES employee (id)');
$this->addSql('ALTER TABLE ticket_message ADD CONSTRAINT FK_BA71692D700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
$this->addSql('ALTER TABLE ticket_message ADD CONSTRAINT FK_BA71692D9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE ticket_message ADD CONSTRAINT FK_BA71692D33AC7893 FOREIGN KEY (created_by_customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE ticket_message ADD CONSTRAINT FK_BA71692D2C3A4A3C FOREIGN KEY (created_by_employee_id) REFERENCES employee (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE alert DROP FOREIGN KEY FK_17FD46C154B2B137');
$this->addSql('ALTER TABLE assessor DROP FOREIGN KEY FK_BD48CAB15761DAB');
$this->addSql('ALTER TABLE competence_subject DROP FOREIGN KEY FK_EF86815015761DAB');
$this->addSql('ALTER TABLE employee_competence DROP FOREIGN KEY FK_C03D8AB15761DAB');
$this->addSql('ALTER TABLE service_competence DROP FOREIGN KEY FK_28551CB15761DAB');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA315761DAB');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA32CBE6470');
$this->addSql('ALTER TABLE cron_report DROP FOREIGN KEY FK_B6C6A7F5BE04EA9');
$this->addSql('ALTER TABLE alert DROP FOREIGN KEY FK_17FD46C1FF05C58C');
$this->addSql('ALTER TABLE assessor DROP FOREIGN KEY FK_BD48CAB9395C3F3');
$this->addSql('ALTER TABLE customer_ancestor DROP FOREIGN KEY FK_278126949395C3F3');
$this->addSql('ALTER TABLE customer_child DROP FOREIGN KEY FK_EC8621129395C3F3');
$this->addSql('ALTER TABLE customer_job DROP FOREIGN KEY FK_B42BBE0E9395C3F3');
$this->addSql('ALTER TABLE customer_property DROP FOREIGN KEY FK_A7375FF19395C3F3');
$this->addSql('ALTER TABLE customer_recovery DROP FOREIGN KEY FK_DF86D0E69395C3F3');
$this->addSql('ALTER TABLE customer_rent DROP FOREIGN KEY FK_56E9E9BB9395C3F3');
$this->addSql('ALTER TABLE customer_service_available DROP FOREIGN KEY FK_E90F63D29395C3F3');
$this->addSql('ALTER TABLE customer_subscription DROP FOREIGN KEY FK_AD1EA7CA9395C3F3');
$this->addSql('ALTER TABLE customer_vehicle DROP FOREIGN KEY FK_75D40389395C3F3');
$this->addSql('ALTER TABLE email_customer_assigned DROP FOREIGN KEY FK_725490729395C3F3');
$this->addSql('ALTER TABLE orders DROP FOREIGN KEY FK_E52FFDEE9395C3F3');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA39395C3F3');
$this->addSql('ALTER TABLE ticket_file DROP FOREIGN KEY FK_BE4423289395C3F3');
$this->addSql('ALTER TABLE ticket_file DROP FOREIGN KEY FK_BE44232833AC7893');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692D9395C3F3');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692D33AC7893');
$this->addSql('ALTER TABLE email_customer_assigned DROP FOREIGN KEY FK_72549072A832C1C9');
$this->addSql('ALTER TABLE alert DROP FOREIGN KEY FK_17FD46C18C03F15C');
$this->addSql('ALTER TABLE assessor DROP FOREIGN KEY FK_BD48CAB8C03F15C');
$this->addSql('ALTER TABLE employee_competence DROP FOREIGN KEY FK_C03D8AB8C03F15C');
$this->addSql('ALTER TABLE employee_recovery DROP FOREIGN KEY FK_637CC20E8C03F15C');
$this->addSql('ALTER TABLE ticket_file DROP FOREIGN KEY FK_BE4423282C3A4A3C');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692D2C3A4A3C');
$this->addSql('ALTER TABLE orders_invoice DROP FOREIGN KEY FK_6110653F8D9F6D38');
$this->addSql('ALTER TABLE orders DROP FOREIGN KEY FK_E52FFDEE2989F1FD');
$this->addSql('ALTER TABLE city DROP FOREIGN KEY FK_2D5B023498260155');
$this->addSql('ALTER TABLE customer_service_available DROP FOREIGN KEY FK_E90F63D2ED5CA9E6');
$this->addSql('ALTER TABLE customer_subscription DROP FOREIGN KEY FK_AD1EA7CAED5CA9E6');
$this->addSql('ALTER TABLE orders DROP FOREIGN KEY FK_E52FFDEEED5CA9E6');
$this->addSql('ALTER TABLE service_competence DROP FOREIGN KEY FK_28551CBED5CA9E6');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA3ED5CA9E6');
$this->addSql('ALTER TABLE alert DROP FOREIGN KEY FK_17FD46C1700047D2');
$this->addSql('ALTER TABLE ticket_file DROP FOREIGN KEY FK_BE442328700047D2');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692D700047D2');
$this->addSql('ALTER TABLE ticket_file DROP FOREIGN KEY FK_BE442328537A1329');
$this->addSql('DROP TABLE alert');
$this->addSql('DROP TABLE article');
$this->addSql('DROP TABLE assessor');
$this->addSql('DROP TABLE city');
$this->addSql('DROP TABLE competence');
$this->addSql('DROP TABLE competence_subject');
$this->addSql('DROP TABLE cron_job');
$this->addSql('DROP TABLE cron_report');
$this->addSql('DROP TABLE customer');
$this->addSql('DROP TABLE customer_ancestor');
$this->addSql('DROP TABLE customer_child');
$this->addSql('DROP TABLE customer_job');
$this->addSql('DROP TABLE customer_property');
$this->addSql('DROP TABLE customer_recovery');
$this->addSql('DROP TABLE customer_rent');
$this->addSql('DROP TABLE customer_service_available');
$this->addSql('DROP TABLE customer_subscription');
$this->addSql('DROP TABLE customer_vehicle');
$this->addSql('DROP TABLE email');
$this->addSql('DROP TABLE email_customer_assigned');
$this->addSql('DROP TABLE employee');
$this->addSql('DROP TABLE employee_competence');
$this->addSql('DROP TABLE employee_recovery');
$this->addSql('DROP TABLE orders');
$this->addSql('DROP TABLE orders_invoice');
$this->addSql('DROP TABLE region');
$this->addSql('DROP TABLE service');
$this->addSql('DROP TABLE service_competence');
$this->addSql('DROP TABLE ticket');
$this->addSql('DROP TABLE ticket_file');
$this->addSql('DROP TABLE ticket_message');
}
}