<?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 Version20230922103425 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 tennis_court_availability DROP FOREIGN KEY FK_9C5BDB3699E6F5DF');
$this->addSql('ALTER TABLE tennis_court_availability DROP FOREIGN KEY FK_9C5BDB36F8B86DD7');
$this->addSql('DROP INDEX IDX_9C5BDB36F8B86DD7 ON tennis_court_availability');
$this->addSql('DROP INDEX IDX_9C5BDB3699E6F5DF ON tennis_court_availability');
$this->addSql('ALTER TABLE tennis_court_availability DROP booking_creator_id, DROP player_id, DROP court_booked, DROP court_number, DROP status, DROP created_at');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tennis_court_availability ADD booking_creator_id INT DEFAULT NULL, ADD player_id INT DEFAULT NULL, ADD court_booked TINYINT(1) DEFAULT NULL, ADD court_number INT DEFAULT NULL, ADD status VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD created_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE tennis_court_availability ADD CONSTRAINT FK_9C5BDB3699E6F5DF FOREIGN KEY (player_id) REFERENCES tennis_players (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE tennis_court_availability ADD CONSTRAINT FK_9C5BDB36F8B86DD7 FOREIGN KEY (booking_creator_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_9C5BDB36F8B86DD7 ON tennis_court_availability (booking_creator_id)');
$this->addSql('CREATE INDEX IDX_9C5BDB3699E6F5DF ON tennis_court_availability (player_id)');
}
}