From 1b449ea7050925792d49ac3b7802c73243269ba9 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 27 Nov 2014 14:46:10 +0100 Subject: [PATCH] scripts/upgrade.php would fail if Profile_prefs did not exist A checkschema.php run would've done it, but that would require an additional step to our upgrade procedure. --- plugins/Favorite/FavoritePlugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/Favorite/FavoritePlugin.php b/plugins/Favorite/FavoritePlugin.php index a9a95f80cc..017b78d8b9 100644 --- a/plugins/Favorite/FavoritePlugin.php +++ b/plugins/Favorite/FavoritePlugin.php @@ -59,6 +59,10 @@ class FavoritePlugin extends ActivityHandlerPlugin $user->whereAdd('emailnotifyfav IS NOT NULL'); if ($user->find()) { printfnq("Detected old User table (emailnotifyfav IS NOT NULL). Moving 'emailnotifyfav' property to Profile_prefs..."); + // First we'll make sure Profile_prefs exists + $schema = Schema::get(); + $schema->ensureTable('profile_prefs', Profile_prefs::schemaDef()); + // Make sure we have our own tables setup properly while ($user->fetch()) { $user->setPref('email', 'notify_fave', $user->emailnotifyfav); -- 2.39.5