-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 02, 2014 at 01:54 PM
-- Server version: 5.5.27
-- PHP Version: 5.4.7

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 */;

--
-- Database: `rai_socmedcampus`
--

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

--
-- Table structure for table `activities`
--

CREATE TABLE IF NOT EXISTS `activities` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `type` varchar(20) NOT NULL,
  `desciption` varchar(500) NOT NULL,
  `date` date DEFAULT NULL,
  `poster` varchar(40) DEFAULT 'asset/user_file/nophoto2.jpg',
  `community` int(5) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `community` (`community`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `activities`
--

INSERT INTO `activities` (`id`, `name`, `type`, `desciption`, `date`, `poster`, `community`) VALUES
(1, 'afasf', 'riset', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus justo tellus, mollis at nulla a, lacinia vulputate justo. Quisque nec odio ipsum. Praesent consectetur, quam quis sodales vehicula, lorem felis interdum eros, id tincidunt tortor eros nec sapien. Donec orci enim, gravida sed justo a, convallis suscipit lorem. Vivamus tincidunt eu libero sed interdum. Ut commodo, risus in scelerisque dignissim, nibh risus eleifend ipsum', '2014-04-21', 'asset/user_file/1/1.jpg', 1),
(2, 'Abcd', 'Event', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus justo tellus, mollis at nulla a, lacinia vulputate justo. Quisque nec odio ipsum. Praesent consectetur, quam quis sodales vehicula, lorem felis interdum eros, id tincidunt tortor eros nec sapien. Donec orci enim, gravida sed justo a, convallis suscipit lorem. Vivamus tincidunt eu libero sed interdum. Ut commodo, risus in scelerisque dignissim, nibh risus eleifend ipsum', '2014-05-11', 'asset/user_file/nophoto2.jpg', 1),
(3, 'test event', 'event', 'eaffffffffffffffffffffffffffffffffffzvvafafaeaffffffffffffffffffffffffffffffffffzvvafafaeaffffffffffffffffffffffffffffffffffzvvafafaeaffffffffffffffffffffffffffffffffffzvvafafaeaffffffffffffffffffffffffffffffffffzvvafafa', '2014-06-06', 'asset/user_file/nophoto2.jpg', 2);

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

--
-- Table structure for table `community`
--

CREATE TABLE IF NOT EXISTS `community` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `type` varchar(10) NOT NULL,
  `createdBy` varchar(20) NOT NULL,
  `description` varchar(500) NOT NULL,
  `photo` varchar(30) NOT NULL DEFAULT 'asset/user_file/nophoto2.jpg',
  `approved` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `createdBy` (`createdBy`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `community`
--

INSERT INTO `community` (`id`, `name`, `type`, `createdBy`, `description`, `photo`, `approved`) VALUES
(1, 'Multimedia', 'Lab', 'devaraudayana', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus justo tellus, mollis at nulla a, lacinia vulputate justo. Quisque nec odio ipsum. Praesent consectetur, quam quis sodales vehicula, lorem felis interdum eros, id tincidunt tortor eros nec sapien. Donec orci enim, gravida sed justo a, convallis suscipit lorem. Vivamus tincidunt eu libero sed interdum. Ut commodo, risus in scelerisque dignissim, nibh risus eleifend ipsum', 'asset/user_file/1/avatar.jpg', 1),
(2, 'Test', 'Organisasi', 'alazhar', '	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ', 'asset/user_file/nophoto2.jpg', 0);

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

--
-- Table structure for table `friend`
--

CREATE TABLE IF NOT EXISTS `friend` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `user1` varchar(20) NOT NULL,
  `user2` varchar(20) NOT NULL,
  `status` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user1` (`user1`,`user2`),
  KEY `user2` (`user2`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

--
-- Dumping data for table `friend`
--

INSERT INTO `friend` (`id`, `user1`, `user2`, `status`) VALUES
(3, 'bondanabe', 'alazhar', 1),
(4, 'ase', 'bondanabe', 1),
(5, 'alazhar', 'ase', 0),
(6, 'bondanabe', 'anto', 0),
(7, 'anto', 'avianrinandhi', 1);

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

--
-- Table structure for table `member`
--

CREATE TABLE IF NOT EXISTS `member` (
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(20) NOT NULL,
  `id_community` int(5) NOT NULL,
  `role` varchar(20) NOT NULL DEFAULT 'Anggota',
  PRIMARY KEY (`id`),
  KEY `username` (`username`,`id_community`),
  KEY `id_community` (`id_community`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `member`
--

INSERT INTO `member` (`id`, `username`, `id_community`, `role`) VALUES
(1, 'devaraudayana', 1, 'Anggota'),
(2, 'bondanabe', 1, 'Anggota'),
(3, 'alazhar', 2, 'Anggota'),
(4, 'ase', 2, 'Anggota'),
(5, 'avianrinandhi', 2, 'Anggota'),
(6, 'anto', 2, 'Anggota');

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

--
-- Table structure for table `post`
--

CREATE TABLE IF NOT EXISTS `post` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `status` varchar(140) NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user` varchar(20) NOT NULL,
  `toUser` varchar(20) DEFAULT NULL,
  `like` int(5) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user` (`user`),
  KEY `toUser` (`toUser`),
  KEY `toUser_2` (`toUser`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;

--
-- Dumping data for table `post`
--

INSERT INTO `post` (`id`, `status`, `date`, `user`, `toUser`, `like`) VALUES
(1, 'test', '2014-05-20 18:23:33', 'alazhar', NULL, 0),
(2, 'test2', '2014-05-20 18:29:02', 'alazhar', NULL, 0),
(3, 'test bondan', '2014-05-20 20:35:52', 'bondanabe', NULL, 0),
(4, 'dasas', '2014-05-21 04:37:09', 'alazhar', NULL, 0),
(5, 'dan', '2014-05-21 07:32:41', 'alazhar', 'bondanabe', 0),
(7, 'test5', '2014-05-21 07:46:51', 'alazhar', NULL, 0),
(8, 'oi dan', '2014-05-21 07:55:03', 'alazhar', 'bondanabe', 0),
(9, 'oi', '2014-05-21 16:54:38', 'alazhar', 'avianrinandhi', 0),
(10, 'test3', '2014-05-31 05:11:20', 'alazhar', NULL, 0),
(11, 'coba time', '2014-05-31 14:38:02', 'alazhar', NULL, 0),
(12, 'time2', '2014-05-31 14:45:48', 'alazhar', NULL, 0),
(13, 'apa', '2014-05-31 15:21:11', 'alazhar', NULL, 0);

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

--
-- Table structure for table `profile`
--

CREATE TABLE IF NOT EXISTS `profile` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `nama` varchar(20) NOT NULL,
  `avatar` varchar(100) NOT NULL DEFAULT 'asset/user_file/nophoto.jpg',
  `dob` date NOT NULL,
  `telp` varchar(15) DEFAULT NULL,
  `address` varchar(50) NOT NULL,
  `hometown` varchar(30) NOT NULL,
  `Fakultas` varchar(20) NOT NULL,
  `Jurusan` varchar(20) NOT NULL,
  `Angkatan` year(4) NOT NULL,
  `Kelas` int(11) NOT NULL,
  `relationship` int(1) DEFAULT NULL,
  `username` varchar(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `username` (`username`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;

--
-- Dumping data for table `profile`
--

INSERT INTO `profile` (`id`, `nama`, `avatar`, `dob`, `telp`, `address`, `hometown`, `Fakultas`, `Jurusan`, `Angkatan`, `Kelas`, `relationship`, `username`) VALUES
(1, 'Al Azhar', 'asset/user_file/alazhar/avatar.jpg', '1992-10-21', '12312', 'address', 'hometown', 'Manajemen', 'Akutansi', 2010, 23, 1, 'alazhar'),
(2, 'Devara Udayana', 'asset/user_file/devaraudayana/avatar.jpg', '1993-03-20', '022 7531740', 'Pratama ASri C2', 'Bandung', 'Teknik', 'Informatika', 2011, 7, 1, 'devaraudayana'),
(3, 'avian', 'asset/user_file/avianrinandhi/avatar.jpg', '1992-10-21', '097', 'Sukabirus', 'Sorong', 'Manajemen', 'Bussines', 2011, 0, 1, 'avianrinandhi'),
(4, 'Bondan', 'asset/user_file/bondanabe/avatar.jpg', '1992-10-21', '022 7531740', 'address', 'hometown', 'Manajemen', 'Informatika', 2010, 7, 2, 'bondanabe'),
(5, 'fails4l', 'asset/user_file/failsa/avatar.jpg', '1992-03-21', '085232123212', 'sukabirus', 'bandung', 'Manajemen', 'informatika', 2010, 6, 2, 'failsa'),
(10, 'Aseek', 'asset/user_file/ase/avatar.jpg', '2014-05-14', '08123123124', 'Pratama ASri C2', 'Bandung', 'Ilmu terapan', 'Informatika', 2010, 23, 4, 'ase'),
(14, 'anton', 'asset/user_file/anto/avatar.jpg', '2014-05-06', '12312', 'address', 'hometown', 'Teknik', 'Industri', 2010, 7, 4, 'anto');

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

--
-- Table structure for table `user`
--

CREATE TABLE IF NOT EXISTS `user` (
  `username` varchar(20) NOT NULL,
  `password` varchar(50) NOT NULL,
  `email` varchar(40) NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`username`, `password`, `email`) VALUES
('alazhar', '25d55ad283aa400af464c76d713c07ad', 'alazhar@mail.com'),
('anto', '202cb962ac59075b964b07152d234b70', 'ada@gmail.com'),
('ase', '202cb962ac59075b964b07152d234b70', 'ase@gmail.com'),
('avianrinandhi', '202cb962ac59075b964b07152d234b70', 'rinandhi.avian17@gmail.com'),
('bondanabe', '202cb962ac59075b964b07152d234b70', 'bondanabe@yahoo.com'),
('devaraudayana', 'fcea920f7412b5da7be0cf42b8c93759', 'suckblavk@yahoo.com'),
('failsa', '827ccb0eea8a706c4c34a16891f84e7b', 'faisal@mail.com');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `activities`
--
ALTER TABLE `activities`
  ADD CONSTRAINT `activities_ibfk_1` FOREIGN KEY (`community`) REFERENCES `community` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `community`
--
ALTER TABLE `community`
  ADD CONSTRAINT `community_ibfk_1` FOREIGN KEY (`createdBy`) REFERENCES `user` (`username`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `friend`
--
ALTER TABLE `friend`
  ADD CONSTRAINT `friend_ibfk_1` FOREIGN KEY (`user1`) REFERENCES `user` (`username`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `friend_ibfk_2` FOREIGN KEY (`user2`) REFERENCES `user` (`username`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `member`
--
ALTER TABLE `member`
  ADD CONSTRAINT `member_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `member_ibfk_2` FOREIGN KEY (`id_community`) REFERENCES `community` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `post`
--
ALTER TABLE `post`
  ADD CONSTRAINT `post_ibfk_1` FOREIGN KEY (`user`) REFERENCES `user` (`username`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `post_ibfk_2` FOREIGN KEY (`toUser`) REFERENCES `user` (`username`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `profile`
--
ALTER TABLE `profile`
  ADD CONSTRAINT `profile_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`) ON DELETE CASCADE ON UPDATE CASCADE;

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