mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
44 lines
1.4 KiB
PHP
44 lines
1.4 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 Version20250617160626 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(<<<'SQL'
|
|
CREATE TABLE stats_history (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, places_count INT DEFAULT NULL, emails_count INT DEFAULT NULL, completion_percent REAL DEFAULT NULL, emails_sent INT DEFAULT NULL, stats_id INT DEFAULT NULL, PRIMARY KEY(id))
|
|
SQL);
|
|
$this->addSql(<<<'SQL'
|
|
CREATE INDEX IDX_BE00311670AA3482 ON stats_history (stats_id)
|
|
SQL);
|
|
$this->addSql(<<<'SQL'
|
|
ALTER TABLE stats_history ADD CONSTRAINT FK_BE00311670AA3482 FOREIGN KEY (stats_id) REFERENCES stats (id) NOT DEFERRABLE INITIALLY IMMEDIATE
|
|
SQL);
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql(<<<'SQL'
|
|
ALTER TABLE stats_history DROP CONSTRAINT FK_BE00311670AA3482
|
|
SQL);
|
|
$this->addSql(<<<'SQL'
|
|
DROP TABLE stats_history
|
|
SQL);
|
|
}
|
|
}
|