text: -- phpMyAdmin SQL Dump
  -- version 4.4.13.1deb1
  -- http://www.phpmyadmin.net
  --
  -- Host: localhost
  -- Generation Time: Jul 16, 2016 at 02:54 PM
  -- Server version: 5.6.30-0ubuntu0.15.10.1
  -- PHP Version: 5.6.11-1ubuntu3.4
  
  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 utf8mb4 */;
  
  --
  -- Database: `test`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `formsession`
  --
  
  CREATE TABLE IF NOT EXISTS `formsession` (
    `sid` char(16) NOT NULL,
    `rid` char(16) NOT NULL,
    `expires` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `friendship`
  --
  
  CREATE TABLE IF NOT EXISTS `friendship` (
    `userid1` int(11) NOT NULL,
    `userid2` int(11) NOT NULL,
    `status` int(11) NOT NULL DEFAULT '2',
    `statussince` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Table structure for table `photo`
  --
  
  CREATE TABLE IF NOT EXISTS `photo` (
    `photoid` int(11) NOT NULL,
    `url` varchar(30) NOT NULL,
    `caption` blob,
    `timeofupload` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user`
  --
  
  CREATE TABLE IF NOT EXISTS `user` (
    `userid` int(11) NOT NULL,
    `firstname` varchar(20) CHARACTER SET utf8 NOT NULL,
    `lastname` varchar(20) CHARACTER SET utf8 NOT NULL,
    `password` varchar(20) CHARACTER SET utf8 NOT NULL,
    `email` varchar(40) CHARACTER SET utf8 NOT NULL,
    `photoid` int(11) DEFAULT NULL,
    `registeredon` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  ) ENGINE=InnoDB AUTO_INCREMENT=123458 DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `user`
  --
  
  --
  -- Table structure for table `usersession`
  --
  
  CREATE TABLE IF NOT EXISTS `usersession` (
    `sid` char(16) NOT NULL,
    `rid` char(16) NOT NULL,
    `expires` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `usersession`
  --
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `formsession`
  --
  ALTER TABLE `formsession`
    ADD PRIMARY KEY (`sid`);
  
  --
  -- Indexes for table `friendship`
  --
  ALTER TABLE `friendship`
    ADD PRIMARY KEY (`userid1`,`userid2`),
    ADD KEY `userid1` (`userid1`,`userid2`),
    ADD KEY `userid2` (`userid2`);
  
  --
  -- Indexes for table `photo`
  --
  ALTER TABLE `photo`
    ADD PRIMARY KEY (`photoid`),
    ADD KEY `photoid` (`photoid`);
  
  --
  -- Indexes for table `user`
  --
  ALTER TABLE `user`
    ADD PRIMARY KEY (`userid`),
    ADD UNIQUE KEY `email` (`email`),
    ADD UNIQUE KEY `email_2` (`email`),
    ADD KEY `photoid` (`photoid`);
  
  --
  -- Indexes for table `usersession`
  --
  ALTER TABLE `usersession`
    ADD PRIMARY KEY (`sid`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `user`
  --
  ALTER TABLE `user`
    MODIFY `userid` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=123458;
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `friendship`
  --
  ALTER TABLE `friendship`
    ADD CONSTRAINT `friendship_ibfk_1` FOREIGN KEY (`userid1`) REFERENCES `user` (`userid`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `friendship_ibfk_2` FOREIGN KEY (`userid2`) REFERENCES `user` (`userid`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `user`
  --
  ALTER TABLE `user`
    ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`photoid`) REFERENCES `photo` (`photoid`) ON DELETE SET NULL ON UPDATE SET NULL;
  
  /*!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 */;
  