-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Počítač: localhost
-- Vygenerováno: Čtv 07. čen 2012, 14:07
-- Verze MySQL: 5.5.16
-- Verze PHP: 5.3.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;


--
-- Databáze: `dxsock`
--
CREATE DATABASE `dxsock` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `dxsock`;

-- --------------------------------------------------------

--
-- Struktura tabulky `accounts`
--

CREATE TABLE IF NOT EXISTS `accounts` (
  `name` text NOT NULL COMMENT 'Name of the client',
  `surname` text NOT NULL COMMENT 'Surname of the client',
  `nickname` text NOT NULL COMMENT 'Nickname of the client',
  `password` text NOT NULL COMMENT 'Password of the client',
  `city` text NOT NULL COMMENT 'City of the client',
  `country` text NOT NULL COMMENT 'Country of the client',
  `age` text NOT NULL COMMENT 'Age of the client',
  `gender` text NOT NULL COMMENT 'Gender of the client',
  `gravatar` text NOT NULL COMMENT 'Gravatar image link',
  UNIQUE KEY `nickname_index` (`nickname`(9))
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Struktura tabulky `buddylist`
--

CREATE TABLE IF NOT EXISTS `buddylist` (
  `client_name` text NOT NULL COMMENT 'Client one name',
  `friend_name` text NOT NULL COMMENT 'Client two name'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Struktura tabulky `events`
--

CREATE TABLE IF NOT EXISTS `events` (
  `id` int(100) NOT NULL AUTO_INCREMENT COMMENT 'Just id counter',
  `client_name` text NOT NULL COMMENT 'Client name',
  `req_client` text NOT NULL COMMENT 'Requesting client name',
  `opcode` text NOT NULL COMMENT 'Opcode signal',
  KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

--
-- Struktura tabulky `messages`
--

CREATE TABLE IF NOT EXISTS `messages` (
  `member_one` text NOT NULL COMMENT 'Name of member one',
  `member_two` text NOT NULL COMMENT 'Name of member two',
  `message` text NOT NULL COMMENT 'Text of the message',
  `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Message time stamp',
  `member_one_received` int(10) NOT NULL COMMENT 'Bool if received for first',
  `member_two_received` int(10) NOT NULL COMMENT 'Bool if received for second'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Stores messages history';