From f5ccdd67d817029022a09a3593ff19e6e240c801 Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Tue, 20 Jan 2009 18:59:03 +0100 Subject: [PATCH] [svn r17869] logic changes-added table messages_invitation - (partial FS#3471) --- main/install/dokeos_main.sql | 19 ++++++++++++++++++- main/install/migrate-db-1.8.5-1.8.6-pre.sql | 5 +++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/main/install/dokeos_main.sql b/main/install/dokeos_main.sql index 972733e31b..415e518d04 100644 --- a/main/install/dokeos_main.sql +++ b/main/install/dokeos_main.sql @@ -1235,4 +1235,21 @@ CREATE TABLE user_api_key ( api_service char(10) NOT NULL default 'dokeos', PRIMARY KEY (id) ); -ALTER TABLE user_api_key ADD INDEX idx_user_api_keys_user (user_id); \ No newline at end of file +ALTER TABLE user_api_key ADD INDEX idx_user_api_keys_user (user_id); +-- +-- Table structure for table messages_invitation +-- +CREATE TABLE messages_invitation( + id bigint unsigned not null auto_increment, + user_sender_id int unsigned not null, + user_receiver_id int unsigned not null, + msg_status tinyint not null default 0, -- 0 read, 1 unread, 5 pending invitation, 6 accepted invitation, 7 invitacion denegada + send_date int, + title varchar(255) not null, + content text not null, + PRIMARY KEY(id) +); +ALTER TABLE messages_invitation ADD INDEX idx_messages_invitation_user_sender(user_sender_id); +ALTER TABLE messages_invitation ADD INDEX idx_messages_invitation_user_receiver(user_receiver_id); +ALTER TABLE messages_invitation ADD INDEX idx_messages_invitation_user_sender_user_receiver(user_sender_id,user_receiver_id); +ALTER TABLE messages_invitation ADD INDEX idx_messages_invitation_msg_status(msg_status); \ No newline at end of file diff --git a/main/install/migrate-db-1.8.5-1.8.6-pre.sql b/main/install/migrate-db-1.8.5-1.8.6-pre.sql index c7a60954df..4321203009 100644 --- a/main/install/migrate-db-1.8.5-1.8.6-pre.sql +++ b/main/install/migrate-db-1.8.5-1.8.6-pre.sql @@ -70,6 +70,11 @@ ALTER TABLE user_friend ADD INDEX idx_user_friend_user_friend_user(user_id,frien CREATE TABLE user_friend_relation_type(id int unsigned not null auto_increment,title char(20),PRIMARY KEY(id)); CREATE TABLE user_api_key (id int unsigned NOT NULL auto_increment, user_id int unsigned NOT NULL, api_key char(32) NOT NULL, api_service char(10) NOT NULL default 'dokeos', PRIMARY KEY (id)); ALTER TABLE user_api_key ADD INDEX idx_user_api_keys_user (user_id); +CREATE TABLE messages_invitation(id bigint unsigned not null auto_increment,user_sender_id int unsigned not null,user_receiver_id int unsigned not null,msg_status tinyint not null default 0,send_date int,title varchar(255) not null,content text not null,primary key(id)); +ALTER TABLE messages_invitation ADD INDEX idx_messages_invitation_user_sender(user_sender_id); +ALTER TABLE messages_invitation ADD INDEX idx_messages_invitation_user_receiver(user_receiver_id); +ALTER TABLE messages_invitation ADD INDEX idx_messages_invitation_user_sender_user_receiver(user_sender_id,user_receiver_id); +ALTER TABLE messages_invitation ADD INDEX idx_messages_invitation_msg_status(msg_status); UPDATE settings_current SET access_url_changeable = 1 WHERE variable='Institution'; UPDATE settings_current SET access_url_changeable = 1 WHERE variable='InstitutionUrl';