Skip to content

Commit

Permalink
updating installation migration to include creation of visitor table
Browse files Browse the repository at this point in the history
  • Loading branch information
nateiler committed Dec 4, 2019
1 parent 3af9e6b commit 74737f3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
8 changes: 8 additions & 0 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public function safeUp()
return false;
};

if (false === (new m190818_122247_visitor())->safeUp()) {
return false;
};

return true;
}

Expand All @@ -45,6 +49,10 @@ public function safeDown()
return false;
};

if (false === (new m190818_122247_visitor())->safeDown()) {
return false;
};

return true;
}
}
9 changes: 9 additions & 0 deletions src/migrations/m190818_122247_visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,13 @@ public function safeUp()
true
);
}

/**
* @inheritdoc
*/
public function safeDown()
{
$this->dropTableIfExists(Visitor::tableName());
return true;
}
}
2 changes: 1 addition & 1 deletion src/migrations/m191008_163429_objectId.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 74737f3

Please sign in to comment.