migrations/Version20220729085257.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220729085257 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Insert Default Value';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {        
  17.         $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');");
  18.         $this->addSql("INSERT INTO user_role (user_id, role_id) select id,client_type_id from user where login='default';");
  19.     }
  20.     public function down(Schema $schema): void
  21.     {
  22.         $this->addSql("DELETE FROM user_role where user_id in (select id from user where login = 'default');");
  23.         $this->addSql("DELETE FROM user where login = 'default';");
  24.         
  25.     }
  26. }