Skip to content

Commit

Permalink
Fix migration for MariaDB
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Aug 15, 2024
1 parent 3b5b233 commit fc8e7e2
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 32 deletions.
64 changes: 45 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes for Blitz

## 5.6.3 - 2024-08-15

### Fixed

- Fixed an exception that could be thrown during updating when using MariaDB ([#693](https://github.com/putyourlightson/craft-blitz/issues/693)).

## 5.6.2 - 2024-08-05

### Fixed
Expand All @@ -21,13 +27,15 @@
### Added

- Added a sidebar panel to element edit pages ([#690](https://github.com/putyourlightson/craft-blitz/issues/690)).
- Added a `dateCached` column to cache records which is output in the sidebar panel and the Blitz Diagnostics utility.
- Added a
`dateCached` column to cache records which is output in the sidebar panel and the Blitz Diagnostics utility.
- Added the ability to track eager-loaded relation fields nested inside matrix blocks ([#657](https://github.com/putyourlightson/craft-blitz/issues/657)).
- Added a structure view to tracked nested element pages in the Blitz Diagnostics utility.

### Changed

- The `craft.blitz.csrfInput()`, `craft.blitz.csrfParam()` and `craft.blitz.csrfToken()` functions now output inline values rather than inject scripts when called via AJAX requests.
- The `craft.blitz.csrfInput()`, `craft.blitz.csrfParam()` and
`craft.blitz.csrfToken()` functions now output inline values rather than inject scripts when called via AJAX requests.
- The Commerce integration now only refreshes product variants if their inventory is tracked.

## 5.5.1 - 2024-07-23
Expand Down Expand Up @@ -80,7 +88,9 @@

### Fixed

- Fixed a bug in which the priority of refresh cache and driver jobs was interpreted as `0` when set to `null` ([#655](https://github.com/putyourlightson/craft-blitz/issues/655)).
- Fixed a bug in which the priority of refresh cache and driver jobs was interpreted as
`0` when set to
`null` ([#655](https://github.com/putyourlightson/craft-blitz/issues/655)).
- Fixed an issue in which the priority of batch jobs could be a negative number and therefore jobs would never complete.

## 5.3.2 - 2024-06-18
Expand Down Expand Up @@ -118,7 +128,8 @@

### Fixed

- Fixed the check for whether the `blitz/cache/refresh-expired` console command was executed within the past 24 hours.
- Fixed the check for whether the
`blitz/cache/refresh-expired` console command was executed within the past 24 hours.
- Fixed diagnostics notifications in the control panel.
- Fixed the detection of lazy eager-loaded queries.
- Fixed tracking of some element query attributes.
Expand All @@ -145,7 +156,8 @@

### Changed

The `blitz/cache/refresh-cache-tags` and `blitz/cache/refresh-expired-elements` no longer forcibly generate the cache.
The `blitz/cache/refresh-cache-tags` and
`blitz/cache/refresh-expired-elements` no longer forcibly generate the cache.

## 5.1.3 - 2024-04-13

Expand Down Expand Up @@ -186,29 +198,43 @@ The `blitz/cache/refresh-cache-tags` and `blitz/cache/refresh-expired-elements`
### Added

- Added compatibility with Craft 5.
- Added suggesting the use of the `eagerly()` function to lazy-loaded element queries in the Blitz Hints utility.
- Added suggesting the use of the
`eagerly()` function to lazy-loaded element queries in the Blitz Hints utility.

### Changed

- The Blitz Hints utility is now powered by Sprig, no longer tracks route variable hints and no longer requires an external package.

### Removed

- Removed the `craft.blitz.getTemplate()` template variable. Use `craft.blitz.includeCached()` or `craft.blitz.includeDynamic()` instead.
- Removed the `craft.blitz.getUri()` template variable. Use `craft.blitz.fetchUri()` instead.
- Removed the `craft.blitz.getTemplate()` template variable. Use
`craft.blitz.includeCached()` or `craft.blitz.includeDynamic()` instead.
- Removed the `craft.blitz.getUri()` template variable. Use
`craft.blitz.fetchUri()` instead.
- Removed the `blitz/templates/get` controller action.
- Removed the `cacheElements` config setting. Use `trackElements` instead.
- Removed the `cacheElementQueries` config setting. Use `trackElementQueries` instead.
- Removed the `craft.blitz.options.cacheElements()` template variable. Use `craft.blitz.options.trackElements()` instead.
- Removed the `craft.blitz.options.cacheElementQueries()` template variable. Use `craft.blitz.options.trackElementQueries()` instead.
- Removed the `cacheElementQueries` config setting. Use
`trackElementQueries` instead.
- Removed the `craft.blitz.options.cacheElements()` template variable. Use
`craft.blitz.options.trackElements()` instead.
- Removed the `craft.blitz.options.cacheElementQueries()` template variable. Use
`craft.blitz.options.trackElementQueries()` instead.
- Removed the `createGzipFiles` setting.
- Removed the `createBrotliFiles` setting.
- Removed the `BlitzVariable::CACHED_INCLUDE_ACTION` constant. Use `CacheRequestService::CACHED_INCLUDE_ACTION` instead.
- Removed the `BlitzVariable::DYNAMIC_INCLUDE_ACTION` constant. Use `CacheRequestService::DYNAMIC_INCLUDE_ACTION` instead.
- Removed the `BlitzVariable::CACHED_INCLUDE_ACTION` constant. Use
`CacheRequestService::CACHED_INCLUDE_ACTION` instead.
- Removed the `BlitzVariable::DYNAMIC_INCLUDE_ACTION` constant. Use
`CacheRequestService::DYNAMIC_INCLUDE_ACTION` instead.
- Removed the `ElementTypeHelper::LIVE_STATUSES` constant.
- Removed the `SettingsModel::clearOnRefresh` method. Use `SettingsModel::shouldClearOnRefresh` instead.
- Removed the `SettingsModel::expireOnRefresh` method. Use `SettingsModel::shouldExpireOnRefresh` instead.
- Removed the `SettingsModel::generateOnRefresh` method. Use `SettingsModel::shouldGenerateOnRefresh` instead.
- Removed the `SettingsModel::purgeAfterRefresh` method. Use `SettingsModel::shouldPurgeAfterRefresh` instead.
- Removed the `SettingsModel::generatePageBasedOnQueryString` method. Use `SettingsModel::shouldGeneratePageBasedOnQueryString` instead.
- Removed the `SettingsModel::purgeAssetImages` method. Use `SettingsModel::shouldPurgeAssetImages` instead.
- Removed the `SettingsModel::clearOnRefresh` method. Use
`SettingsModel::shouldClearOnRefresh` instead.
- Removed the `SettingsModel::expireOnRefresh` method. Use
`SettingsModel::shouldExpireOnRefresh` instead.
- Removed the `SettingsModel::generateOnRefresh` method. Use
`SettingsModel::shouldGenerateOnRefresh` instead.
- Removed the `SettingsModel::purgeAfterRefresh` method. Use
`SettingsModel::shouldPurgeAfterRefresh` instead.
- Removed the `SettingsModel::generatePageBasedOnQueryString` method. Use
`SettingsModel::shouldGeneratePageBasedOnQueryString` instead.
- Removed the `SettingsModel::purgeAssetImages` method. Use
`SettingsModel::shouldPurgeAssetImages` instead.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-blitz",
"description": "Intelligent static page caching for creating lightning-fast sites.",
"version": "5.6.2",
"version": "5.6.3",
"type": "craft-plugin",
"homepage": "https://putyourlightson.com/plugins/blitz",
"license": "proprietary",
Expand Down
25 changes: 13 additions & 12 deletions src/migrations/m240709_120000_add_fieldinstanceuid_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ class m240709_120000_add_fieldinstanceuid_column extends Migration
*/
public function safeUp(): bool
{
if ($this->db->columnExists(ElementFieldCacheRecord::tableName(), 'fieldId')) {
ElementFieldCacheRecord::deleteAll();
$this->dropForeignKeyIfExists(ElementFieldCacheRecord::tableName(), 'fieldId');
$this->dropColumn(ElementFieldCacheRecord::tableName(), 'fieldId');
$this->addColumn(ElementFieldCacheRecord::tableName(), 'fieldInstanceUid', $this->uid()->after('elementId'));
}
$this->dropTableIfExists(ElementFieldCacheRecord::tableName());
$this->createTable(ElementFieldCacheRecord::tableName(), [
'cacheId' => $this->integer()->notNull(),
'elementId' => $this->integer()->notNull(),
'fieldInstanceUid' => $this->uid(),
'PRIMARY KEY([[cacheId]], [[elementId]], [[fieldInstanceUid]])',
]);

if ($this->db->columnExists(ElementQueryFieldRecord::tableName(), 'fieldId')) {
ElementQueryFieldRecord::deleteAll();
$this->dropForeignKeyIfExists(ElementQueryFieldRecord::tableName(), 'fieldId');
$this->dropColumn(ElementQueryFieldRecord::tableName(), 'fieldId');
$this->addColumn(ElementQueryFieldRecord::tableName(), 'fieldInstanceUid', $this->uid()->after('queryId'));
}
$this->dropTableIfExists(ElementQueryFieldRecord::tableName());
$this->createTable(ElementQueryFieldRecord::tableName(), [
'queryId' => $this->integer()->notNull(),
'fieldInstanceUid' => $this->uid(),
'PRIMARY KEY([[queryId]], [[fieldInstanceUid]])',
]);

return true;
}
Expand Down

0 comments on commit fc8e7e2

Please sign in to comment.