40 lines
2.1 KiB
PHP
40 lines
2.1 KiB
PHP
<?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 Version20260812163058 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 exercise_session (id INT AUTO_INCREMENT NOT NULL, type VARCHAR(255) DEFAULT NULL, started_at DATETIME NOT NULL, ended_at DATETIME DEFAULT NULL, duration INT NOT NULL, distance NUMERIC(10, 0) NOT NULL, calories INT NOT NULL, notes LONGTEXT DEFAULT NULL, source VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci`');
|
|
$this->addSql('ALTER TABLE settings CHANGE latitude latitude VARCHAR(255) DEFAULT NULL, CHANGE longitude longitude VARCHAR(255) DEFAULT NULL');
|
|
$this->addSql('ALTER TABLE settings RENAME INDEX uniq_settings_user TO UNIQ_E545A0C5A76ED395');
|
|
$this->addSql('ALTER TABLE task CHANGE is_outdoor is_outdoor TINYINT NOT NULL, CHANGE weather_profile weather_profile VARCHAR(30) NOT NULL');
|
|
$this->addSql('ALTER TABLE weather_forecast RENAME INDEX idx_forecast_settings TO IDX_CB36DFBF59949888');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('DROP TABLE exercise_session');
|
|
$this->addSql('ALTER TABLE settings CHANGE latitude latitude NUMERIC(10, 7) DEFAULT NULL, CHANGE longitude longitude NUMERIC(10, 7) DEFAULT NULL');
|
|
$this->addSql('ALTER TABLE settings RENAME INDEX uniq_e545a0c5a76ed395 TO UNIQ_SETTINGS_USER');
|
|
$this->addSql('ALTER TABLE task CHANGE is_outdoor is_outdoor TINYINT DEFAULT 0 NOT NULL, CHANGE weather_profile weather_profile VARCHAR(30) DEFAULT \'none\' NOT NULL');
|
|
$this->addSql('ALTER TABLE weather_forecast RENAME INDEX idx_cb36dfbf59949888 TO IDX_FORECAST_SETTINGS');
|
|
}
|
|
}
|