diff options
author | lizyn <zhiylin@outlook.com> | 2020-02-24 10:04:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 10:04:13 +0800 |
commit | b19df31d78d881a43bcf6b3215e5fc3781e8e8aa (patch) | |
tree | d0d9861694a4b5e5fbfdbeb53c255ecd15fe9328 /app/DoctrineMigrations/Version20190117131816.php | |
parent | 4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff) | |
parent | 04d918cae0227c06a41d27fb6533dddbf30dfe71 (diff) | |
download | wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.gz wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.zst wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.zip |
Merge pull request #1 from wallabag/master
Keep up with the master again
Diffstat (limited to 'app/DoctrineMigrations/Version20190117131816.php')
-rw-r--r-- | app/DoctrineMigrations/Version20190117131816.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/DoctrineMigrations/Version20190117131816.php b/app/DoctrineMigrations/Version20190117131816.php new file mode 100644 index 00000000..6548b9fa --- /dev/null +++ b/app/DoctrineMigrations/Version20190117131816.php | |||
@@ -0,0 +1,32 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Application\Migrations; | ||
4 | |||
5 | use Doctrine\DBAL\Schema\Schema; | ||
6 | use Wallabag\CoreBundle\Doctrine\WallabagMigration; | ||
7 | |||
8 | /** | ||
9 | * Add updated_at fields to site_credential table. | ||
10 | */ | ||
11 | final class Version20190117131816 extends WallabagMigration | ||
12 | { | ||
13 | public function up(Schema $schema): void | ||
14 | { | ||
15 | $siteCredentialTable = $schema->getTable($this->getTable('site_credential')); | ||
16 | |||
17 | $this->skipIf($siteCredentialTable->hasColumn('updated_at'), 'It seems that you already played this migration.'); | ||
18 | |||
19 | $siteCredentialTable->addColumn('updated_at', 'datetime', [ | ||
20 | 'notnull' => false, | ||
21 | ]); | ||
22 | } | ||
23 | |||
24 | public function down(Schema $schema): void | ||
25 | { | ||
26 | $siteCredentialTable = $schema->getTable($this->getTable('site_credential')); | ||
27 | |||
28 | $this->skipIf(!$siteCredentialTable->hasColumn('updated_at'), 'It seems that you already played this migration.'); | ||
29 | |||
30 | $siteCredentialTable->dropColumn('updated_at'); | ||
31 | } | ||
32 | } | ||