diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-11-27 01:40:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 01:40:03 +0300 |
commit | 1fa10c628c751d43b346a909e68833d26d5c08ff (patch) | |
tree | 70418d5260c654d6923897020fe2682be320ea84 | |
parent | 8417ac09c3aeb8a72f3e432bad954e249c9ca617 (diff) |
Fix hash algo is missing during upgrade (#16816)4.0.1-b1
-rw-r--r-- | core/Updates/4.0.0-b1.php | 3 | ||||
-rw-r--r-- | core/Updates/4.0.1-b1.php | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/core/Updates/4.0.0-b1.php b/core/Updates/4.0.0-b1.php index 5259fb3a9c..780c2d034d 100644 --- a/core/Updates/4.0.0-b1.php +++ b/core/Updates/4.0.0-b1.php @@ -80,7 +80,8 @@ class Updates_4_0_0_b1 extends PiwikUpdates 'login' => $user['login'], 'description' => 'Created by Matomo 4 migration', 'password' => $userModel->hashTokenAuth($user['token_auth']), - 'date_created' => Date::now()->getDatetime() + 'date_created' => Date::now()->getDatetime(), + 'hash_algo' => 'sha512' )); } } diff --git a/core/Updates/4.0.1-b1.php b/core/Updates/4.0.1-b1.php index 3f44780afe..852b3b934b 100644 --- a/core/Updates/4.0.1-b1.php +++ b/core/Updates/4.0.1-b1.php @@ -9,6 +9,7 @@ namespace Piwik\Updates; +use Piwik\Common; use Piwik\Config; use Piwik\Container\StaticContainer; use Piwik\DataAccess\ArchiveTableCreator; @@ -35,6 +36,10 @@ class Updates_4_0_1_b1 extends PiwikUpdates public function getMigrations(Updater $updater) { $migrations = []; + + $table = Common::prefixTable('user_token_auth'); + $migrations[] = $this->migration->db->sql('UPDATE ' . $table . ' SET hash_algo = "sha512" where hash_algo is null or hash_algo = "" '); + if (SettingsPiwik::isGitDeployment()) { return $migrations; } |