Renames uid to pid in watch_profile table.
authorStéphane Jacob <sj@m4x.org>
Tue, 2 Mar 2010 09:43:39 +0000 (10:43 +0100)
committerStéphane Jacob <sj@m4x.org>
Tue, 2 Mar 2010 10:33:04 +0000 (11:33 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
include/notifs.inc.php
upgrade/account/20_naming_convention.sql

index cda21a1..3e67658 100644 (file)
@@ -69,7 +69,7 @@ class WatchProfileUpdate extends WatchOperation
 
     public static function register(Profile &$profile, $field)
     {
-        XDB::execute('REPLACE INTO  watch_profile (uid, ts, field)
+        XDB::execute('REPLACE INTO  watch_profile (pid, ts, field)
                             VALUES  ({?}, NOW(), {?})',
                      $profile->id(), $field);
     }
@@ -109,11 +109,11 @@ class WatchProfileUpdate extends WatchOperation
                                          'photo'        => 'Sa photographie');
     public function getData(PlUser &$user)
     {
-        $data = XDB::fetchColumn('SELECT  field
+        $data = XDB::fetchColumn("SELECT  field
                                     FROM  watch_profile
-                                   WHERE  uid = {?} AND ts > FROM_UNIXTIME({?}) AND field != \'\'
-                                ORDER BY  ts',
-                                 $user->id(), $this->date);
+                                   WHERE  pid = {?} AND ts > FROM_UNIXTIME({?}) AND field != ''
+                                ORDER BY  ts",
+                                 $user->profile()->id(), $this->date);
         if (count($data) == 0) {
             return null;
         } else {
index 5ef1dad..a1946ae 100644 (file)
@@ -56,4 +56,8 @@ CHANGE COLUMN  user_id uid INT(11) NOT NULL;
   ALTER TABLE  requests_hidden
 CHANGE COLUMN  user_id uid INT(11) NOT NULL;
 
+# watch
+  ALTER TABLE  watch_profile
+CHANGE COLUMN  uid pid INT(11) NOT NULL;
+
 # vim:set ft=mysql: