<?php
|
|
declare(strict_types=1);
|
|
namespace DoctrineMigrations;
|
|
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Types\Types;
|
use Doctrine\Migrations\AbstractMigration;
|
|
final class Version20261113120000 extends AbstractMigration
|
{
|
public function getDescription(): string
|
{
|
return 'Add the date a book was last seen during an inventory';
|
}
|
|
public function up(Schema $schema): void
|
{
|
foreach (['book', 'ousted_book'] as $table) {
|
$schema->getTable($table)->addColumn('last_seen', Types::DATETIME_IMMUTABLE, ['notnull' => false]);
|
}
|
}
|
|
public function down(Schema $schema): void
|
{
|
foreach (['book', 'ousted_book'] as $table) {
|
$schema->getTable($table)->dropColumn('last_seen');
|
}
|
}
|
}
|