text: -- MySQL dump 10.13  Distrib 5.7.17, for Win64 (x86_64)
  --
  -- Host: localhost    Database: iresearcher
  -- ------------------------------------------------------
  -- Server version	5.7.21-log
  
  /*!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 */;
  /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  /*!40103 SET TIME_ZONE='+00:00' */;
  /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  
  --
  -- Table structure for table `friendships`
  --
  
  DROP TABLE IF EXISTS `friendships`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `friendships` (
    `idfriendships` int(11) NOT NULL AUTO_INCREMENT,
    `idsender` int(11) NOT NULL,
    `idreceiver` int(11) NOT NULL,
    `status` varchar(45) NOT NULL,
    PRIMARY KEY (`idfriendships`),
    UNIQUE KEY `idfriendships_UNIQUE` (`idfriendships`),
    KEY `idsender_idx` (`idsender`),
    KEY `idreceiver_idx` (`idreceiver`),
    KEY `request_sender_idx` (`idsender`),
    KEY `request_receiver_idx` (`idreceiver`),
    CONSTRAINT `request_receiver` FOREIGN KEY (`idreceiver`) REFERENCES `users` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `request_sender` FOREIGN KEY (`idsender`) REFERENCES `users` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `friendships`
  --
  
  LOCK TABLES `friendships` WRITE;
  /*!40000 ALTER TABLE `friendships` DISABLE KEYS */;
  /*!40000 ALTER TABLE `friendships` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `groups`
  --
  
  DROP TABLE IF EXISTS `groups`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `groups` (
    `ID` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(32) NOT NULL,
    `description` varchar(256) DEFAULT NULL,
    `idadmin` int(11) NOT NULL,
    PRIMARY KEY (`ID`),
    UNIQUE KEY `ID_UNIQUE` (`ID`),
    KEY `idadmin_idx` (`idadmin`),
    CONSTRAINT `idadmin` FOREIGN KEY (`idadmin`) REFERENCES `users` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `groups`
  --
  
  LOCK TABLES `groups` WRITE;
  /*!40000 ALTER TABLE `groups` DISABLE KEYS */;
  /*!40000 ALTER TABLE `groups` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `groups_and_users`
  --
  
  DROP TABLE IF EXISTS `groups_and_users`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `groups_and_users` (
    `idgroup` int(11) NOT NULL,
    `iduser` int(11) NOT NULL,
    KEY `iduser_idx` (`iduser`),
    CONSTRAINT `iduser` FOREIGN KEY (`iduser`) REFERENCES `users` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `groups_and_users`
  --
  
  LOCK TABLES `groups_and_users` WRITE;
  /*!40000 ALTER TABLE `groups_and_users` DISABLE KEYS */;
  /*!40000 ALTER TABLE `groups_and_users` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `groups_messages`
  --
  
  DROP TABLE IF EXISTS `groups_messages`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `groups_messages` (
    `ID` int(11) NOT NULL AUTO_INCREMENT,
    `idsender` int(11) NOT NULL,
    `idreceiver` int(11) NOT NULL,
    `content` varchar(256) NOT NULL,
    PRIMARY KEY (`ID`),
    UNIQUE KEY `ID_UNIQUE` (`ID`),
    KEY `user_sender_idx` (`idsender`),
    KEY `group_receiver_idx` (`idreceiver`),
    CONSTRAINT `group_receiver` FOREIGN KEY (`idreceiver`) REFERENCES `groups` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `user_sender` FOREIGN KEY (`idsender`) REFERENCES `users` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `groups_messages`
  --
  
  LOCK TABLES `groups_messages` WRITE;
  /*!40000 ALTER TABLE `groups_messages` DISABLE KEYS */;
  /*!40000 ALTER TABLE `groups_messages` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `users`
  --
  
  DROP TABLE IF EXISTS `users`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `users` (
    `ID` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(32) NOT NULL,
    `username` varchar(32) NOT NULL,
    `email` varchar(64) NOT NULL,
    `password` varchar(128) NOT NULL,
    PRIMARY KEY (`ID`),
    UNIQUE KEY `ID_UNIQUE` (`ID`),
    UNIQUE KEY `username_UNIQUE` (`username`),
    UNIQUE KEY `email_UNIQUE` (`email`)
  ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `users`
  --
  
  LOCK TABLES `users` WRITE;
  /*!40000 ALTER TABLE `users` DISABLE KEYS */;
  /*!40000 ALTER TABLE `users` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `users_messages`
  --
  
  DROP TABLE IF EXISTS `users_messages`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `users_messages` (
    `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `idsender` int(11) NOT NULL,
    `idreceiver` int(11) NOT NULL,
    `content` varchar(256) NOT NULL,
    PRIMARY KEY (`ID`),
    KEY `idsender_idx` (`idsender`),
    KEY `idreceiver_idx` (`idreceiver`),
    CONSTRAINT `idreceiver` FOREIGN KEY (`idreceiver`) REFERENCES `users` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `idsender` FOREIGN KEY (`idsender`) REFERENCES `users` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `users_messages`
  --
  
  LOCK TABLES `users_messages` WRITE;
  /*!40000 ALTER TABLE `users_messages` DISABLE KEYS */;
  /*!40000 ALTER TABLE `users_messages` ENABLE KEYS */;
  UNLOCK TABLES;
  /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  
  /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  /*!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 */;
  /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  
  -- Dump completed on 2018-11-27 22:00:37
  