Replace isScanned with state (valid/invalid/expired) and firstScannedAt on BilletOrder
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
32
migrations/Version20260321200000.php
Normal file
32
migrations/Version20260321200000.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260321200000 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Replace isScanned with state and firstScannedAt on billet_order';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql("ALTER TABLE billet_order ADD COLUMN IF NOT EXISTS state VARCHAR(20) DEFAULT 'valid' NOT NULL");
|
||||
$this->addSql('ALTER TABLE billet_order ADD COLUMN IF NOT EXISTS first_scanned_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE billet_order DROP COLUMN IF EXISTS is_scanned');
|
||||
$this->addSql('ALTER TABLE billet_order DROP COLUMN IF EXISTS scanned_at');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE billet_order ADD COLUMN IF NOT EXISTS is_scanned BOOLEAN DEFAULT false NOT NULL');
|
||||
$this->addSql('ALTER TABLE billet_order ADD COLUMN IF NOT EXISTS scanned_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE billet_order DROP COLUMN IF EXISTS state');
|
||||
$this->addSql('ALTER TABLE billet_order DROP COLUMN IF EXISTS first_scanned_at');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user