aboutsummaryrefslogtreecommitdiffstats
path: root/install/db/83-database.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2009-06-26 09:57:28 +0000
committerrub <rub@piwigo.org>2009-06-26 09:57:28 +0000
commit73680f6348954359cef534cf5fc7e7a21c0b7de4 (patch)
tree71d976051a7f41c78bf29fa7a4075da8244a984b /install/db/83-database.php
parent533ee5120d4a4c18751e6393745ec8d5e6fd88b5 (diff)
Feature 1026: Update column save author_id with value
Check user with comment date and registration date git-svn-id: http://piwigo.org/svn/trunk@3464 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--install/db/83-database.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/install/db/83-database.php b/install/db/83-database.php
index 1f67811ab..94dbc4594 100644
--- a/install/db/83-database.php
+++ b/install/db/83-database.php
@@ -29,9 +29,16 @@ if (!defined('PHPWG_ROOT_PATH'))
$upgrade_description = 'Update column save author_id with value.';
$query = '
-UPDATE '.COMMENTS_TABLE.' AS c , '.USERS_TABLE.' AS u
+UPDATE
+ '.COMMENTS_TABLE.' AS c ,
+ '.USERS_TABLE.' AS u,
+ '.USER_INFOS_TABLE.' AS i
SET c.author_id = u.'.$conf['user_fields']['id'].'
-WHERE c.author = u.'.$conf['user_fields']['username'].' AND c.author_id is null
+WHERE
+ c.author_id is null
+AND c.author = u.'.$conf['user_fields']['username'].'
+AND u.'.$conf['user_fields']['id'].' = i.user_id
+AND i.registration_date <= c.date
;';
pwg_query($query);