3.12.0-b1.php
5 years ago
3.12.0-b7.php
5 years ago
4.0.0-b1.php
4 years ago
4.0.0-b3.php
4 years ago
4.0.0-rc3.php
4 years ago
4.0.0-rc4.php
4 years ago
4.0.1-b1.php
4 years ago
4.0.4-b1.php
4 years ago
4.1.2-b1.php
5 years ago
4.1.2-b2.php
4 years ago
4.10.0-b1.php
3 years ago
4.11.0-b1.php
3 years ago
4.11.0-rc2.php
3 years ago
4.12.0-b1.php
3 years ago
4.12.0-b2.php
3 years ago
4.12.0-b3.php
3 years ago
4.12.0-b4.php
3 years ago
4.3.0-b3.php
4 years ago
4.3.0-b4.php
4 years ago
4.3.0-rc2.php
4 years ago
4.4.0-b1.php
4 years ago
4.5.0-b1.php
4 years ago
4.6.0-b1.php
4 years ago
4.6.0-b4.php
4 years ago
4.6.2-rc2.php
4 years ago
4.7.0-b2.php
4 years ago
4.7.1-b1.php
4 years ago
5.0.0-b1.php
4 years ago
4.7.1-b1.php
58 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Matomo - free/libre analytics platform |
| 5 | * |
| 6 | * @link https://matomo.org |
| 7 | * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 8 | * |
| 9 | */ |
| 10 | |
| 11 | namespace Piwik\Updates; |
| 12 | |
| 13 | use Piwik\Updater; |
| 14 | use Piwik\Updates as PiwikUpdates; |
| 15 | use Piwik\Updater\Migration; |
| 16 | use Piwik\Updater\Migration\Factory as MigrationFactory; |
| 17 | |
| 18 | /** |
| 19 | * Update for version 4.7.1-b1 |
| 20 | */ |
| 21 | class Updates_4_7_1_b1 extends PiwikUpdates |
| 22 | { |
| 23 | /** |
| 24 | * @var MigrationFactory |
| 25 | */ |
| 26 | private $migration; |
| 27 | |
| 28 | public function __construct(MigrationFactory $factory) |
| 29 | { |
| 30 | $this->migration = $factory; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Here you can define one or multiple SQL statements that should be executed during the update. |
| 35 | * |
| 36 | * @param Updater $updater |
| 37 | * |
| 38 | * @return Migration[] |
| 39 | */ |
| 40 | public function getMigrations(Updater $updater) |
| 41 | { |
| 42 | $migrations = []; |
| 43 | |
| 44 | $migrations[] = $this->migration->db->changeColumn('changes', 'plugin_name', 'plugin_name', 'VARCHAR(60) NOT NULL'); |
| 45 | |
| 46 | $migrations[] = $this->migration->db->dropIndex('changes', 'unique_plugin_version_title'); |
| 47 | $migrations[] = $this->migration->db->addUniqueKey('changes', ['plugin_name', 'version', 'title(100)'], 'unique_plugin_version_title'); |
| 48 | |
| 49 | return $migrations; |
| 50 | } |
| 51 | |
| 52 | public function doUpdate(Updater $updater) |
| 53 | { |
| 54 | $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); |
| 55 | } |
| 56 | |
| 57 | } |
| 58 |