-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migration to hopefully fix propagateNodes
- Loading branch information
1 parent
fabde6f
commit f4fc71f
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/migrations/m180827_000000_propagate_nav_setting_additional.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
namespace verbb\navigation\migrations; | ||
|
||
use craft\db\Migration; | ||
|
||
class m180827_000000_propagate_nav_setting_additional extends Migration | ||
{ | ||
public function safeUp() | ||
{ | ||
if (!$this->db->columnExists('{{%navigation_navs}}', 'propagateNodes')) { | ||
$this->addColumn('{{%navigation_navs}}', 'propagateNodes', $this->boolean()->after('sortOrder')->notNull()->defaultValue(false)); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
public function safeDown() | ||
{ | ||
echo "m180826_000000_propagate_nav_setting cannot be reverted.\n"; | ||
|
||
return false; | ||
} | ||
} |