37 lines
872 B
PHP
37 lines
872 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Template\Migrations\Template;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
*/
|
|
final class Version20230922092754 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return "Create Table 'role_permission'";
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$sql = "CREATE TABLE role_permission (
|
|
id binary(16) NOT NULL DEFAULT (uuid_to_bin(uuid())),
|
|
role_id binary(16) NOT NULL,
|
|
permission_id binary(16) NOT NULL,
|
|
PRIMARY KEY (id)
|
|
);";
|
|
|
|
$this->addSql($sql);
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql("DROP TABLE role_permission;");
|
|
}
|
|
}
|