From 2a64e42ddd1a4de920b088f0816f6416671940b6 Mon Sep 17 00:00:00 2001 From: Jamie White Date: Tue, 12 Sep 2023 17:11:16 +0100 Subject: [PATCH 1/2] Migration for supercool fields -> spicyweb --- composer.json | 4 +- src/Tools.php | 5 ++ ...0911_000000_supercool_fields_migration.php | 50 +++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 src/migrations/m230911_000000_supercool_fields_migration.php diff --git a/composer.json b/composer.json index 9131407..6c3bb7b 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "spicyweb/craft-odds-and-ends", "description": "A collection of useful tools for Craft CMS websites", "type": "craft-plugin", - "version": "3.0.2", + "version": "3.0.3", "keywords": [ "craft", "cms", @@ -31,7 +31,7 @@ "extra": { "name": "Odds & Ends", "handle": "tools", - "schemaVersion": "3.0.0", + "schemaVersion": "3.0.3", "hasCpSettings": false, "hasCpSection": false, "changelogUrl": "https://raw.githubusercontent.com/spicywebau/craft-odds-and-ends/master/CHANGELOG.md", diff --git a/src/Tools.php b/src/Tools.php index 93a205c..b60a069 100755 --- a/src/Tools.php +++ b/src/Tools.php @@ -41,6 +41,11 @@ class Tools extends Plugin */ public static $plugin; + /** + * @inheritdoc + */ + public string $schemaVersion = '3.0.3'; + /** * @inheritdoc */ diff --git a/src/migrations/m230911_000000_supercool_fields_migration.php b/src/migrations/m230911_000000_supercool_fields_migration.php new file mode 100644 index 0000000..1ea50ca --- /dev/null +++ b/src/migrations/m230911_000000_supercool_fields_migration.php @@ -0,0 +1,50 @@ +update('{{%fields}}', ['type' => Ancestors::class], ['type' => 'supercool\tools\fields\Ancestors']); + $this->update('{{%fields}}', ['type' => AuthorInstructions::class], ['type' => 'supercool\tools\fields\AuthorInstructions']); + $this->update('{{%fields}}', ['type' => CategoriesMultipleGroups::class], ['type' => 'supercool\tools\fields\CategoriesMultipleGroups']); + $this->update('{{%fields}}', ['type' => CategoriesSearch::class], ['type' => 'supercool\tools\fields\CategoriesSearch']); + $this->update('{{%fields}}', ['type' => DisabledCategories::class], ['type' => 'supercool\tools\fields\DisabledCategories']); + $this->update('{{%fields}}', ['type' => DisabledDropdown::class], ['type' => 'supercool\tools\fields\DisabledDropdown']); + $this->update('{{%fields}}', ['type' => DisabledEntries::class], ['type' => 'supercool\tools\fields\DisabledEntries']); + $this->update('{{%fields}}', ['type' => DisabledLightswitch::class], ['type' => 'supercool\tools\fields\DisabledLightswitch']); + $this->update('{{%fields}}', ['type' => DisabledNumber::class], ['type' => 'supercool\tools\fields\DisabledNumber']); + $this->update('{{%fields}}', ['type' => DisabledPlainText::class], ['type' => 'supercool\tools\fields\DisabledPlainText']); + $this->update('{{%fields}}', ['type' => EntriesSearch::class], ['type' => 'supercool\tools\fields\EntriesSearch']); + $this->update('{{%fields}}', ['type' => Grid::class], ['type' => 'supercool\tools\fields\Grid']); + $this->update('{{%fields}}', ['type' => Width::class], ['type' => 'supercool\tools\fields\Width']); + + return true; + } + + public function safeDown(): bool + { + echo "m230911_000000_supercool_fields_migration cannot be reverted.\n"; + return false; + } +} From b4b364311797c586cffbf41febcdcc182332b4e5 Mon Sep 17 00:00:00 2001 From: Thomas Templeton Date: Thu, 14 Sep 2023 17:42:06 +1000 Subject: [PATCH 2/2] Release 3.0.3 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc9b1f1..bd5ec05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 3.0.3 - 2023-09-14 + +### Fixed +- Fixed a bug where fields from version 2.x wouldn't be migrated on projects that aren't using the project config (thanks @jamie-s-white) + ## 3.0.2 - 2022-10-20 ### Fixed