<?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 Version20230307160220 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 motorbike_rental (id INT AUTO_INCREMENT NOT NULL, deactivated_by_id INT DEFAULT NULL, spz VARCHAR(20) NOT NULL, name VARCHAR(255) NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, is_deactivated TINYINT(1) NOT NULL, deactivated_at DATETIME DEFAULT NULL, INDEX IDX_C90665CEBDC76BAA (deactivated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE motorbike_rental ADD CONSTRAINT FK_C90665CEBDC76BAA FOREIGN KEY (deactivated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE `order` ADD rental_motorbike_id INT DEFAULT NULL, ADD photos JSON DEFAULT NULL, ADD acceptance_note LONGTEXT DEFAULT NULL, ADD save_with_pricelist TINYINT(1) DEFAULT NULL, ADD is_order_saved TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE `order` ADD CONSTRAINT FK_F529939830D65921 FOREIGN KEY (rental_motorbike_id) REFERENCES motorbike_rental (id)');
$this->addSql('CREATE INDEX IDX_F529939830D65921 ON `order` (rental_motorbike_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F529939830D65921');
$this->addSql('DROP TABLE motorbike_rental');
$this->addSql('DROP INDEX IDX_F529939830D65921 ON `order`');
$this->addSql('ALTER TABLE `order` DROP rental_motorbike_id, DROP photos, DROP acceptance_note, DROP save_with_pricelist, DROP is_order_saved');
}
}