<?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 Version20220729085257 extends AbstractMigration
{
public function getDescription(): string
{
return 'Insert Default Value';
}
public function up(Schema $schema): void
{
$this->addSql("INSERT INTO user (login, password, code_client, client_type_id) VALUES ('default','\$argon2id\$v=19\$m=65536,t=4,p=1\$HNw0HMzYf63XDuPjEba2Cg$4sGuKxG0l2UnMCztSQn4BPic4SdMvMn+uPD04aOYyuI','534192', '1');");
$this->addSql("INSERT INTO user_role (user_id, role_id) select id,client_type_id from user where login='default';");
}
public function down(Schema $schema): void
{
$this->addSql("DELETE FROM user_role where user_id in (select id from user where login = 'default');");
$this->addSql("DELETE FROM user where login = 'default';");
}
}