Make BilletBuyer firstName, lastName, email nullable for guest checkout flow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
33
migrations/Version20260321260000.php
Normal file
33
migrations/Version20260321260000.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260321260000 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Make firstName, lastName, email nullable on billet_buyer for guest orders';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE billet_buyer ALTER COLUMN first_name DROP NOT NULL');
|
||||
$this->addSql('ALTER TABLE billet_buyer ALTER COLUMN last_name DROP NOT NULL');
|
||||
$this->addSql('ALTER TABLE billet_buyer ALTER COLUMN email DROP NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql("UPDATE billet_buyer SET first_name = '' WHERE first_name IS NULL");
|
||||
$this->addSql("UPDATE billet_buyer SET last_name = '' WHERE last_name IS NULL");
|
||||
$this->addSql("UPDATE billet_buyer SET email = '' WHERE email IS NULL");
|
||||
$this->addSql('ALTER TABLE billet_buyer ALTER COLUMN first_name SET NOT NULL');
|
||||
$this->addSql('ALTER TABLE billet_buyer ALTER COLUMN last_name SET NOT NULL');
|
||||
$this->addSql('ALTER TABLE billet_buyer ALTER COLUMN email SET NOT NULL');
|
||||
}
|
||||
}
|
||||
@@ -28,13 +28,13 @@ class BilletBuyer
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?User $user = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $firstName = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $lastName = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $email = null;
|
||||
|
||||
#[ORM\Column(length: 23, unique: true)]
|
||||
|
||||
Reference in New Issue
Block a user