--
-- Host: localhost    Database: linuxbg
---------------------------------------------------------

--
-- Table structure for table 'IM_EVENT'
--

CREATE TABLE IM_EVENT (
  ID int(11) NOT NULL auto_increment,
  ENC varchar(20) NULL, 
  TYPE char(3) NOT NULL default '',
  FROM_USR varchar(255) default NULL,
  TO_USR varchar(255) default NULL,
  CMD varchar(255) NOT NULL default '',
  EXPIRE datetime NOT NULL default '0000-00-00 00:00:00',
  DATE datetime NOT NULL default '0000-00-00 00:00:00',
  attr longtext,
  NEW char(1) NOT NULL default 'Y',
  PRIMARY KEY  (ID)
) TYPE=MyISAM;

--
-- Table structure for table 'IM_ROOM_EVENT'
--

CREATE TABLE IM_ROOM_EVENT (
  id int(11) NOT NULL auto_increment,
  room int(11) NOT NULL default '0',
  usr int(11) NOT NULL default '0',
  date datetime default NULL,
  cmd varchar(255) default NULL,
  type varchar(255) default NULL,
  attr text,
  PRIMARY KEY  (id)
) TYPE=MyISAM;

--
-- Table structure for table 'IM_ROOM_SESS'
--

CREATE TABLE IM_ROOM_SESS (
  room int(11) NOT NULL default '0',
  usr int(11) NOT NULL default '0',
  joined datetime default NULL,
  color varchar(6) default NULL,
  update_period int(2) default NULL,
  name varchar(255) default NULL,
  last_active datetime default NULL,
  in_box int(2) default '0',
  status char(1) default '',
  UNIQUE KEY room (room,usr)
) TYPE=MyISAM;

--
-- Table structure for table 'IM_SESS'
--

CREATE TABLE IM_SESS (
  ID varchar(40) NOT NULL default '',
  USR int(11) default NULL,
  CREATED datetime default NULL,
  LASTACTION datetime default NULL,
  IN_BOX int(2) default NULL,
  USR_PERMISSION int(1) NOT NULL default '0',
  USER_AGENT varchar(255) default NULL,
  STAT char(3) default NULL,
  PRIMARY KEY  (ID)
) TYPE=MyISAM;

--
-- Table structure for table 'IM_USER_USER'
--

CREATE TABLE IM_USER_USER (
  owner_id int(11) default NULL,
  user_id int(11) default NULL,
  name varchar(255) default NULL,
  xbit char(2) default NULL,
  id int(11) NOT NULL auto_increment,
  PRIMARY KEY  (id)
) TYPE=MyISAM;

--
-- Table structure for table 'IM_USR_GROUP'
--

CREATE TABLE IM_USR_GROUP (
  id int(11) NOT NULL auto_increment,
  name varchar(50) default NULL,
  description varchar(255) default NULL,
  user_list varchar(255) default NULL,
  deletable char(1) default 'Y',
  position int(2) default NULL,
  visible char(1) default NULL,
  usr int(11) NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM;

--
-- Table structure for table 'IM_USR_SETUP'
--

CREATE TABLE IM_USR_SETUP (
  usr int(11) NOT NULL default '0',
  name varchar(50) NOT NULL default '',
  value varchar(255) default NULL,
  UNIQUE KEY usr (usr,name)
) TYPE=MyISAM;