Allow snips to be archived

This commit is contained in:
Tim
2025-05-10 16:48:03 +02:00
parent 50a7ab7985
commit 47ea226ed7
8 changed files with 107 additions and 10 deletions

View File

@ -0,0 +1,44 @@
<?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 Version20250510142748 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(<<<'SQL'
ALTER TABLE snip DROP INDEX IDX_FEBD97966A1E45F3, ADD UNIQUE INDEX UNIQ_FEBD97966A1E45F3 (active_version_id)
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE snip ADD archived TINYINT(1) NOT NULL
SQL);
$this->addSql(<<<'SQL'
UPDATE snip SET archived = 0
SQL);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql(<<<'SQL'
ALTER TABLE snip DROP INDEX UNIQ_FEBD97966A1E45F3, ADD INDEX IDX_FEBD97966A1E45F3 (active_version_id)
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE snip DROP archived
SQL);
}
}