hesabix/core/migrations/Version20241201000000.php

45 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2025-08-31 19:48:07 +03:30
<?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 Version20241201000000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create user table';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE `user` (
id INT AUTO_INCREMENT NOT NULL,
email VARCHAR(180) NOT NULL,
mobile VARCHAR(15) NOT NULL,
full_name VARCHAR(100) NOT NULL,
roles JSON NOT NULL,
password VARCHAR(255) NOT NULL,
is_verified TINYINT(1) NOT NULL,
created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\',
updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\',
reset_token VARCHAR(255) DEFAULT NULL,
reset_token_expires_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\',
UNIQUE INDEX UNIQ_8D93D649E7927C74 (email),
UNIQUE INDEX UNIQ_8D93D6493C7323CB (mobile),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE `user`');
}
}