Adding last_edit field in user_friend table for future purposes

skala
Julio Montoya 16 years ago
parent ad168da3a4
commit 808906672d
  1. 3
      main/inc/lib/social.lib.php
  2. 3
      main/install/dokeos_main.sql
  3. 5
      main/install/migrate-db-1.8.6-1.8.6.1-pre.sql

@ -28,7 +28,8 @@ class UserFriend extends UserManager {
$result = Database::query($sql, __FILE__, __LINE__);
$row = Database :: fetch_array($result, 'ASSOC');
if ($row['count'] == 0) {
$sql_i = 'INSERT INTO ' . $tbl_my_friend . '(friend_user_id,user_id,relation_type)values(' . ((int)$friend_id) . ','.((int)$my_user_id).','.((int)$relation_type).');';
$current_date=date('Y-m-d H:i:s');
$sql_i = 'INSERT INTO ' . $tbl_my_friend . '(friend_user_id,user_id,relation_type,last_edit)values(' . ((int)$friend_id) . ','.((int)$my_user_id).','.((int)$relation_type).',"'.$current_date.'");';
Database::query($sql_i, __FILE__, __LINE__);
} else {
$sql = 'SELECT COUNT(*) as count FROM ' . $tbl_my_friend . ' WHERE friend_user_id=' . ((int)$friend_id) . ' AND user_id='.((int)$my_user_id);

@ -715,7 +715,7 @@ VALUES
('allow_message_tool', NULL, 'radio', 'Tools', 'false', 'AllowMessageToolTitle', 'AllowMessageToolComment', NULL, NULL,0),
('allow_social_tool', NULL, 'radio', 'Tools', 'false', 'AllowSocialToolTitle', 'AllowSocialToolComment', NULL, NULL, 0),
('allow_students_to_browse_courses',NULL,'radio','Platform','true','AllowStudentsToBrowseCoursesTitle','AllowStudentsToBrowseCoursesComment',NULL,NULL, 1),
('dokeos_database_version', NULL, 'textfield', NULL,'1.8.6.1.7940','DokeosDatabaseVersion','',NULL,NULL,0);
('dokeos_database_version', NULL, 'textfield', NULL,'1.8.6.1.7945','DokeosDatabaseVersion','',NULL,NULL,0);
UNLOCK TABLES;
/*!40000 ALTER TABLE settings_current ENABLE KEYS */;
@ -2087,6 +2087,7 @@ CREATE TABLE user_friend(
ALTER TABLE user_friend ADD INDEX idx_user_friend_user (user_id);
ALTER TABLE user_friend ADD INDEX idx_user_friend_friend_user(friend_user_id);
ALTER TABLE user_friend ADD INDEX idx_user_friend_user_friend_user(user_id,friend_user_id);
ALTER TABLE user_friend ADD COLUMN last_edit DATETIME;
--
-- Table structure for table user_friend_relation_type

@ -34,9 +34,8 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('show_tutor
INSERT INTO settings_options (variable, value, display_text) VALUES ('show_tutor_data','false','No');
INSERT INTO settings_options (variable, value, display_text) VALUES ('show_teacher_data','true','Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('show_teacher_data','false','No');
INSERT IGNORE INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable) VALUES ('dokeos_database_version',NULL,'textfield',NULL,'1.8.6.1.7940','DokeosDatabaseVersion','',NULL,NULL,1,0);
INSERT IGNORE INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable) VALUES ('dokeos_database_version',NULL,'textfield',NULL,'1.8.6.1.7945','DokeosDatabaseVersion','',NULL,NULL,1,0);
ALTER TABLE user_friend ADD COLUMN last_edit DATETIME;
-- xxSTATSxx

Loading…
Cancel
Save