From 03d1da0d5d3c06b4bc1770f8f0dc08642b87f100 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 11 Jul 2013 13:56:25 +0200 Subject: [PATCH] Added SQL update --- com.woltlab.wcf/update_b5.sql | 4 ++++ wcfsetup/install/files/acp/update_b5.php | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 wcfsetup/install/files/acp/update_b5.php diff --git a/com.woltlab.wcf/update_b5.sql b/com.woltlab.wcf/update_b5.sql index 06527d4146..da099a3253 100644 --- a/com.woltlab.wcf/update_b5.sql +++ b/com.woltlab.wcf/update_b5.sql @@ -1,2 +1,6 @@ /* 83689a3 */ ALTER TABLE wcf1_user_group_option DROP COLUMN adminDefaultValue; + +/* a16ee11 */ +DROP TABLE wcf1_user_activity_point_event; +ALTER TABLE wcf1_user_activity_point ADD items INT(10) NOT NULL DEFAULT '0'; \ No newline at end of file diff --git a/wcfsetup/install/files/acp/update_b5.php b/wcfsetup/install/files/acp/update_b5.php new file mode 100644 index 0000000000..739ba8cd3d --- /dev/null +++ b/wcfsetup/install/files/acp/update_b5.php @@ -0,0 +1,20 @@ +prepareStatement($sql); + +foreach (ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.user.activityPointEvent') as $objectType) { + // prevent division by zero + if (!$objectType->points) { + continue; + } + + $statement->execute(array( + $objectType->points, + $objectType->objectTypeID + )); +} -- 2.20.1