feat: mark a library document for a specific purpose
This commit is contained in:
1 parent
cb2d64f2cd
commit
19364df2db
8 files changed
+249
-6
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user