<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20251219145312 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create new entity UserOAuth and add phoneVerified field to Customer entity';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE user_oauth (id INT AUTO_INCREMENT NOT NULL, phone VARCHAR(255) NOT NULL, code VARCHAR(6) NOT NULL, attempts INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE user ADD phone_verified TINYINT(1) DEFAULT 0');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE user_oauth');
$this->addSql('ALTER TABLE user DROP phone_verified');
}
}