Skip to content

Commit

Permalink
Fix migration error when upgrading from 3.4.x to 3.6.x
Browse files Browse the repository at this point in the history
Fixes #178
  • Loading branch information
Tam committed Jul 23, 2019
1 parent f6abbbd commit b3f43a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 3.6.1 - 2019-07-19
## [Unreleased] 3.6.2
### Fixed
- Fix migration error when upgrading from 3.4.x to 3.6.x (Fixes #178)

## 3.6.1 - 2019-07-19
### Added
- Add support for getting parts without having to go via the `parts` property.
(i.e. `myMap.parts.number` can be simply `myMap.number`). This _doesn't_ work
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ether/simplemap",
"description": "A beautifully simple Map field type for Craft CMS 3",
"version": "3.6.1",
"version": "3.6.2",
"type": "craft-plugin",
"license": "MIT",
"minimum-stability": "dev",
Expand Down
5 changes: 3 additions & 2 deletions src/migrations/m190226_143809_craft3_upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class m190226_143809_craft3_upgrade extends Migration
* @inheritdoc
*
* @throws \Throwable
* @throws \craft\errors\ElementNotFoundException
* @throws \yii\base\Exception
* @throws \yii\db\Exception
*/
Expand Down Expand Up @@ -169,7 +168,9 @@ private function _upgrade3 ()

// 2. Re-create the table
$this->dropTable(MapRecord::OldTableName);
(new Install())->safeUp();

if (!$this->db->tableExists(MapRecord::TableName))
(new Install())->safeUp();

// 3. Store the old data as new
$dupeKeys = [];
Expand Down

0 comments on commit b3f43a4

Please sign in to comment.