src/Migrations/Version20210428190935.php line 1
<?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 Version20210428190935 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
$this->addSql('CREATE TABLE user_rights (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, role VARCHAR(255) NOT NULL, payload JSON NOT NULL, active TINYINT(1) DEFAULT \'1\' NOT NULL, deleted TINYINT(1) DEFAULT \'0\' NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, owner_uuid VARCHAR(36) DEFAULT NULL, owner_active TINYINT(1) DEFAULT \'1\' NOT NULL, owner_deleted TINYINT(1) DEFAULT \'0\' NOT NULL, INDEX IDX_6432CA3EA76ED395 (user_id), INDEX IDX_6432CA3EB03A8386 (created_by_id), INDEX IDX_6432CA3E896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE user_rights ADD CONSTRAINT FK_6432CA3EA76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE user_rights ADD CONSTRAINT FK_6432CA3EB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE user_rights ADD CONSTRAINT FK_6432CA3E896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
$this->addSql('DROP TABLE olympiad_user');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE olympiad_user (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, owner VARCHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, type VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_3DEEA8C1A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE olympiad_user ADD CONSTRAINT FK_3DEEA8C1A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('DROP TABLE user_rights');
}
}