Skip to content

Commit

Permalink
remove project config check from install migration (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
matfish3 committed Dec 7, 2021
1 parent 9ce2356 commit 2c84bc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
}
Expand Down

0 comments on commit 2c84bc9

Please sign in to comment.