<?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 Version20260609134731 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 team_invitation (id INT AUTO_INCREMENT NOT NULL, team_id INT NOT NULL, created_by_id INT NOT NULL, token VARCHAR(64) NOT NULL, expires_at DATETIME NOT NULL, created_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_CFC413675F37A13B (token), INDEX IDX_CFC41367296CD8AE (team_id), INDEX IDX_CFC41367B03A8386 (created_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE team_invitation ADD CONSTRAINT FK_CFC41367296CD8AE FOREIGN KEY (team_id) REFERENCES team (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE team_invitation ADD CONSTRAINT FK_CFC41367B03A8386 FOREIGN KEY (created_by_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE bike_log CHANGE distance_amount distance_amount NUMERIC(10, 2) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE run_log CHANGE distance_amount distance_amount NUMERIC(10, 2) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE teamplay_user_recap CHANGE total_bike_distance total_bike_distance NUMERIC(12, 2) DEFAULT \'0\' NOT NULL, CHANGE total_run_distance total_run_distance NUMERIC(12, 2) DEFAULT \'0\' NOT NULL, CHANGE team_total_bike_distance team_total_bike_distance NUMERIC(12, 2) DEFAULT \'0\' NOT NULL, CHANGE team_total_run_distance team_total_run_distance NUMERIC(12, 2) DEFAULT \'0\' NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE team_invitation DROP FOREIGN KEY FK_CFC41367296CD8AE');
$this->addSql('ALTER TABLE team_invitation DROP FOREIGN KEY FK_CFC41367B03A8386');
$this->addSql('DROP TABLE team_invitation');
$this->addSql('ALTER TABLE bike_log CHANGE distance_amount distance_amount NUMERIC(10, 2) DEFAULT \'0.00\' NOT NULL');
$this->addSql('ALTER TABLE run_log CHANGE distance_amount distance_amount NUMERIC(10, 2) DEFAULT \'0.00\' NOT NULL');
$this->addSql('ALTER TABLE teamplay_user_recap CHANGE total_bike_distance total_bike_distance NUMERIC(12, 2) DEFAULT \'0.00\' NOT NULL, CHANGE total_run_distance total_run_distance NUMERIC(12, 2) DEFAULT \'0.00\' NOT NULL, CHANGE team_total_bike_distance team_total_bike_distance NUMERIC(12, 2) DEFAULT \'0.00\' NOT NULL, CHANGE team_total_run_distance team_total_run_distance NUMERIC(12, 2) DEFAULT \'0.00\' NOT NULL');
}
}