text: -- MariaDB dump 10.17  Distrib 10.4.11-MariaDB, for Win64 (AMD64)
  --
  -- Host: localhost    Database: students
  -- ------------------------------------------------------
  -- Server version	10.4.11-MariaDB
  
  /*!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 */;
  /*!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 `migration`
  --
  
  DROP TABLE IF EXISTS `migration`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `migration` (
    `version` varchar(180) NOT NULL,
    `apply_time` int(11) DEFAULT NULL,
    PRIMARY KEY (`version`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `migration`
  --
  
  LOCK TABLES `migration` WRITE;
  /*!40000 ALTER TABLE `migration` DISABLE KEYS */;
  INSERT INTO `migration` VALUES ('m000000_000000_base',1582135838),('m150214_044831_init_user',1582135841);
  /*!40000 ALTER TABLE `migration` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `profile`
  --
  
  DROP TABLE IF EXISTS `profile`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `profile` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `user_id` int(11) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `full_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `timezone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `profile_user_id` (`user_id`),
    CONSTRAINT `profile_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `profile`
  --
  
  LOCK TABLES `profile` WRITE;
  /*!40000 ALTER TABLE `profile` DISABLE KEYS */;
  INSERT INTO `profile` VALUES (1,1,'2020-02-19 18:10:41',NULL,'the one',NULL),(2,2,'2020-02-19 18:41:15','2020-02-19 18:41:15',NULL,NULL),(3,3,'2020-02-19 18:55:13','2020-02-19 18:55:13',NULL,NULL);
  /*!40000 ALTER TABLE `profile` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `program`
  --
  
  DROP TABLE IF EXISTS `program`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `program` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    `degree` varchar(45) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name_UNIQUE` (`name`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `program`
  --
  
  LOCK TABLES `program` WRITE;
  /*!40000 ALTER TABLE `program` DISABLE KEYS */;
  INSERT INTO `program` VALUES (1,'Informatics Engineering','Bachelor'),(3,'Management Informatics','Bachelor');
  /*!40000 ALTER TABLE `program` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `role`
  --
  
  DROP TABLE IF EXISTS `role`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `role` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `can_admin` smallint(6) NOT NULL DEFAULT 0,
    `can_student` smallint(6) NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `role`
  --
  
  LOCK TABLES `role` WRITE;
  /*!40000 ALTER TABLE `role` DISABLE KEYS */;
  INSERT INTO `role` VALUES (1,'Admin','2020-02-19 18:10:41',NULL,1,0),(2,'User','2020-02-19 18:10:41',NULL,0,0),(3,'Student','2020-02-19 18:10:41',NULL,0,1);
  /*!40000 ALTER TABLE `role` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `student`
  --
  
  DROP TABLE IF EXISTS `student`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `student` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    `program_id` int(11) NOT NULL,
    `user_id` int(11) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name_UNIQUE` (`name`),
    KEY `fk_student_program1_idx` (`program_id`),
    KEY `fk_student_user1_idx` (`user_id`),
    CONSTRAINT `fk_student_program1` FOREIGN KEY (`program_id`) REFERENCES `program` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `fk_student_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `student`
  --
  
  LOCK TABLES `student` WRITE;
  /*!40000 ALTER TABLE `student` DISABLE KEYS */;
  INSERT INTO `student` VALUES (6,'José Exposto1',1,0),(7,'a1',1,0),(8,'a2',3,0),(9,'José2',1,3),(10,'admin',1,1);
  /*!40000 ALTER TABLE `student` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `student_subject`
  --
  
  DROP TABLE IF EXISTS `student_subject`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `student_subject` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `subject_id` int(11) NOT NULL,
    `student_id` int(11) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `ss_unique` (`subject_id`,`student_id`),
    KEY `fk_product_order_product1_idx` (`subject_id`),
    KEY `fk_product_order_order1_idx` (`student_id`),
    CONSTRAINT `fk_product_order_order1` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `fk_product_order_product1` FOREIGN KEY (`subject_id`) REFERENCES `subject` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `student_subject`
  --
  
  LOCK TABLES `student_subject` WRITE;
  /*!40000 ALTER TABLE `student_subject` DISABLE KEYS */;
  INSERT INTO `student_subject` VALUES (6,1,6),(17,1,10),(7,4,6),(15,4,9),(8,5,6),(13,5,9);
  /*!40000 ALTER TABLE `student_subject` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `subject`
  --
  
  DROP TABLE IF EXISTS `subject`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `subject` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    `year` int(11) NOT NULL,
    `semester` int(11) NOT NULL,
    `program_id` int(11) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `subject_unique` (`name`,`program_id`),
    KEY `fk_subject_program1_idx` (`program_id`),
    CONSTRAINT `fk_subject_program1` FOREIGN KEY (`program_id`) REFERENCES `program` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `subject`
  --
  
  LOCK TABLES `subject` WRITE;
  /*!40000 ALTER TABLE `subject` DISABLE KEYS */;
  INSERT INTO `subject` VALUES (1,'Programação I',1,1,1),(4,'Desenvolvimento Web',2,2,1),(5,'Object Oriented Programming',2,1,1),(7,'Programming I',1,1,3),(9,'Programming I',1,1,1);
  /*!40000 ALTER TABLE `subject` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `user`
  --
  
  DROP TABLE IF EXISTS `user`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `user` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `role_id` int(11) NOT NULL,
    `status` smallint(6) NOT NULL,
    `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `auth_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `access_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `logged_in_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `logged_in_at` timestamp NULL DEFAULT NULL,
    `created_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `banned_at` timestamp NULL DEFAULT NULL,
    `banned_reason` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `user_email` (`email`),
    UNIQUE KEY `user_username` (`username`),
    KEY `user_role_id` (`role_id`),
    CONSTRAINT `user_role_id` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `user`
  --
  
  LOCK TABLES `user` WRITE;
  /*!40000 ALTER TABLE `user` DISABLE KEYS */;
  INSERT INTO `user` VALUES (1,1,1,'neo@neo.com','neo','$2y$13$dyVw4WkZGkABf2UrGWrhHO4ZmVBv.K4puhOL59Y9jQhIdj63TlV.O','X7912OMxlLCCVAB1yaI1qnX_kqgOGb_r','E1bsUR9jrarvr6u8xOhka7beUOrsythG','::1','2020-02-21 09:21:25',NULL,'2020-02-19 18:10:41','2020-02-21 08:58:15',NULL,NULL),(2,2,0,'exp@ipb.pt',NULL,'$2y$13$R76r62.VEobR2q3/LDXFxO/0xaYDw8lnXQ1QHIcQQ12Dw39G9hCO6','w1dXR_N_cPnRTnfhfY-9hZjVvImC3vPa','OMD1wut9Ca3tBAt1hCkFzRln8-t9_jjp',NULL,NULL,'::1','2020-02-19 18:41:15','2020-02-19 18:41:15',NULL,NULL),(3,3,1,NULL,'joe','$2y$13$UZYZd1MDctly669xHIgw/OIAvHB/1.PvjmEhkXDV9SCid4Cfid7c6','oxjVj6gzu-q3qGNV-2IfuVCeupZdzFNs','VoMhAeHQ8AcZmg8ttXkZkQEqzcGTgTmu','::1','2020-02-21 08:54:56','::1','2020-02-19 18:55:13','2020-02-20 00:16:54',NULL,NULL);
  /*!40000 ALTER TABLE `user` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `user_auth`
  --
  
  DROP TABLE IF EXISTS `user_auth`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `user_auth` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `user_id` int(11) NOT NULL,
    `provider` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `provider_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `provider_attributes` text COLLATE utf8_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `user_auth_provider_id` (`provider_id`),
    KEY `user_auth_user_id` (`user_id`),
    CONSTRAINT `user_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `user_auth`
  --
  
  LOCK TABLES `user_auth` WRITE;
  /*!40000 ALTER TABLE `user_auth` DISABLE KEYS */;
  /*!40000 ALTER TABLE `user_auth` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `user_token`
  --
  
  DROP TABLE IF EXISTS `user_token`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `user_token` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `user_id` int(11) DEFAULT NULL,
    `type` smallint(6) NOT NULL,
    `token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `data` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `expired_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `user_token_token` (`token`),
    KEY `user_token_user_id` (`user_id`),
    CONSTRAINT `user_token_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `user_token`
  --
  
  LOCK TABLES `user_token` WRITE;
  /*!40000 ALTER TABLE `user_token` DISABLE KEYS */;
  INSERT INTO `user_token` VALUES (1,2,1,'QtApX_VdB8cvcuxLJCTczsmwRs1xAUFM',NULL,'2020-02-19 18:42:53',NULL);
  /*!40000 ALTER TABLE `user_token` 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 2020-02-21 10:38:48
  