From 1e0d8ad7b728f6fb2cd886526b0fb84ef803e84f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 17 Jan 2019 14:28:05 +0100 Subject: Enable PHPStan - Fix error for level 0 & 1 (level 7 has 699 errors...) - Add `updated_at` to site_credential (so the `timestamps()` method applies correctly) --- app/DoctrineMigrations/Version20190117131816.php | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 app/DoctrineMigrations/Version20190117131816.php (limited to 'app/DoctrineMigrations') 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 @@ +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'); + } +} -- cgit v1.2.3