<?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 Version20201222123920 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE std_web_users_addresses (id INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT \'Unique identifier\', webuser_id INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', name VARCHAR(250) DEFAULT NULL COMMENT \'Address description\', address_line_1 VARCHAR(500) DEFAULT NULL COMMENT \'Address first line\', address_line_2 VARCHAR(500) DEFAULT NULL COMMENT \'Address second line\', zipcode_1 VARCHAR(50) DEFAULT NULL COMMENT \'Zipcode first part\', zipcode_2 VARCHAR(50) DEFAULT NULL COMMENT \'Zipcode second part\', city VARCHAR(50) DEFAULT NULL COMMENT \'Address city\', state VARCHAR(50) DEFAULT NULL COMMENT \'Address state\', country VARCHAR(100) DEFAULT NULL COMMENT \'Address country\', custom_fields JSON DEFAULT NULL COMMENT \'Json structure with custom fields\', is_billing TINYINT(1) DEFAULT NULL COMMENT \'Flag that indicates this is the user\'\'s billing address\', is_default TINYINT(1) DEFAULT NULL COMMENT \'Flag that indicates this is the user\'\'s default billing or shipping address depending on the is_billing column\', is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if the record is active\', created_date DATETIME NOT NULL COMMENT \'Date and time of the record creation\', updated_date DATETIME NOT NULL COMMENT \'Date and time the record was last updated\', INDEX FK__std_web_users (webuser_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE std_web_users_addresses ADD CONSTRAINT FK_6321161549279951 FOREIGN KEY (webuser_id) REFERENCES std_web_users (id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE std_web_users_addresses');
}
}