WIP: Implement closer BPN integration

This commit is contained in:
Björn Fromme
2023-10-06 18:14:05 +02:00
parent bea5edd615
commit 25a90b04aa
23 changed files with 628 additions and 224 deletions
+39
View File
@@ -0,0 +1,39 @@
<?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 Version20231006134112 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 bpn_date (id INT AUTO_INCREMENT NOT NULL, product_id INT NOT NULL, hotel_id INT NOT NULL, bus_pro_id INT NOT NULL, date_from DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', date_to DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\', bus TINYINT(1) NOT NULL, INDEX IDX_18E376D24584665A (product_id), INDEX IDX_18E376D23243BB18 (hotel_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE bpn_hotel (id INT AUTO_INCREMENT NOT NULL, bus_pro_id INT NOT NULL, code VARCHAR(32) NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE bpn_product (id INT AUTO_INCREMENT NOT NULL, bus_pro_id INT NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(32) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE bpn_date ADD CONSTRAINT FK_18E376D24584665A FOREIGN KEY (product_id) REFERENCES bpn_date (id)');
$this->addSql('ALTER TABLE bpn_date ADD CONSTRAINT FK_18E376D23243BB18 FOREIGN KEY (hotel_id) REFERENCES bpn_hotel (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bpn_date DROP FOREIGN KEY FK_18E376D24584665A');
$this->addSql('ALTER TABLE bpn_date DROP FOREIGN KEY FK_18E376D23243BB18');
$this->addSql('DROP TABLE bpn_date');
$this->addSql('DROP TABLE bpn_hotel');
$this->addSql('DROP TABLE bpn_product');
}
}
+39
View File
@@ -0,0 +1,39 @@
<?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 Version20231006144941 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 bpn_date DROP FOREIGN KEY FK_18E376D24584665A');
$this->addSql('ALTER TABLE bpn_date DROP FOREIGN KEY FK_18E376D23243BB18');
$this->addSql('DROP INDEX IDX_18E376D24584665A ON bpn_date');
$this->addSql('DROP INDEX IDX_18E376D23243BB18 ON bpn_date');
$this->addSql('ALTER TABLE bpn_date ADD code VARCHAR(32) NOT NULL, ADD product VARCHAR(255) NOT NULL, ADD hotel VARCHAR(255) NOT NULL, DROP product_id, DROP hotel_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bpn_date ADD product_id INT NOT NULL, ADD hotel_id INT NOT NULL, DROP code, DROP product, DROP hotel');
$this->addSql('ALTER TABLE bpn_date ADD CONSTRAINT FK_18E376D24584665A FOREIGN KEY (product_id) REFERENCES bpn_date (id)');
$this->addSql('ALTER TABLE bpn_date ADD CONSTRAINT FK_18E376D23243BB18 FOREIGN KEY (hotel_id) REFERENCES bpn_hotel (id)');
$this->addSql('CREATE INDEX IDX_18E376D24584665A ON bpn_date (product_id)');
$this->addSql('CREATE INDEX IDX_18E376D23243BB18 ON bpn_date (hotel_id)');
}
}
+33
View File
@@ -0,0 +1,33 @@
<?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 Version20231006145056 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('DROP TABLE bpn_hotel');
$this->addSql('DROP TABLE bpn_product');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE bpn_hotel (id INT AUTO_INCREMENT NOT NULL, bus_pro_id INT NOT NULL, code VARCHAR(32) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE bpn_product (id INT AUTO_INCREMENT NOT NULL, bus_pro_id INT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, code VARCHAR(32) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
}
}
+31
View File
@@ -0,0 +1,31 @@
<?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 Version20231006152954 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 bpn_date ADD hotel_code VARCHAR(32) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bpn_date DROP hotel_code');
}
}
+31
View File
@@ -0,0 +1,31 @@
<?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 Version20231006153242 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 bpn_date ADD pickups JSON NOT NULL COMMENT \'(DC2Type:json)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bpn_date DROP pickups');
}
}
+31
View File
@@ -0,0 +1,31 @@
<?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 Version20231006155227 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 bpn_date ADD hotel_bus_pro_id INT NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bpn_date DROP hotel_bus_pro_id');
}
}