/*
SQLyog Community Edition- MySQL GUI v8.03 
MySQL - 5.6.26 : Database - d-chat
*********************************************************************
*/





CREATE DATABASE /*!32312 IF NOT EXISTS*/`DChat` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;

USE `DChat`;

/*Table structure for table `tb_admin` */


CREATE TABLE `tb_admin` (
  `id` int(50) NOT NULL AUTO_INCREMENT,
  `userid` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `pw` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `created_date` datetime NOT NULL,
  `last_login` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `tb_admin` */

insert  into `tb_admin`(`id`,`userid`,`password`,`pw`,`name`,`created_date`,`last_login`) values (1,'admin','$2y$10$ifoLBAI1jmBo5OEFp.iZM.PO.xoFl.lVKdPlYFQmQBuf5kCf885r2','123456','admin','0000-00-00 00:00:00','2015-12-17 12:53:14');

/*Table structure for table `tb_friend` */


CREATE TABLE `tb_friend` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `friend_id` int(11) NOT NULL,
  `status` int(2) NOT NULL DEFAULT '0' COMMENT 'if 0:block friend 1: friend',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `tb_friend` */

/*Table structure for table `tb_user` */


CREATE TABLE `tb_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `email` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `phone_number` varchar(255) NOT NULL,
  `label` varchar(255) NOT NULL,
  `bg_url` varchar(255) NOT NULL,
  `photo_url` varchar(255) NOT NULL,
  `status` int(2) NOT NULL COMMENT 'user status(0:normal, 1:disable,2:removed)',
  `busy` int(2) NOT NULL COMMENT 'is chatting now(0:free,1:chatting)',
  `online` int(2) NOT NULL,
  `auth_code` int(11) NOT NULL,
  `register_success` int(2) NOT NULL,
  `is_auth` int(2) NOT NULL DEFAULT '0',
  `last_login_date` datetime NOT NULL,
  `register_date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8;

/*Data for the table `tb_user` */

