mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-25 10:31:05 +00:00
1e0d8ad7b7
- Fix error for level 0 & 1 (level 7 has 699 errors...) - Add `updated_at` to site_credential (so the `timestamps()` method applies correctly)
32 lines
957 B
PHP
32 lines
957 B
PHP
<?php
|
|
|
|
namespace Application\Migrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
|
|
|
/**
|
|
* Add updated_at fields to site_credential table.
|
|
*/
|
|
final class Version20190117131816 extends WallabagMigration
|
|
{
|
|
public function up(Schema $schema): void
|
|
{
|
|
$siteCredentialTable = $schema->getTable($this->getTable('site_credential'));
|
|
|
|
$this->skipIf($siteCredentialTable->hasColumn('updated_at'), 'It seems that you already played this migration.');
|
|
|
|
$siteCredentialTable->addColumn('updated_at', 'datetime', [
|
|
'notnull' => false,
|
|
]);
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$siteCredentialTable = $schema->getTable($this->getTable('site_credential'));
|
|
|
|
$this->skipIf(!$siteCredentialTable->hasColumn('updated_at'), 'It seems that you already played this migration.');
|
|
|
|
$siteCredentialTable->dropColumn('updated_at');
|
|
}
|
|
}
|