<?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 Version20210106134817 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create tables nuser';
}
public function up(Schema $schema): void
{
$sql = <<<SQL
CREATE TABLE IF NOT EXISTS nuser (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100),
email VARCHAR(100) NOT NULL UNIQUE ,
password VARCHAR(100),
roles VARCHAR(50),
reset_hash VARCHAR(255) NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
SQL;
$this->addSql($sql);
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE nuser');
}
}