2023-04-20 23:23:04 +02:00
< ? php
declare ( strict_types = 1 );
namespace DoctrineMigrations ;
use Doctrine\DBAL\Schema\Schema ;
use Doctrine\Migrations\AbstractMigration ;
/**
* Auto - generated Migration : Please modify to your needs !
*/
2023-12-17 01:55:26 +01:00
final class Version20231217002445 extends AbstractMigration
2023-04-20 23:23:04 +02:00
{
public function getDescription () : string
{
return '' ;
}
public function up ( Schema $schema ) : void
{
// this up() migration is auto-generated, please modify it to your needs
2023-12-17 01:55:26 +01:00
$this -> addSql ( 'CREATE TABLE snip_content (id BINARY(16) NOT NULL COMMENT \'(DC2Type:ulid)\', snip_id INT NOT NULL, parent_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:ulid)\', text LONGTEXT DEFAULT NULL, INDEX IDX_185DCA87140FD260 (snip_id), INDEX IDX_185DCA87727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB' );
2023-04-20 23:23:04 +02:00
$this -> addSql ( 'ALTER TABLE snip_content ADD CONSTRAINT FK_185DCA87140FD260 FOREIGN KEY (snip_id) REFERENCES snip (id)' );
$this -> addSql ( 'ALTER TABLE snip_content ADD CONSTRAINT FK_185DCA87727ACA70 FOREIGN KEY (parent_id) REFERENCES snip_content (id)' );
2023-12-17 01:55:26 +01:00
$this -> addSql ( 'ALTER TABLE user CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'' );
2023-04-20 23:23:04 +02:00
}
public function down ( Schema $schema ) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this -> addSql ( 'ALTER TABLE snip_content DROP FOREIGN KEY FK_185DCA87140FD260' );
$this -> addSql ( 'ALTER TABLE snip_content DROP FOREIGN KEY FK_185DCA87727ACA70' );
$this -> addSql ( 'DROP TABLE snip_content' );
$this -> addSql ( 'ALTER TABLE `user` CHANGE roles roles LONGTEXT NOT NULL COLLATE `utf8mb4_bin`' );
}
}