<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230823111617 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 city_with_postcode (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', iso_code VARCHAR(2) NOT NULL, city VARCHAR(161) NOT NULL, postcode VARCHAR(14) NOT NULL, INDEX city (city), INDEX postcode (postcode), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE sales_bundle__order_line ADD stock_reserved TINYINT(1) DEFAULT 0 NOT NULL');
$this->addSql('ALTER TABLE user ADD login_name VARCHAR(128) DEFAULT NULL, ADD api_pin VARCHAR(20) DEFAULT NULL, ADD api_token VARCHAR(40) DEFAULT NULL, ADD api_token_validity DATETIME DEFAULT NULL, ADD note LONGTEXT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE city_with_postcode');
$this->addSql('ALTER TABLE user DROP login_name, DROP api_pin, DROP api_token, DROP api_token_validity, DROP note');
$this->addSql('ALTER TABLE sales_bundle__order_line DROP stock_reserved');
}
}