Browse Source

[svn r17743] logic changes-it was added table user_friend and user_friend_relation_type-(see FS#3471)

Isaac Flores 16 years ago
parent
commit
c9f78b03c8
2 changed files with 31 additions and 2 deletions
  1. 25 0
      main/install/dokeos_main.sql
  2. 6 2
      main/install/migrate-db-1.8.5-1.8.6-pre.sql

+ 25 - 0
main/install/dokeos_main.sql

@@ -64,6 +64,31 @@ INSERT INTO user (lastname, firstname, username, password, auth_source, email, s
 UNLOCK TABLES;
 /*!40000 ALTER TABLE user ENABLE KEYS */;
 
+--
+-- Table structure for table user_friend
+--
+CREATE TABLE user_friend(
+  id bigint unsigned not null auto_increment,
+  user_id int unsigned not null,
+  friend_user_id int unsigned not null,
+  relation_type int not null default 0,
+  PRIMARY KEY(id)
+);
+
+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);
+
+--
+-- Table structure for table user_friend_relation_type
+--
+CREATE TABLE user_friend_relation_type(
+  id int unsigned not null auto_increment,
+  title char(20),
+  PRIMARY KEY(id)
+);
+
+
 --
 -- Table structure for table admin
 --

+ 6 - 2
main/install/migrate-db-1.8.5-1.8.6-pre.sql

@@ -61,9 +61,13 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_rese
 INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_reservation', 'false', 'No');
 CREATE TABLE access_url_rel_user (access_url_id int unsigned NOT NULL, user_id int unsigned NOT NULL, PRIMARY KEY (access_url_id, user_id));
 INSERT INTO access_url_rel_user(access_url_id, user_id) VALUES (1,1);
+CREATE TABLE user_friend(id bigint unsigned not null auto_increment,user_id int unsigned not null,friend_user_id int unsigned not null,relation_type int not null default 0,PRIMARY KEY(id));
+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);
+CREATE TABLE user_friend_relation_type(id int unsigned not null auto_increment,title char(20),PRIMARY KEY(id));
 
- 
-
+ 
 -- xxSTATSxx
 ALTER TABLE track_e_exercices ADD status varchar(20) NOT NULL default '';
 ALTER TABLE track_e_exercices ADD data_tracking text NOT NULL default '';