36 lines
1.4 KiB
PHP
36 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 Version20260407082003 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 payment_reminder (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, step VARCHAR(30) NOT NULL, sent_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, details TEXT DEFAULT NULL, advert_id INT NOT NULL, PRIMARY KEY (id))');
|
||
|
|
$this->addSql('CREATE INDEX idx_payment_reminder_advert ON payment_reminder (advert_id)');
|
||
|
|
$this->addSql('CREATE INDEX idx_payment_reminder_step ON payment_reminder (step)');
|
||
|
|
$this->addSql('ALTER TABLE payment_reminder ADD CONSTRAINT FK_F10D28D07ECCB6 FOREIGN KEY (advert_id) REFERENCES advert (id) ON DELETE CASCADE NOT DEFERRABLE');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(Schema $schema): void
|
||
|
|
{
|
||
|
|
// this down() migration is auto-generated, please modify it to your needs
|
||
|
|
$this->addSql('ALTER TABLE payment_reminder DROP CONSTRAINT FK_F10D28D07ECCB6');
|
||
|
|
$this->addSql('DROP TABLE payment_reminder');
|
||
|
|
}
|
||
|
|
}
|