<?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 Version20220127134944 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 checkin_types (id INT AUTO_INCREMENT NOT NULL, name_fr VARCHAR(255) NOT NULL, name_en VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE checkins_by_event (id INT AUTO_INCREMENT NOT NULL, event_id INT DEFAULT NULL, depends_on_checkin_id INT DEFAULT NULL, types_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, start_date DATETIME DEFAULT NULL, end_date DATETIME DEFAULT NULL, key_checkin VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_275BF5A583B538AF (key_checkin), INDEX IDX_275BF5A571F7E88B (event_id), INDEX IDX_275BF5A5BEDAABFC (depends_on_checkin_id), INDEX IDX_275BF5A58EB23357 (types_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE config (id INT AUTO_INCREMENT NOT NULL, url VARCHAR(255) DEFAULT NULL, event_url VARCHAR(255) DEFAULT NULL, user_event_url VARCHAR(255) DEFAULT NULL, auth_type VARCHAR(255) DEFAULT NULL, token LONGTEXT DEFAULT NULL, user_name VARCHAR(255) DEFAULT NULL, password VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE event (id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE import_mapping_event (id INT AUTO_INCREMENT NOT NULL, event_id VARCHAR(255) DEFAULT NULL, event_name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE import_mapping_user_event (id INT AUTO_INCREMENT NOT NULL, user_event_id VARCHAR(255) DEFAULT NULL, first_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) DEFAULT NULL, company VARCHAR(255) DEFAULT NULL, profile VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, phone VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE qr_type (id INT AUTO_INCREMENT NOT NULL, id_type_code INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE qr_type_lang (id INT AUTO_INCREMENT NOT NULL, id_qr_type INT DEFAULT NULL, name_fr VARCHAR(255) DEFAULT NULL, name_en VARCHAR(255) DEFAULT NULL, INDEX IDX_2A6468C758DDD174 (id_qr_type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_event (id INT AUTO_INCREMENT NOT NULL, event_id INT DEFAULT NULL, user_event_id INT DEFAULT NULL, first_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) DEFAULT NULL, company VARCHAR(255) DEFAULT NULL, profile VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, phone VARCHAR(255) DEFAULT NULL, INDEX IDX_D96CF1FF71F7E88B (event_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_event_checkins (id INT AUTO_INCREMENT NOT NULL, event_user_id INT DEFAULT NULL, checkin_by_event_id INT NOT NULL, id_qr_type INT DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, checkin_date DATETIME DEFAULT NULL, checkin_mode VARCHAR(255) DEFAULT NULL, comment VARCHAR(255) DEFAULT NULL, INDEX IDX_B18E394C22397A3A (event_user_id), INDEX IDX_B18E394CCAEB8958 (checkin_by_event_id), INDEX IDX_B18E394C58DDD174 (id_qr_type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_event_checkins_history (id INT AUTO_INCREMENT NOT NULL, user_event_checkin_id INT NOT NULL, id_qr_type INT DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, action_date DATETIME DEFAULT NULL, mode VARCHAR(255) DEFAULT NULL, INDEX IDX_1926F2198DA7E15B (user_event_checkin_id), INDEX IDX_1926F21958DDD174 (id_qr_type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE checkins_by_event ADD CONSTRAINT FK_275BF5A571F7E88B FOREIGN KEY (event_id) REFERENCES event (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE checkins_by_event ADD CONSTRAINT FK_275BF5A5BEDAABFC FOREIGN KEY (depends_on_checkin_id) REFERENCES checkins_by_event (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE checkins_by_event ADD CONSTRAINT FK_275BF5A58EB23357 FOREIGN KEY (types_id) REFERENCES checkin_types (id)');
$this->addSql('ALTER TABLE qr_type_lang ADD CONSTRAINT FK_2A6468C758DDD174 FOREIGN KEY (id_qr_type) REFERENCES qr_type (id)');
$this->addSql('ALTER TABLE user_event ADD CONSTRAINT FK_D96CF1FF71F7E88B FOREIGN KEY (event_id) REFERENCES event (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE user_event_checkins ADD CONSTRAINT FK_B18E394C22397A3A FOREIGN KEY (event_user_id) REFERENCES user_event (id)');
$this->addSql('ALTER TABLE user_event_checkins ADD CONSTRAINT FK_B18E394CCAEB8958 FOREIGN KEY (checkin_by_event_id) REFERENCES checkins_by_event (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_event_checkins ADD CONSTRAINT FK_B18E394C58DDD174 FOREIGN KEY (id_qr_type) REFERENCES qr_type (id)');
$this->addSql('ALTER TABLE user_event_checkins_history ADD CONSTRAINT FK_1926F2198DA7E15B FOREIGN KEY (user_event_checkin_id) REFERENCES user_event_checkins (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_event_checkins_history ADD CONSTRAINT FK_1926F21958DDD174 FOREIGN KEY (id_qr_type) REFERENCES qr_type (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE checkins_by_event DROP FOREIGN KEY FK_275BF5A58EB23357');
$this->addSql('ALTER TABLE checkins_by_event DROP FOREIGN KEY FK_275BF5A5BEDAABFC');
$this->addSql('ALTER TABLE user_event_checkins DROP FOREIGN KEY FK_B18E394CCAEB8958');
$this->addSql('ALTER TABLE checkins_by_event DROP FOREIGN KEY FK_275BF5A571F7E88B');
$this->addSql('ALTER TABLE user_event DROP FOREIGN KEY FK_D96CF1FF71F7E88B');
$this->addSql('ALTER TABLE qr_type_lang DROP FOREIGN KEY FK_2A6468C758DDD174');
$this->addSql('ALTER TABLE user_event_checkins DROP FOREIGN KEY FK_B18E394C58DDD174');
$this->addSql('ALTER TABLE user_event_checkins_history DROP FOREIGN KEY FK_1926F21958DDD174');
$this->addSql('ALTER TABLE user_event_checkins DROP FOREIGN KEY FK_B18E394C22397A3A');
$this->addSql('ALTER TABLE user_event_checkins_history DROP FOREIGN KEY FK_1926F2198DA7E15B');
$this->addSql('DROP TABLE checkin_types');
$this->addSql('DROP TABLE checkins_by_event');
$this->addSql('DROP TABLE config');
$this->addSql('DROP TABLE event');
$this->addSql('DROP TABLE import_mapping_event');
$this->addSql('DROP TABLE import_mapping_user_event');
$this->addSql('DROP TABLE qr_type');
$this->addSql('DROP TABLE qr_type_lang');
$this->addSql('DROP TABLE user_event');
$this->addSql('DROP TABLE user_event_checkins');
$this->addSql('DROP TABLE user_event_checkins_history');
}
}