From 8c80589b5ab196287788ff385733dec1df005044 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 27 Jan 2014 21:02:57 -0800 Subject: chat data structures --- install/database.sql | 60 +++++++++++++++++++++++++++++++++++++++++++++------- install/update.php | 59 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 109 insertions(+), 10 deletions(-) (limited to 'install') diff --git a/install/database.sql b/install/database.sql index 597124566..1c87b725b 100644 --- a/install/database.sql +++ b/install/database.sql @@ -87,7 +87,7 @@ CREATE TABLE IF NOT EXISTS `attach` ( `aid` int(10) unsigned NOT NULL DEFAULT '0', `uid` int(10) unsigned NOT NULL DEFAULT '0', `hash` char(64) NOT NULL DEFAULT '', - `creator` char(128) NOT NULL DEFAULT '0', + `creator` char(128) NOT NULL DEFAULT '', `filename` char(255) NOT NULL DEFAULT '', `filetype` char(64) NOT NULL DEFAULT '', `filesize` int(10) unsigned NOT NULL DEFAULT '0', @@ -105,7 +105,6 @@ CREATE TABLE IF NOT EXISTS `attach` ( KEY `aid` (`aid`), KEY `uid` (`uid`), KEY `hash` (`hash`), - KEY `creator` (`creator`), KEY `filename` (`filename`), KEY `filetype` (`filetype`), KEY `filesize` (`filesize`), @@ -113,7 +112,8 @@ CREATE TABLE IF NOT EXISTS `attach` ( KEY `edited` (`edited`), KEY `revision` (`revision`), KEY `folder` (`folder`), - KEY `flags` (`flags`) + KEY `flags` (`flags`), + KEY `creator` (`creator`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `auth_codes` ( @@ -214,6 +214,50 @@ CREATE TABLE IF NOT EXISTS `channel` ( KEY `channel_dirdate` (`channel_dirdate`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `chat` ( + `chat_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `chat_room` int(10) unsigned NOT NULL DEFAULT '0', + `chat_xchan` char(255) NOT NULL DEFAULT '', + `chat_text` mediumtext NOT NULL, + `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`chat_id`), + KEY `chat_room` (`chat_room`), + KEY `chat_xchan` (`chat_xchan`), + KEY `created` (`created`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `chatpresence` ( + `cp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `cp_room` int(10) unsigned NOT NULL DEFAULT '0', + `cp_xchan` char(255) NOT NULL DEFAULT '', + `cp_last` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `cp_status` char(255) NOT NULL, + PRIMARY KEY (`cp_id`), + KEY `cp_room` (`cp_room`), + KEY `cp_xchan` (`cp_xchan`), + KEY `cp_last` (`cp_last`), + KEY `cp_status` (`cp_status`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `chatroom` ( + `cr_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `cr_aid` int(10) unsigned NOT NULL DEFAULT '0', + `cr_uid` int(10) unsigned NOT NULL DEFAULT '0', + `cr_name` char(255) NOT NULL DEFAULT '', + `cr_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `cr_edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `allow_cid` mediumtext NOT NULL, + `allow_gid` mediumtext NOT NULL, + `deny_cid` mediumtext NOT NULL, + `deny_gid` mediumtext NOT NULL, + PRIMARY KEY (`cr_id`), + KEY `cr_aid` (`cr_aid`), + KEY `cr_uid` (`cr_uid`), + KEY `cr_name` (`cr_name`), + KEY `cr_created` (`cr_created`), + KEY `cr_edited` (`cr_edited`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `clients` ( `client_id` varchar(20) NOT NULL, `pw` varchar(20) NOT NULL, @@ -596,17 +640,17 @@ CREATE TABLE IF NOT EXISTS `obj` ( `obj_type` int(10) unsigned NOT NULL DEFAULT '0', `obj_obj` char(255) NOT NULL DEFAULT '', `obj_channel` int(10) unsigned NOT NULL DEFAULT '0', - `allow_cid` MEDIUMTEXT NOT NULL DEFAULT '', - `allow_gid` MEDIUMTEXT NOT NULL DEFAULT '', - `deny_cid` MEDIUMTEXT NOT NULL DEFAULT '', - `deny_gid` MEDIUMTEXT NOT NULL DEFAULT '', + `allow_cid` mediumtext NOT NULL, + `allow_gid` mediumtext NOT NULL, + `deny_cid` mediumtext NOT NULL, + `deny_gid` mediumtext NOT NULL, PRIMARY KEY (`obj_id`), KEY `obj_verb` (`obj_verb`), KEY `obj_page` (`obj_page`), KEY `obj_type` (`obj_type`), KEY `obj_channel` (`obj_channel`), KEY `obj_obj` (`obj_obj`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `outq` ( `outq_hash` char(255) NOT NULL, diff --git a/install/update.php b/install/update.php index 3e5589820..9ab5db8c6 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ Date: Tue, 28 Jan 2014 15:05:44 -0800 Subject: add client field to chatpresence - which will give us a place to put IP addresses for webRTC. Might as well allow for that since we'll (soon) have presence. Then we wouldn't need SIP and folks can "just" p2p each other using any mechanism they wish if they have permission to do so. --- install/database.sql | 1 + install/update.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'install') diff --git a/install/database.sql b/install/database.sql index 1c87b725b..dba03da65 100644 --- a/install/database.sql +++ b/install/database.sql @@ -232,6 +232,7 @@ CREATE TABLE IF NOT EXISTS `chatpresence` ( `cp_xchan` char(255) NOT NULL DEFAULT '', `cp_last` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `cp_status` char(255) NOT NULL, + `cp_client` char(128) NOT NULL DEFAULT '', PRIMARY KEY (`cp_id`), KEY `cp_room` (`cp_room`), KEY `cp_xchan` (`cp_xchan`), diff --git a/install/update.php b/install/update.php index 9ab5db8c6..180b8d5a0 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ Date: Wed, 29 Jan 2014 00:08:29 -0800 Subject: basic chatroom management backend --- install/htconfig.sample.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install') diff --git a/install/htconfig.sample.php b/install/htconfig.sample.php index 33258cf41..b23dfe3b6 100755 --- a/install/htconfig.sample.php +++ b/install/htconfig.sample.php @@ -3,7 +3,7 @@ // If automatic system installation fails: // Copy or rename this file to .htconfig.php in the top level -// Friendica directory +// Red Matrix directory // Why .htconfig.php? Because it contains sensitive information which could // give somebody complete control of your database. Apache's default -- cgit v1.2.3