Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- phpMyAdmin SQL Dump
- -- version 3.5.1
- -- http://www.phpmyadmin.net
- --
- -- Host: localhost
- -- Generation Time: Sep 22, 2012 at 09:06 PM
- -- Server version: 5.5.24-log
- -- PHP Version: 5.3.13
- SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
- SET time_zone = "+00:00";
- --
- -- Database: `dbtest`
- --
- -- --------------------------------------------------------
- --
- -- Table structure for table `tbl_answer`
- --
- CREATE TABLE IF NOT EXISTS `tbl_answer` (
- `question_id` INT(11) DEFAULT NULL,
- `answer` longtext,
- `brainded` INT(11) DEFAULT NULL,
- `create_user_id` INT(11) NOT NULL,
- `create_time` datetime NOT NULL,
- `update_time` datetime DEFAULT NULL,
- KEY `fk_tbl_answer_tbl_question` (`question_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
- -- --------------------------------------------------------
- --
- -- Table structure for table `tbl_profile`
- --
- CREATE TABLE IF NOT EXISTS `tbl_profile` (
- `user_id` INT(11) NOT NULL,
- `first_name` VARCHAR(80) DEFAULT NULL,
- `last_name` VARCHAR(80) DEFAULT NULL,
- `birthday` TIMESTAMP NULL DEFAULT NULL,
- `description` text,
- `fb_educationJson` longtext,
- `fb_workJson` longtext,
- `picture` VARCHAR(256) DEFAULT NULL,
- `sex` tinyint(1) DEFAULT NULL,
- `city` VARCHAR(80) DEFAULT NULL,
- `country` VARCHAR(80) DEFAULT NULL,
- `language` VARCHAR(80) DEFAULT NULL,
- `time_online` INT(11) DEFAULT NULL,
- `create_time` TIMESTAMP NULL DEFAULT NULL,
- `update_time` TIMESTAMP NULL DEFAULT NULL,
- `fb_updated_time` TIMESTAMP NULL DEFAULT NULL,
- `fb_verified` tinyint(1) DEFAULT NULL,
- PRIMARY KEY (`user_id`),
- KEY `fk_tbl_profile_tbl_user` (`user_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- -- --------------------------------------------------------
- --
- -- Table structure for table `tbl_question`
- --
- CREATE TABLE IF NOT EXISTS `tbl_question` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `title` VARCHAR(128) NOT NULL,
- `type` INT(11) NOT NULL,
- `choice_answer` longtext NOT NULL,
- `description` longtext,
- `tag` text,
- `best_answer_id` INT(11) DEFAULT NULL,
- `create_user_id` INT(11) DEFAULT NULL,
- `create_time` datetime DEFAULT NULL,
- `update_time` datetime DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `fk_tbl_question_tbl_user` (`create_user_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
- -- --------------------------------------------------------
- --
- -- Table structure for table `tbl_question_stats`
- --
- CREATE TABLE IF NOT EXISTS `tbl_question_stats` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `question_id` INT(11) NOT NULL,
- `user_id` INT(11) DEFAULT NULL,
- `user_ip` VARCHAR(30) DEFAULT NULL,
- `view_referrer` VARCHAR(255) DEFAULT NULL,
- `view_date` datetime DEFAULT NULL,
- `time_in` INT(11) DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `fk_tbl_question_stats_tbl_question` (`question_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
- -- --------------------------------------------------------
- --
- -- Table structure for table `tbl_user`
- --
- CREATE TABLE IF NOT EXISTS `tbl_user` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `fbId` INT(11) NOT NULL,
- `email` VARCHAR(256) DEFAULT NULL,
- `username` VARCHAR(45) DEFAULT NULL,
- `password` VARCHAR(256) DEFAULT NULL,
- `last_login_time` datetime DEFAULT NULL,
- `create_time` datetime DEFAULT NULL,
- `create_user_id` INT(11) DEFAULT NULL,
- `update_time` datetime DEFAULT NULL,
- `update_user_id` INT(11) DEFAULT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;
- --
- -- Constraints for dumped tables
- --
- --
- -- Constraints for table `tbl_answer`
- --
- ALTER TABLE `tbl_answer`
- ADD CONSTRAINT `fk_tbl_answer_tbl_question` FOREIGN KEY (`question_id`) REFERENCES `tbl_question` (`id`) ON DELETE CASCADE;
- --
- -- Constraints for table `tbl_profile`
- --
- ALTER TABLE `tbl_profile`
- ADD CONSTRAINT `fk_tbl_profile_tbl_user` FOREIGN KEY (`user_id`) REFERENCES `tbl_user` (`id`) ON DELETE CASCADE;
- --
- -- Constraints for table `tbl_question`
- --
- ALTER TABLE `tbl_question`
- ADD CONSTRAINT `fk_tbl_question_tbl_user` FOREIGN KEY (`create_user_id`) REFERENCES `tbl_user` (`id`) ON DELETE CASCADE;
- --
- -- Constraints for table `tbl_question_stats`
- --
- ALTER TABLE `tbl_question_stats`
- ADD CONSTRAINT `fk_tbl_question_stats_tbl_question` FOREIGN KEY (`question_id`) REFERENCES `tbl_question` (`id`) ON DELETE CASCADE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement