Skip to content

Commit

Permalink
Feature 1026: Update column save author_id with value
Browse files Browse the repository at this point in the history
Check user with comment date and registration date


git-svn-id: http://piwigo.org/svn/trunk@3464 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rub committed Jun 26, 2009
1 parent 533ee51 commit 73680f6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions install/db/83-database.php
Expand Up @@ -29,9 +29,16 @@
$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);
Expand Down

0 comments on commit 73680f6

Please sign in to comment.