<?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 Version20250115121625 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$isRoleAdmin = $this->connection->fetchAssociative(("SELECT * FROM `std_roles` WHERE `name` = 'ROLE_ADMIN'"));
if(empty($isRoleAdmin)){
$this->addSql("INSERT INTO `std_roles` (`id`, `created_by`, `updated_by`, `name`, `is_active`, `created_date`, `updated_date`) VALUES (2, 1, 1, 'ROLE_ADMIN', 1, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP());");
}
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql("DELETE FROM `std_roles` WHERE `name` = 'ROLE_ADMIN';");
}
}