migrations/Version20250412094201.php line 1

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. final class Version20250412094201 extends AbstractMigration
  6. {
  7.     public function getDescription(): string
  8.     {
  9.         return 'Adds updatedAt field when entry got updated';
  10.     }
  11.     public function up(Schema $schema): void
  12.     {
  13.         $this->addSql('ALTER TABLE payment_intent_events ADD updated_at DATETIME DEFAULT CURRENT_TIMESTAMP AFTER created_at');
  14.         $this->addSql('UPDATE payment_intent_events SET updated_at = created_at');
  15.     }
  16.     public function down(Schema $schema): void
  17.     {
  18.         $this->addSql('ALTER TABLE payment_intent_events DROP updated_at');
  19.     }
  20. }