Properly mark the tinyint column with a comment, so that migrations can properly detect that no changes are needed

This commit is contained in:
Jan Böhmer 2023-04-09 00:04:13 +02:00
parent aaf6c37871
commit 342ed382e3
5 changed files with 83 additions and 1 deletions

View file

@ -28,6 +28,7 @@ final class Version20230408213957 extends AbstractMultiPlatformMigration
}
$this->addSql('ALTER TABLE projects CHANGE description description LONGTEXT DEFAULT \'\' NOT NULL');
$this->addSql('ALTER TABLE users CHANGE permissions_data permissions_data LONGTEXT DEFAULT \'[]\' NOT NULL COMMENT \'(DC2Type:json)\', CHANGE saml_user saml_user TINYINT(1) NOT NULL, CHANGE about_me about_me LONGTEXT DEFAULT \'\' NOT NULL');
$this->addSql('ALTER TABLE log CHANGE level level TINYINT NOT NULL COMMENT \'(DC2Type:tinyint)\'');
}
public function mySQLDown(Schema $schema): void
@ -37,6 +38,7 @@ final class Version20230408213957 extends AbstractMultiPlatformMigration
$this->addSql('ALTER TABLE log CHANGE level level TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE projects CHANGE description description LONGTEXT NOT NULL');
$this->addSql('ALTER TABLE `users` CHANGE about_me about_me LONGTEXT NOT NULL, CHANGE saml_user saml_user TINYINT(1) DEFAULT 0 NOT NULL, CHANGE permissions_data permissions_data LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE log CHANGE level level TINYINT(1) NOT NULL');
}
public function sqLiteUp(Schema $schema): void

View file

@ -0,0 +1,31 @@
<?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 Version20230408220140 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
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}