Summary

latest news

09.03.2007

MOHA Chat 0.1rc1 was released on sourceforge.net.

read more ...

06.03.2007

MOHA Chat 0.1b10 was released on sourceforge.net with PostgreSQL support.

read more ...

sponsors

Advertise here?

other information

Support This Project

Google PageRank

Home
  • docs
  • setting up db

Setting up the database

Print View

If you already have a database, MOHA Chat can use it. MOHA Chat doesn't need a separate database of it's own. If you want MOHA Chat to authenticate users by using existing users table, MOHA Chat tables and users table must be in the same database.

How to create a new database

If you need to create a new database to run MOHA Chat, run the sql commands bellow.

CREATE DATABASE `moha_chat`;

Creating MOHA Chat tables

Run the sql commands bellow. It should create tables required for MOHA Chat to run. For MySQL 4 replace

DEFAULT CHARSET=utf8

with

DEFAULT CHARACTER SET utf8

in sql commands bellow. Bellow sql commands will run without problems in MySQL 5

CREATE TABLE `chat_moha` (
  `ID` int(11) NOT NULL auto_increment,
  `time` bigint(12) default NULL,
  `message` longtext,
  `from` varchar(30) NOT NULL,
  `to` varchar(30) NOT NULL default 'moha',
  `checked` int(1) NOT NULL default '0',
  `postedTime` bigint(12) NOT NULL,
  `flash` smallint(1) NOT NULL,
  PRIMARY KEY  (`ID`),
  KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;


CREATE TABLE `chat_moha_archive` (
  `ID` int(11) NOT NULL,
  `time` bigint(12) NOT NULL,
  `message` longtext NOT NULL,
  `from` varchar(30) NOT NULL,
  `to` varchar(30) NOT NULL,
  `checked` int(1) NOT NULL,
  `postedTime` bigint(12) NOT NULL,
  `flash` smallint(1) NOT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=utf8;


CREATE TABLE `chat_moha_buddy` (
  `UID` varchar(50) NOT NULL,
  `BID` varchar(50) NOT NULL,
  `status` tinyint(1) NOT NULL default '0',
  `cust_status` int(1) NOT NULL default '0',
  `cust_status_message` varchar(18) default NULL,
  PRIMARY KEY  (`UID`,`BID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `chat_moha_file_hist` (
  `id` int(11) NOT NULL,
  `content` mediumblob NOT NULL,
  `part` int(11) NOT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=utf8;


CREATE TABLE `chat_moha_file_up` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(50) NOT NULL,
  `mime` varchar(30) NOT NULL,
  `size` int(11) NOT NULL,
  `from` varchar(30) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;


CREATE TABLE `chat_moha_poll` (
  `UID` varchar(50) NOT NULL,
  `time` bigint(12) NOT NULL,
  `cust_status` int(1) NOT NULL default '0',
  `cust_status_message` text,
  PRIMARY KEY  (`UID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Last modified on Monday, 14th September 2015

More sponsors