Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Stark committed Oct 11, 2018
1 parent 1d95c1b commit 8a9107f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [1.4.2] - 2018-10-11
- Backport schema change to initial migration

## [1.4.1] - 2018-09-06
- Fix initialize `$tags` earlier

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ostark/upper",
"description": "A cache plugin for Craft - supporting multiple Edge Caches",
"type": "craft-plugin",
"version": "1.4.1",
"version": "1.4.2",
"keywords": [
"craft",
"cms",
Expand Down
14 changes: 10 additions & 4 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ public function safeUp()

$this->createTable(Plugin::CACHE_TABLE, [
'uid' => $this->string(40)->notNull()->unique(),
'url' => $this->string(255)->notNull(),
'url' => $this->text()->notNull(),
'urlHash' => $this->string(32)->notNull(),
'headers' => $this->text()->defaultValue(null),
'tags' => $this->text()->notNull(),
'siteId' => $this->integer(),
'dateCreated' => $this->dateTime()->notNull(),
'dateUpdated' => $this->dateTime()->null()
]);

$this->createIndex('url_idx', Plugin::CACHE_TABLE, 'url', true);
echo " > Create index: urlhash_idx" . PHP_EOL;
$this->createIndex('urlhash_idx', Plugin::CACHE_TABLE, 'urlHash', true);

$this->execute("ALTER TABLE " . Plugin::CACHE_TABLE . " ADD FULLTEXT INDEX tags_fulltext (tags ASC)");

}
Expand All @@ -38,7 +41,8 @@ public function safeUp()

$this->createTable(Plugin::CACHE_TABLE, [
'uid' => $this->string(40)->notNull()->unique(),
'url' => $this->string(255)->notNull(),
'url' => $this->text()->notNull(),
'urlHash' => $this->string(32)->notNull(),
'headers' => $this->text()->defaultValue(null),
'tags' => 'varchar[]',
'siteId' => $this->integer(),
Expand All @@ -47,7 +51,9 @@ public function safeUp()
'PRIMARY KEY(uid)',
]);

$this->createIndex('url_idx', Plugin::CACHE_TABLE, 'url', true);
echo " > Create index: urlhash_idx" . PHP_EOL;
$this->createIndex('urlhash_idx', Plugin::CACHE_TABLE, 'urlHash', true);

$this->execute("CREATE INDEX tags_array ON " . Plugin::CACHE_TABLE . " USING GIN(tags)");

}
Expand Down

0 comments on commit 8a9107f

Please sign in to comment.