From: Stéphane Jacob Date: Tue, 2 Mar 2010 09:43:39 +0000 (+0100) Subject: Renames uid to pid in watch_profile table. X-Git-Tag: xorg/1.0.0~332^2~129 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=bf0e2a48bcd7b971d1afb6ce60bdd7a95b34000a;p=platal.git Renames uid to pid in watch_profile table. Signed-off-by: Stéphane Jacob --- diff --git a/include/notifs.inc.php b/include/notifs.inc.php index cda21a1..3e67658 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -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 { diff --git a/upgrade/account/20_naming_convention.sql b/upgrade/account/20_naming_convention.sql index 5ef1dad..a1946ae 100644 --- a/upgrade/account/20_naming_convention.sql +++ b/upgrade/account/20_naming_convention.sql @@ -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: