<?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 Version20210705140434 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('ALTER TABLE product ADD type VARCHAR(100) NOT NULL');
$this->addSql('UPDATE product SET `type`="product"');
$this->connection->insert('productCategories', [
'name' => 'Envios',
'display' => 0
]);
$id = $this->connection->lastInsertId();
$this->addSql('INSERT INTO product(`name`, `type`, publicSale, active, base_price, price, tax, idCategory, recommended, isDeleted, is_wholesaler, description, presentation) VALUES
("Envio Zona A", "shipping", 0, 1, 123.9669, 150, 21.0, ' . $id . ', 0, 0, 0, "", ""),
("Envio Zona B", "shipping", 0, 1, 148.7603, 180, 21.0, ' . $id . ', 0, 0, 0, "", ""),
("Envio Zona C", "shipping", 0, 1, 206.6116, 250, 21.0, ' . $id . ', 0, 0, 0, "", "")
');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE product DROP type');
}
public function isTransactional(): bool
{
return false;
}
}