2024-06-14 15:41:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
|
|
*/
|
2024-06-15 16:47:33 +00:00
|
|
|
final class Version20240615164453 extends AbstractMigration
|
2024-06-14 15:41:00 +00:00
|
|
|
{
|
|
|
|
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 food_order (id BLOB NOT NULL --(DC2Type:ulid)
|
|
|
|
, food_vendor_id BLOB NOT NULL --(DC2Type:ulid)
|
|
|
|
, closed_at DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
|
|
|
, PRIMARY KEY(id), CONSTRAINT FK_44856726EF983E8 FOREIGN KEY (food_vendor_id) REFERENCES food_vendor (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
|
|
$this->addSql('CREATE INDEX IDX_44856726EF983E8 ON food_order (food_vendor_id)');
|
|
|
|
$this->addSql('CREATE TABLE food_vendor (id BLOB NOT NULL --(DC2Type:ulid)
|
|
|
|
, name VARCHAR(50) NOT NULL, PRIMARY KEY(id))');
|
|
|
|
$this->addSql('CREATE TABLE order_item (id BLOB NOT NULL --(DC2Type:ulid)
|
|
|
|
, food_order_id BLOB NOT NULL --(DC2Type:ulid)
|
|
|
|
, name VARCHAR(255) NOT NULL, extras VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_52EA1F09A5D24A7A FOREIGN KEY (food_order_id) REFERENCES food_order (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
|
|
$this->addSql('CREATE INDEX IDX_52EA1F09A5D24A7A ON order_item (food_order_id)');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down(Schema $schema): void
|
|
|
|
{
|
|
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
|
|
$this->addSql('DROP TABLE food_order');
|
|
|
|
$this->addSql('DROP TABLE food_vendor');
|
|
|
|
$this->addSql('DROP TABLE order_item');
|
|
|
|
}
|
|
|
|
}
|