<?php
/* @noinspection PhpUnused */
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*
* @package API
* @internal
*/
final class Version20220711133620 extends AbstractMigration
{
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE health_insurance_provider DROP FOREIGN KEY FK_3319F7CF92F3E70');
$this->addSql('DROP TABLE health_insurance_provider');
}
public function getDescription(): string
{
return
"- Introduces health_insurance_provider table.";
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql(
'
CREATE TABLE health_insurance_provider (
id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
country_id VARCHAR(2) DEFAULT NULL COMMENT \'Country code in upper case (ISO 3166-1 Alpha-2)\',
created INT NOT NULL COMMENT \'Entity creation date as UNIX timestamp\',
active SMALLINT DEFAULT 1 NOT NULL COMMENT \'Indicator if entity is active\',
name VARCHAR(225) NOT NULL COMMENT \'Name for health insurance provider\',
address VARCHAR(225) DEFAULT NULL COMMENT \'Postal address for health insurance provider\',
zip_code VARCHAR(16) NOT NULL COMMENT \'Zip code of address for health insurance provider\',
city VARCHAR(225) NOT NULL COMMENT \'City of address for health insurance provider\',
last_active_date DATE DEFAULT NULL COMMENT \'Last active date\',
INDEX IDX_3319F7CF92F3E70 (country_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE health_insurance_provider ADD CONSTRAINT FK_3319F7CF92F3E70 FOREIGN KEY
(country_id) REFERENCES country (id) ON DELETE SET NULL
'
);
}
}