From 2c84bc9135c12c79c5fe67c56094b153bf6b8bd1 Mon Sep 17 00:00:00 2001 From: Mat Fish Date: Tue, 7 Dec 2021 18:38:57 +0200 Subject: [PATCH] remove project config check from install migration (#2) --- CHANGELOG.md | 4 ++++ src/migrations/Install.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a20c220..21f8dc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Entry Meta +## 1.0.1 - 2021-12-04 +### Fixed +- Ensure install migration runs on new environment [#2](https://github.com/matfish2/craft-entry-meta/issues/2) + ## 1.0.0 - 2021-12-03 ### Added - Publish stable release [#1](https://github.com/matfish2/craft-entry-meta/issues/1) diff --git a/src/migrations/Install.php b/src/migrations/Install.php index e221099..5da2522 100644 --- a/src/migrations/Install.php +++ b/src/migrations/Install.php @@ -10,7 +10,7 @@ class Install extends Migration { public function safeUp() { - if (!$this->_pluginExistsInProjectConfig() && !$this->_columnExists()) { + if (!$this->_columnExists()) { echo "> Adding column " . EntryMeta::COLUMN_NAME . " to entries table..." . PHP_EOL; $columnType = Craft::$app->db->driverName==='pgsql' ? 'jsonb' : 'text'; Craft::$app->db->createCommand()->addColumn("{{%entries}}", EntryMeta::COLUMN_NAME, $columnType)->execute(); @@ -19,7 +19,7 @@ public function safeUp() public function safeDown() { - if ($this->_pluginExistsInProjectConfig() && $this->_columnExists()) { + if ($this->_columnExists()) { echo "> Removing column " . EntryMeta::COLUMN_NAME . " from entries table..." . PHP_EOL; Craft::$app->db->createCommand()->dropColumn("{{%entries}}", EntryMeta::COLUMN_NAME)->execute(); }