migrations/2019/10/Version20191029134551.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;final class Version20191029134551 extends AbstractMigration{public function up(Schema $schema): void{$this->addSql('CREATE TABLE invoice_item (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', invoice_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', sequence SMALLINT NOT NULL, description VARCHAR(255) NOT NULL, quantity INT NOT NULL, unit_price INT NOT NULL, vat INT NOT NULL, INDEX IDX_1DDE477B2989F1FD (invoice_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');$this->addSql('ALTER TABLE invoice_item ADD CONSTRAINT FK_1DDE477B2989F1FD FOREIGN KEY (invoice_id) REFERENCES invoice (id)');$this->addSql('ALTER TABLE contact ADD bank_iban VARCHAR(255) DEFAULT NULL, ADD bank_bic VARCHAR(255) DEFAULT NULL');$this->addSql('ALTER TABLE invoice ADD items_gross_total BIGINT NOT NULL, DROP invoice_date, CHANGE customer_email customer_email VARCHAR(255) DEFAULT NULL, CHANGE customer_phone customer_phone VARCHAR(255) DEFAULT NULL, CHANGE customer_bank_iban customer_bank_iban VARCHAR(34) DEFAULT NULL, CHANGE customer_bank_bic customer_bank_bic VARCHAR(11) DEFAULT NULL, CHANGE items_total items_net_total BIGINT NOT NULL');}public function down(Schema $schema): void{$this->addSql('DROP TABLE invoice_item');$this->addSql('ALTER TABLE contact DROP bank_iban, DROP bank_bic');$this->addSql('ALTER TABLE invoice ADD invoice_date DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', ADD items_total BIGINT NOT NULL, DROP items_net_total, DROP items_gross_total, CHANGE customer_email customer_email VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE customer_phone customer_phone VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE customer_bank_iban customer_bank_iban VARCHAR(34) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE customer_bank_bic customer_bank_bic VARCHAR(11) NOT NULL COLLATE utf8mb4_unicode_ci');}}