diff options
-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; } |