36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* A slot marker on the document library, so a feature can look a file up by what it is for
|
|
* instead of by id (App\Config\UploadToken). Unique: one document per slot.
|
|
*
|
|
* Reduced to these two statements by hand - the generated diff also wanted to drop another
|
|
* branch's upload columns and restate the long-standing datetime drift on this table.
|
|
*/
|
|
final class Version20260924140000 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add the token slot marker to upload';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE upload ADD token VARCHAR(64) DEFAULT NULL');
|
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_17BDE61F5F37A13B ON upload (token)');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('DROP INDEX UNIQ_17BDE61F5F37A13B ON upload');
|
|
$this->addSql('ALTER TABLE upload DROP token');
|
|
}
|
|
}
|