<?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 Version20220831090648 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 establishment_status (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE establishments (id INT AUTO_INCREMENT NOT NULL, status_id INT DEFAULT NULL, id_punch INT DEFAULT NULL, name VARCHAR(255) NOT NULL, symbol VARCHAR(255) DEFAULT NULL, street VARCHAR(255) DEFAULT NULL, zip VARCHAR(255) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, tax DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, number_phone VARCHAR(255) DEFAULT NULL, email_info VARCHAR(255) DEFAULT NULL, email_invoice VARCHAR(255) DEFAULT NULL, deleted TINYINT(1) NOT NULL, validated TINYINT(1) NOT NULL, enable_app_mobile TINYINT(1) NOT NULL, INDEX IDX_5C67EFC56BF700BD (status_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE number_of_card_customer (id INT AUTO_INCREMENT NOT NULL, establishment_id INT DEFAULT NULL, customer_id INT DEFAULT NULL, number VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_92C249008565851 (establishment_id), INDEX IDX_92C249009395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE type_establishment (id INT AUTO_INCREMENT NOT NULL, establishment_id INT DEFAULT NULL, type_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, INDEX IDX_AB0206DB8565851 (establishment_id), INDEX IDX_AB0206DBC54C8C93 (type_id), INDEX IDX_AB0206DBB03A8386 (created_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE types (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE users (id INT AUTO_INCREMENT NOT NULL, id_punch INT DEFAULT NULL, firstname VARCHAR(255) DEFAULT NULL, lastname VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, deleted TINYINT(1) NOT NULL, token VARCHAR(255) DEFAULT NULL, validated TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL, available_at DATETIME NOT NULL, delivered_at DATETIME DEFAULT NULL, INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE establishments ADD CONSTRAINT FK_5C67EFC56BF700BD FOREIGN KEY (status_id) REFERENCES establishment_status (id)');
$this->addSql('ALTER TABLE number_of_card_customer ADD CONSTRAINT FK_92C249008565851 FOREIGN KEY (establishment_id) REFERENCES establishments (id)');
$this->addSql('ALTER TABLE number_of_card_customer ADD CONSTRAINT FK_92C249009395C3F3 FOREIGN KEY (customer_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE type_establishment ADD CONSTRAINT FK_AB0206DB8565851 FOREIGN KEY (establishment_id) REFERENCES establishments (id)');
$this->addSql('ALTER TABLE type_establishment ADD CONSTRAINT FK_AB0206DBC54C8C93 FOREIGN KEY (type_id) REFERENCES types (id)');
$this->addSql('ALTER TABLE type_establishment ADD CONSTRAINT FK_AB0206DBB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE establishments DROP FOREIGN KEY FK_5C67EFC56BF700BD');
$this->addSql('ALTER TABLE number_of_card_customer DROP FOREIGN KEY FK_92C249008565851');
$this->addSql('ALTER TABLE number_of_card_customer DROP FOREIGN KEY FK_92C249009395C3F3');
$this->addSql('ALTER TABLE type_establishment DROP FOREIGN KEY FK_AB0206DB8565851');
$this->addSql('ALTER TABLE type_establishment DROP FOREIGN KEY FK_AB0206DBC54C8C93');
$this->addSql('ALTER TABLE type_establishment DROP FOREIGN KEY FK_AB0206DBB03A8386');
$this->addSql('DROP TABLE establishment_status');
$this->addSql('DROP TABLE establishments');
$this->addSql('DROP TABLE number_of_card_customer');
$this->addSql('DROP TABLE type_establishment');
$this->addSql('DROP TABLE types');
$this->addSql('DROP TABLE users');
$this->addSql('DROP TABLE messenger_messages');
}
}