<?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 Version20231017035450 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 showroom_additional_details (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, contact_name VARCHAR(255) NOT NULL, phone VARCHAR(255) DEFAULT NULL, email VARCHAR(255) NOT NULL, is_primary TINYINT(1) NOT NULL, created_on DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_425C8B2AA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE showroom_details (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, business_name VARCHAR(255) NOT NULL, address LONGTEXT DEFAULT NULL, city BIGINT DEFAULT NULL, state VARCHAR(255) DEFAULT NULL, zipcode VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_6FBDF5DCA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE showroom_additional_details ADD CONSTRAINT FK_425C8B2AA76ED395 FOREIGN KEY (user_id) REFERENCES showroom_details (id)');
$this->addSql('ALTER TABLE showroom_details ADD CONSTRAINT FK_6FBDF5DCA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE showroom_additional_details DROP FOREIGN KEY FK_425C8B2AA76ED395');
$this->addSql('ALTER TABLE showroom_details DROP FOREIGN KEY FK_6FBDF5DCA76ED395');
$this->addSql('DROP TABLE showroom_additional_details');
$this->addSql('DROP TABLE showroom_details');
$this->addSql('ALTER TABLE user CHANGE user_type user_type VARCHAR(200) DEFAULT NULL COMMENT \'0 => backend, 1 => frontend\', CHANGE user_role_type user_role_type VARCHAR(255) DEFAULT NULL, CHANGE styles styles TEXT DEFAULT NULL');
}
}