diff --git a/CHANGELOG.md b/CHANGELOG.md index 684b1b3..965838e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### Unreleased +### Fixed +- Adding visitor table migration to installation [#2](https://github.com/flipboxfactory/craft-hubspot/issues/2) + ## 1.2.1 - - 2019-11-20 ### Changed - Syncing visitors respects the 'queue' flag for existing records (still in the queue). diff --git a/src/migrations/Install.php b/src/migrations/Install.php index b0a8d5f..1b7ad6a 100644 --- a/src/migrations/Install.php +++ b/src/migrations/Install.php @@ -29,6 +29,10 @@ public function safeUp() return false; }; + if (false === (new m190818_122247_visitor())->safeUp()) { + return false; + }; + return true; } @@ -45,6 +49,10 @@ public function safeDown() return false; }; + if (false === (new m190818_122247_visitor())->safeDown()) { + return false; + }; + return true; } } diff --git a/src/migrations/m190818_122247_visitor.php b/src/migrations/m190818_122247_visitor.php index ab37924..9168a69 100644 --- a/src/migrations/m190818_122247_visitor.php +++ b/src/migrations/m190818_122247_visitor.php @@ -48,4 +48,13 @@ public function safeUp() true ); } + + /** + * @inheritdoc + */ + public function safeDown() + { + $this->dropTableIfExists(Visitor::tableName()); + return true; + } } diff --git a/src/migrations/m191008_163429_objectId.php b/src/migrations/m191008_163429_objectId.php index 273c76b..91a89c7 100644 --- a/src/migrations/m191008_163429_objectId.php +++ b/src/migrations/m191008_163429_objectId.php @@ -21,7 +21,7 @@ class m191008_163429_objectId extends Migration */ public function safeUp() { - https://stackoverflow.com/questions/10255724/incorrect-integer-2147483647-is-inserted-into-mysql + // https://stackoverflow.com/questions/10255724/incorrect-integer-2147483647-is-inserted-into-mysql $this->alterColumn( ObjectAssociation::tableName(), 'objectId',