Last active
November 7, 2017 19:50
-
-
Save leolas95/b3ae797299916073827b88c494c0705b to your computer and use it in GitHub Desktop.
Archivos .sql para el proyecto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delimiter // | |
create procedure hacer_intercambio(in groupid int, out a varchar(200), out b varchar(200)) | |
begin | |
drop table if exists temp1; | |
drop table if exists temp2; | |
-- Crea una tabla temporal para guardar los ids de los participantes | |
create temporary table temp1 as (select users.id from | |
users, participants, participates | |
where participates.participant_id = participants.id and | |
participants.user_id = users.id and | |
participates.group_id = groupid); | |
-- Crea otra tabla temporal para guardar los ids en orden aleatorio | |
create temporary table temp2 as (select id from temp1 order by rand()); | |
select cast(group_concat(id separator ' ') as char) into a from temp1; | |
select cast(group_concat(id separator ' ') as char) into b from temp2; | |
end// | |
delimiter ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) | |
-- | |
-- Host: localhost Database: secretfriend_development | |
-- ------------------------------------------------------ | |
-- Server version 5.7.20 | |
/*!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 `admins` | |
-- | |
DROP TABLE IF EXISTS `admins`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `admins` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`email` varchar(255) NOT NULL, | |
`user_id` bigint(20) NOT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_admins_on_email` (`email`), | |
KEY `index_admins_on_user_id` (`user_id`), | |
CONSTRAINT `fk_rails_378b9734e4` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `admins` | |
-- | |
LOCK TABLES `admins` WRITE; | |
/*!40000 ALTER TABLE `admins` DISABLE KEYS */; | |
INSERT INTO `admins` VALUES (1,'[email protected]',1,'2017-11-07 19:42:04','2017-11-07 19:42:04'); | |
/*!40000 ALTER TABLE `admins` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `ar_internal_metadata` | |
-- | |
DROP TABLE IF EXISTS `ar_internal_metadata`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `ar_internal_metadata` ( | |
`key` varchar(255) NOT NULL, | |
`value` varchar(255) DEFAULT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`key`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `ar_internal_metadata` | |
-- | |
LOCK TABLES `ar_internal_metadata` WRITE; | |
/*!40000 ALTER TABLE `ar_internal_metadata` DISABLE KEYS */; | |
INSERT INTO `ar_internal_metadata` VALUES ('environment','development','2017-11-07 19:41:48','2017-11-07 19:41:48'); | |
/*!40000 ALTER TABLE `ar_internal_metadata` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `buys` | |
-- | |
DROP TABLE IF EXISTS `buys`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `buys` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`participant_id` bigint(20) NOT NULL, | |
`gift_id` bigint(20) NOT NULL, | |
`date_of_purchase` date NOT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_buys_on_participant_id_and_gift_id` (`participant_id`,`gift_id`), | |
KEY `index_buys_on_gift_id` (`gift_id`), | |
KEY `index_buys_on_participant_id` (`participant_id`), | |
CONSTRAINT `fk_rails_6dd9c99e93` FOREIGN KEY (`participant_id`) REFERENCES `participants` (`id`), | |
CONSTRAINT `fk_rails_bd3a8bea65` FOREIGN KEY (`gift_id`) REFERENCES `gifts` (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `buys` | |
-- | |
LOCK TABLES `buys` WRITE; | |
/*!40000 ALTER TABLE `buys` DISABLE KEYS */; | |
/*!40000 ALTER TABLE `buys` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `exchanges` | |
-- | |
DROP TABLE IF EXISTS `exchanges`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `exchanges` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`exchange_date` date NOT NULL, | |
`place` text NOT NULL, | |
`group_id` bigint(20) NOT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_exchanges_on_exchange_date_and_group_id` (`exchange_date`,`group_id`), | |
KEY `index_exchanges_on_group_id` (`group_id`), | |
CONSTRAINT `fk_rails_ac5db4c463` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `exchanges` | |
-- | |
LOCK TABLES `exchanges` WRITE; | |
/*!40000 ALTER TABLE `exchanges` DISABLE KEYS */; | |
INSERT INTO `exchanges` VALUES (1,'2017-11-11','56176 Lind Square',1,'2017-11-07 19:42:12','2017-11-07 19:42:12'); | |
/*!40000 ALTER TABLE `exchanges` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `gifts` | |
-- | |
DROP TABLE IF EXISTS `gifts`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `gifts` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`code` varchar(255) NOT NULL, | |
`shop_id` bigint(20) NOT NULL, | |
`name` varchar(255) NOT NULL, | |
`price` float NOT NULL, | |
`description` text, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_gifts_on_code_and_shop_id` (`code`,`shop_id`), | |
KEY `index_gifts_on_shop_id` (`shop_id`), | |
CONSTRAINT `fk_rails_489a9cb05f` FOREIGN KEY (`shop_id`) REFERENCES `shops` (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `gifts` | |
-- | |
LOCK TABLES `gifts` WRITE; | |
/*!40000 ALTER TABLE `gifts` DISABLE KEYS */; | |
INSERT INTO `gifts` VALUES (1,'aa0107c39df01002421948728e8a6768',1,'Cookie',123.45,'Un regalo muy bonito','2017-11-07 19:42:13','2017-11-07 19:42:13'),(2,'6e3d42e86d25210387a60575b6c9a604',1,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:13','2017-11-07 19:42:13'),(3,'d0b7486490e7d6922ba5bf03a72fd075',1,'Cake',123.45,'Un regalo muy bonito','2017-11-07 19:42:13','2017-11-07 19:42:13'),(4,'c9e482032304f58798b832c69fd0994b',1,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:13','2017-11-07 19:42:13'),(5,'f0bcdeaa502496ce6f10a43c582b6b0b',1,'Cake',123.45,'Un regalo muy bonito','2017-11-07 19:42:13','2017-11-07 19:42:13'),(6,'3032c10395bef92930ece602f0060ef4',2,'Cookie',123.45,'Un regalo muy bonito','2017-11-07 19:42:13','2017-11-07 19:42:13'),(7,'c7b804c43a9f3394e4db83dcab797df8',2,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:13','2017-11-07 19:42:13'),(8,'b9a64e7257200f349f7859f3d1ae072b',2,'Sweet Bread',123.45,'Un regalo muy bonito','2017-11-07 19:42:13','2017-11-07 19:42:13'),(9,'04b7f1f725933c7e287e25ecd3c24308',2,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:13','2017-11-07 19:42:13'),(10,'99e739b4b967f89d99ca76e444ec15d6',2,'Cake',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(11,'5b6e91ba9b0a20c5d641559ca8cf5cbc',3,'Cake',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(12,'9cae667e3b636cfe70b2c2a34aa19529',3,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(13,'558a0e27748918278c6fd636843a1f0a',3,'Cake',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(14,'146241b139fc778c8b986f3f1f606500',3,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(15,'99608e7ee059ef5233dd4de8c85a6295',3,'Pudding',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(16,'ed24f2d2624e2315b83fd3bad6eaaf45',4,'Pie',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(17,'42e24576592435656592adb7e80a4e7a',4,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(18,'f31e190480aa798f34c66132d87c4b25',4,'Sweet Bread',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(19,'0a240ba1c583a04ad0f6d2b12ab0b55a',4,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(20,'f7815cbb05f945d8a43098d908a60a04',4,'Sweet Bread',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(21,'c641acc07f40faf56bdf58cb7f6f7e54',5,'Sweet Bread',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(22,'27564b8ae0179b5147c0e5a959605b3d',5,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:14','2017-11-07 19:42:14'),(23,'f95c3484e6efce1043f35ff427525ce5',5,'Cake',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(24,'9fa933200bd96e26b703d0acba180b60',5,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(25,'e981c0682f9e6f561fdeff78f4f8cf51',5,'Cake',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(26,'f39f7c51ea91868dd4f7489d8f08194e',6,'Cake',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(27,'feebdf8926dbeb0333fd7f3250e6bd48',6,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(28,'9691b971a83d713e289e773b3a3a2882',6,'Pie',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(29,'1b93f1ea0796886f3f2972d7711fc303',6,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(30,'f40bfc3ce5fec826fb6d4f21c6fb7d59',6,'Pie',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(31,'adf895d5f38fd06703896e593d20a20b',7,'Sweet Bread',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(32,'6eef7cfc33889104b2b586f7743c64b3',7,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(33,'a08c9c3f536a023460893d387a56be30',7,'Cookie',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(34,'b6ee35814b633af9d347f5536436b329',7,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(35,'87a7eab5634ec5be6bbda4ec12ee8c88',7,'Sweet Bread',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(36,'85ec331d146d83bd1629bc8cf8b9337a',8,'Ice Cream',123.45,'Un regalo muy bonito','2017-11-07 19:42:15','2017-11-07 19:42:15'),(37,'25714dbdf3ae156aac767cb59536a9f0',8,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(38,'f1c3228b5d417bb2751e9f455da2a5b7',8,'Sweet Bread',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(39,'04425aa63eceadee1c0f4dbf796f86a0',8,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(40,'6c6d816fce6401951e0ea48f638d07f8',8,'Ice Cream',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(41,'97d20987122333d3dec7ce6c5d51ac57',9,'Pudding',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(42,'73ffb2ad3bc575a12fdd78d78c4cb627',9,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(43,'2dbef46dde51a43353f03c7da907f275',9,'Cookie',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(44,'c74b4731a75ca6052542bcb22b40f49d',9,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(45,'fbf6756fb2ea582fc273ec2cd21b8f43',9,'Cake',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(46,'92cd2db7f255bd3f211d4917d57fadc9',10,'Pudding',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(47,'d977a45515fd1cd85890349c4055fe1c',10,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(48,'e44fd6b7cd70639af8d6c10d295b1bbe',10,'Pie',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(49,'945f5a5a64c05c521f6e8470280357f2',10,'Chocolate',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'),(50,'2ee25f746745a9772562ab4c91a834e7',10,'Ice Cream',123.45,'Un regalo muy bonito','2017-11-07 19:42:16','2017-11-07 19:42:16'); | |
/*!40000 ALTER TABLE `gifts` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `gives` | |
-- | |
DROP TABLE IF EXISTS `gives`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `gives` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`giver_id` bigint(20) NOT NULL, | |
`receiver_id` bigint(20) NOT NULL, | |
`exchange_id` bigint(20) NOT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
`giver_calification` float DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_gives_on_giver_id_and_receiver_id_and_exchange_id` (`giver_id`,`receiver_id`,`exchange_id`), | |
KEY `index_gives_on_exchange_id` (`exchange_id`), | |
KEY `index_gives_on_giver_id` (`giver_id`), | |
KEY `index_gives_on_receiver_id` (`receiver_id`), | |
CONSTRAINT `fk_rails_fb11a3ff48` FOREIGN KEY (`exchange_id`) REFERENCES `exchanges` (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `gives` | |
-- | |
LOCK TABLES `gives` WRITE; | |
/*!40000 ALTER TABLE `gives` DISABLE KEYS */; | |
INSERT INTO `gives` VALUES (1,2,3,1,'2017-11-07 19:42:12','2017-11-07 19:42:12',NULL),(2,3,4,1,'2017-11-07 19:42:13','2017-11-07 19:42:13',NULL),(3,4,2,1,'2017-11-07 19:42:13','2017-11-07 19:42:13',NULL); | |
/*!40000 ALTER TABLE `gives` 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` bigint(20) NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) NOT NULL, | |
`admin_email` varchar(255) NOT NULL, | |
`admin_id` bigint(20) NOT NULL, | |
`group_type` varchar(255) NOT NULL, | |
`max_participants_allowed` int(11) DEFAULT NULL, | |
`min_gift_price` float DEFAULT NULL, | |
`max_gift_price` float DEFAULT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_groups_on_name_and_admin_email` (`name`,`admin_email`), | |
KEY `index_groups_on_admin_id` (`admin_id`), | |
CONSTRAINT `fk_rails_430258edd4` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=2 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 */; | |
INSERT INTO `groups` VALUES (1,'El grupo','[email protected]',1,'Abierto',10,10,NULL,'2017-11-07 19:42:11','2017-11-07 19:42:11'); | |
/*!40000 ALTER TABLE `groups` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `likes` | |
-- | |
DROP TABLE IF EXISTS `likes`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `likes` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`user_id` bigint(20) NOT NULL, | |
`user_like` varchar(255) NOT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_likes_on_user_id_and_user_like` (`user_id`,`user_like`), | |
KEY `index_likes_on_user_id` (`user_id`), | |
CONSTRAINT `fk_rails_1e09b5dabf` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `likes` | |
-- | |
LOCK TABLES `likes` WRITE; | |
/*!40000 ALTER TABLE `likes` DISABLE KEYS */; | |
INSERT INTO `likes` VALUES (1,2,'Chocolate','2017-11-07 19:42:04','2017-11-07 19:42:04'),(2,2,'Libros de terror','2017-11-07 19:42:05','2017-11-07 19:42:05'),(3,2,'Ropa deportiva','2017-11-07 19:42:05','2017-11-07 19:42:05'),(4,3,'Limon','2017-11-07 19:42:05','2017-11-07 19:42:05'),(5,3,'Musica clasica','2017-11-07 19:42:05','2017-11-07 19:42:05'),(6,3,'Matematicas','2017-11-07 19:42:05','2017-11-07 19:42:05'),(7,4,'Chocolate','2017-11-07 19:42:05','2017-11-07 19:42:05'),(8,4,'Libros de terror','2017-11-07 19:42:05','2017-11-07 19:42:05'),(9,4,'Ropa deportiva','2017-11-07 19:42:05','2017-11-07 19:42:05'),(10,5,'Limon','2017-11-07 19:42:06','2017-11-07 19:42:06'),(11,5,'Musica clasica','2017-11-07 19:42:06','2017-11-07 19:42:06'),(12,5,'Matematicas','2017-11-07 19:42:06','2017-11-07 19:42:06'),(13,6,'Chocolate','2017-11-07 19:42:06','2017-11-07 19:42:06'),(14,6,'Libros de terror','2017-11-07 19:42:06','2017-11-07 19:42:06'),(15,6,'Ropa deportiva','2017-11-07 19:42:06','2017-11-07 19:42:06'),(16,7,'Limon','2017-11-07 19:42:06','2017-11-07 19:42:06'),(17,7,'Musica clasica','2017-11-07 19:42:06','2017-11-07 19:42:06'),(18,7,'Matematicas','2017-11-07 19:42:06','2017-11-07 19:42:06'),(19,8,'Chocolate','2017-11-07 19:42:07','2017-11-07 19:42:07'),(20,8,'Libros de terror','2017-11-07 19:42:07','2017-11-07 19:42:07'),(21,8,'Ropa deportiva','2017-11-07 19:42:07','2017-11-07 19:42:07'),(22,9,'Limon','2017-11-07 19:42:07','2017-11-07 19:42:07'),(23,9,'Musica clasica','2017-11-07 19:42:07','2017-11-07 19:42:07'),(24,9,'Matematicas','2017-11-07 19:42:07','2017-11-07 19:42:07'),(25,10,'Chocolate','2017-11-07 19:42:07','2017-11-07 19:42:07'),(26,10,'Libros de terror','2017-11-07 19:42:07','2017-11-07 19:42:07'),(27,10,'Ropa deportiva','2017-11-07 19:42:07','2017-11-07 19:42:07'),(28,11,'Limon','2017-11-07 19:42:07','2017-11-07 19:42:07'),(29,11,'Musica clasica','2017-11-07 19:42:08','2017-11-07 19:42:08'),(30,11,'Matematicas','2017-11-07 19:42:08','2017-11-07 19:42:08'),(31,12,'Chocolate','2017-11-07 19:42:08','2017-11-07 19:42:08'),(32,12,'Libros de terror','2017-11-07 19:42:08','2017-11-07 19:42:08'),(33,12,'Ropa deportiva','2017-11-07 19:42:08','2017-11-07 19:42:08'),(34,13,'Limon','2017-11-07 19:42:08','2017-11-07 19:42:08'),(35,13,'Musica clasica','2017-11-07 19:42:08','2017-11-07 19:42:08'),(36,13,'Matematicas','2017-11-07 19:42:08','2017-11-07 19:42:08'),(37,14,'Chocolate','2017-11-07 19:42:08','2017-11-07 19:42:08'),(38,14,'Libros de terror','2017-11-07 19:42:08','2017-11-07 19:42:08'),(39,14,'Ropa deportiva','2017-11-07 19:42:09','2017-11-07 19:42:09'),(40,15,'Limon','2017-11-07 19:42:09','2017-11-07 19:42:09'),(41,15,'Musica clasica','2017-11-07 19:42:09','2017-11-07 19:42:09'),(42,15,'Matematicas','2017-11-07 19:42:09','2017-11-07 19:42:09'),(43,16,'Chocolate','2017-11-07 19:42:09','2017-11-07 19:42:09'),(44,16,'Libros de terror','2017-11-07 19:42:09','2017-11-07 19:42:09'),(45,16,'Ropa deportiva','2017-11-07 19:42:09','2017-11-07 19:42:09'),(46,17,'Limon','2017-11-07 19:42:09','2017-11-07 19:42:09'),(47,17,'Musica clasica','2017-11-07 19:42:10','2017-11-07 19:42:10'),(48,17,'Matematicas','2017-11-07 19:42:10','2017-11-07 19:42:10'),(49,18,'Chocolate','2017-11-07 19:42:10','2017-11-07 19:42:10'),(50,18,'Libros de terror','2017-11-07 19:42:10','2017-11-07 19:42:10'),(51,18,'Ropa deportiva','2017-11-07 19:42:10','2017-11-07 19:42:10'),(52,19,'Limon','2017-11-07 19:42:10','2017-11-07 19:42:10'),(53,19,'Musica clasica','2017-11-07 19:42:10','2017-11-07 19:42:10'),(54,19,'Matematicas','2017-11-07 19:42:10','2017-11-07 19:42:10'),(55,20,'Chocolate','2017-11-07 19:42:11','2017-11-07 19:42:11'),(56,20,'Libros de terror','2017-11-07 19:42:11','2017-11-07 19:42:11'),(57,20,'Ropa deportiva','2017-11-07 19:42:11','2017-11-07 19:42:11'),(58,21,'Limon','2017-11-07 19:42:11','2017-11-07 19:42:11'),(59,21,'Musica clasica','2017-11-07 19:42:11','2017-11-07 19:42:11'),(60,21,'Matematicas','2017-11-07 19:42:11','2017-11-07 19:42:11'); | |
/*!40000 ALTER TABLE `likes` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `participants` | |
-- | |
DROP TABLE IF EXISTS `participants`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `participants` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`email` varchar(255) NOT NULL, | |
`user_id` bigint(20) NOT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_participants_on_email` (`email`), | |
KEY `index_participants_on_user_id` (`user_id`), | |
CONSTRAINT `fk_rails_b9a3c50f15` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `participants` | |
-- | |
LOCK TABLES `participants` WRITE; | |
/*!40000 ALTER TABLE `participants` DISABLE KEYS */; | |
INSERT INTO `participants` VALUES (1,'[email protected]',2,'2017-11-07 19:42:11','2017-11-07 19:42:11'),(2,'[email protected]',3,'2017-11-07 19:42:11','2017-11-07 19:42:11'),(3,'[email protected]',4,'2017-11-07 19:42:12','2017-11-07 19:42:12'),(4,'[email protected]',5,'2017-11-07 19:42:12','2017-11-07 19:42:12'),(5,'[email protected]',6,'2017-11-07 19:42:12','2017-11-07 19:42:12'),(6,'[email protected]',7,'2017-11-07 19:42:12','2017-11-07 19:42:12'),(7,'[email protected]',8,'2017-11-07 19:42:12','2017-11-07 19:42:12'),(8,'[email protected]',9,'2017-11-07 19:42:12','2017-11-07 19:42:12'),(9,'[email protected]',10,'2017-11-07 19:42:12','2017-11-07 19:42:12'); | |
/*!40000 ALTER TABLE `participants` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `participates` | |
-- | |
DROP TABLE IF EXISTS `participates`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `participates` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`participant_id` bigint(20) NOT NULL, | |
`group_id` bigint(20) NOT NULL, | |
`wish` varchar(255) DEFAULT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_participates_on_participant_id_and_group_id` (`participant_id`,`group_id`), | |
KEY `index_participates_on_group_id` (`group_id`), | |
KEY `index_participates_on_participant_id` (`participant_id`), | |
CONSTRAINT `fk_rails_5b59e61b2f` FOREIGN KEY (`participant_id`) REFERENCES `participants` (`id`), | |
CONSTRAINT `fk_rails_b319198f79` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `participates` | |
-- | |
LOCK TABLES `participates` WRITE; | |
/*!40000 ALTER TABLE `participates` DISABLE KEYS */; | |
INSERT INTO `participates` VALUES (1,1,1,'Cake','2017-11-07 19:42:11','2017-11-07 19:42:11'),(2,2,1,'Chocolate','2017-11-07 19:42:11','2017-11-07 19:42:11'),(3,3,1,'Sweet Bread','2017-11-07 19:42:12','2017-11-07 19:42:12'),(4,4,1,'Chocolate','2017-11-07 19:42:12','2017-11-07 19:42:12'),(5,5,1,'Pudding','2017-11-07 19:42:12','2017-11-07 19:42:12'),(6,6,1,'Chocolate','2017-11-07 19:42:12','2017-11-07 19:42:12'),(7,7,1,'Cookie','2017-11-07 19:42:12','2017-11-07 19:42:12'),(8,8,1,'Chocolate','2017-11-07 19:42:12','2017-11-07 19:42:12'),(9,9,1,'Sweet Bread','2017-11-07 19:42:12','2017-11-07 19:42:12'); | |
/*!40000 ALTER TABLE `participates` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `schema_migrations` | |
-- | |
DROP TABLE IF EXISTS `schema_migrations`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `schema_migrations` ( | |
`version` varchar(255) NOT NULL, | |
PRIMARY KEY (`version`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `schema_migrations` | |
-- | |
LOCK TABLES `schema_migrations` WRITE; | |
/*!40000 ALTER TABLE `schema_migrations` DISABLE KEYS */; | |
INSERT INTO `schema_migrations` VALUES ('20171020025732'),('20171020143851'),('20171020150946'),('20171020151558'),('20171020152730'),('20171020155046'),('20171020163950'),('20171020164522'),('20171020174403'),('20171021022930'),('20171021023432'),('20171021030508'),('20171021032022'),('20171021154851'); | |
/*!40000 ALTER TABLE `schema_migrations` ENABLE KEYS */; | |
UNLOCK TABLES; | |
-- | |
-- Table structure for table `shops` | |
-- | |
DROP TABLE IF EXISTS `shops`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `shops` ( | |
`id` bigint(20) NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) NOT NULL, | |
`address` text NOT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; | |
/*!40101 SET character_set_client = @saved_cs_client */; | |
-- | |
-- Dumping data for table `shops` | |
-- | |
LOCK TABLES `shops` WRITE; | |
/*!40000 ALTER TABLE `shops` DISABLE KEYS */; | |
INSERT INTO `shops` VALUES (1,'Schamberger Group','702 Sibyl RampUniversity VillageGregoriostad0','2017-11-07 19:42:13','2017-11-07 19:42:13'),(2,'Morissette-Thiel','183 Schinner HighwayPine SquareLake Gagechester1','2017-11-07 19:42:13','2017-11-07 19:42:13'),(3,'Mills LLC','864 Lakin ShoresRoyal PlaceWalkerton2','2017-11-07 19:42:14','2017-11-07 19:42:14'),(4,'Nienow and Sons','562 Bessie HollowEagle VillageSouth Tyrahaven3','2017-11-07 19:42:14','2017-11-07 19:42:14'),(5,'Wiza, Howell and VonRueden','138 Fredy ManorsPark CourtFaychester4','2017-11-07 19:42:14','2017-11-07 19:42:14'),(6,'Swift Inc','86964 Boyle AlleyRoyal VillageOkunevamouth5','2017-11-07 19:42:15','2017-11-07 19:42:15'),(7,'Wilkinson-Mayert','5711 Ora CentersWillow CrossingSouth Theodoraland6','2017-11-07 19:42:15','2017-11-07 19:42:15'),(8,'Reynolds LLC','6916 Mayert MountainPark CrossingAshlybury7','2017-11-07 19:42:15','2017-11-07 19:42:15'),(9,'Stokes, Howell and Kunze','11714 Renner ManorsPark HeightsEast Eltafurt8','2017-11-07 19:42:16','2017-11-07 19:42:16'),(10,'Wisoky-Kerluke','97389 Rosalee MountainParadise HeightsDomingofort9','2017-11-07 19:42:16','2017-11-07 19:42:16'); | |
/*!40000 ALTER TABLE `shops` 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` bigint(20) NOT NULL AUTO_INCREMENT, | |
`email` varchar(255) NOT NULL, | |
`name` varchar(255) NOT NULL, | |
`lastname` varchar(255) NOT NULL, | |
`age` int(11) NOT NULL, | |
`gender` varchar(255) DEFAULT NULL, | |
`avgscore` float DEFAULT NULL, | |
`created_at` datetime NOT NULL, | |
`updated_at` datetime NOT NULL, | |
`password_digest` varchar(255) DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_users_on_email` (`email`) | |
) ENGINE=InnoDB AUTO_INCREMENT=22 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 */; | |
INSERT INTO `users` VALUES (1,'[email protected]','Leonardo','Guedez',17,'Male',NULL,'2017-11-07 19:42:04','2017-11-07 19:42:04','$2a$10$7X6on5fot5ulxBZCJpWrUOApjOPC4Taf4N.4kVtHsYLjLRhjI7d0W'),(2,'[email protected]','Kieran','Kuhlman',10,'Male',NULL,'2017-11-07 19:42:04','2017-11-07 19:42:04','$2a$10$LbeNCNShqIuk62cgRv4hwu83T2dLkpXmq6sPdNimis7sBop7KzDEu'),(3,'[email protected]','Ivy','Luettgen',11,'Female',NULL,'2017-11-07 19:42:05','2017-11-07 19:42:05','$2a$10$NHzB4zjicL1mk1yu/8o3Eu63nSV7/wrx1TdZZhlTV5bRqUsXQNw1e'),(4,'[email protected]','Annie','White',12,'Male',NULL,'2017-11-07 19:42:05','2017-11-07 19:42:05','$2a$10$bgXgBFi2fAYUQL64aUwhZ.8AgYw41kYepmMHNNyUKFiey43TMKagm'),(5,'[email protected]','Patrick','Murazik',13,'Female',NULL,'2017-11-07 19:42:05','2017-11-07 19:42:05','$2a$10$O42Zf7ODBU/pVJvy7XC1m.X.3JFQtwa7hQ.Qznua0HDcLS0LgRwJO'),(6,'[email protected]','Kevon','Rodriguez',14,'Male',NULL,'2017-11-07 19:42:06','2017-11-07 19:42:06','$2a$10$1ijvzOql8qSKwJN/IDOtGOm7A2zjU/seBY3i4KyX7N58C3BMrMhUi'),(7,'[email protected]','Mabelle','Konopelski',15,'Female',NULL,'2017-11-07 19:42:06','2017-11-07 19:42:06','$2a$10$jHYRIODjObqmzW9FN5ONyuWTl7tFwWh8lZ1Zi.HduhLfEEgLv/.si'),(8,'[email protected]','Annette','Konopelski',16,'Male',NULL,'2017-11-07 19:42:06','2017-11-07 19:42:06','$2a$10$wzb.nZmPUvBGib8wXe1V0eS.qDbJEiZZfWAlHRnjFc.iY4omHKw1K'),(9,'[email protected]','Blaise','Bartell',17,'Female',NULL,'2017-11-07 19:42:07','2017-11-07 19:42:07','$2a$10$yR8fJ4XZgX4SBX6ZsgWHlepz.DHFLGWxKo13p4YZ/ybjNaAWxlqP6'),(10,'[email protected]','Nina','Eichmann',18,'Male',NULL,'2017-11-07 19:42:07','2017-11-07 19:42:07','$2a$10$Og5dSVvlDhHMFjaZFWN2Ee1TRmZ5fuq2Yb8BCpzdRla00cxahsfri'),(11,'[email protected]','Brigitte','Bogisich',19,'Female',NULL,'2017-11-07 19:42:07','2017-11-07 19:42:07','$2a$10$jTg2vcmc.CTtdmFdqS.dCeEys7GYaZ8qx.c8P2EyX2pPNMrm7Jmla'),(12,'[email protected]','Gordon','Breitenberg',20,'Male',NULL,'2017-11-07 19:42:08','2017-11-07 19:42:08','$2a$10$VS1.Y202UwOgkuwmjRQKjuGtU.lLSa7jhR4.Kir6nHsiK53KjmGYi'),(13,'[email protected]','Kay','Pacocha',21,'Female',NULL,'2017-11-07 19:42:08','2017-11-07 19:42:08','$2a$10$mTcM7C3ynh0G5FESOGkFv.MyCBi93et6smh115f5k.OmFLGNXxXgS'),(14,'[email protected]','Buster','Parker',22,'Male',NULL,'2017-11-07 19:42:08','2017-11-07 19:42:08','$2a$10$6BgGvFitNA9POLRfvuzHEeKk0gx4CKs/KAwkC6tJd6hEhNe9R51rC'),(15,'[email protected]','Dominic','Schuppe',23,'Female',NULL,'2017-11-07 19:42:09','2017-11-07 19:42:09','$2a$10$tXAQaB9SLFn9FgNCJBoKZ.BEe5hVGYk5JFD5XN91fhfvVyl6Dkkxi'),(16,'[email protected]','Heidi','Gleason',24,'Male',NULL,'2017-11-07 19:42:09','2017-11-07 19:42:09','$2a$10$MRL3BgSGo.kfi//MPDm2x.mryL.jUMOSd7MhBt3..4gCQusJEs/vK'),(17,'[email protected]','Jannie','Beer',25,'Female',NULL,'2017-11-07 19:42:09','2017-11-07 19:42:09','$2a$10$tx4PH9pMLfeNsQ4iU/N.geMvvJAsw4xLaZ4gqfwCz6ZnnmsXsteJG'),(18,'[email protected]','Magnus','West',26,'Male',NULL,'2017-11-07 19:42:10','2017-11-07 19:42:10','$2a$10$CGXmfFl3TluS32hPIu6txu6ZjAwAfYrD7fspcFzTsnNxCFXa0BZQq'),(19,'[email protected]','Breanne','Hills',27,'Female',NULL,'2017-11-07 19:42:10','2017-11-07 19:42:10','$2a$10$2VDWAG8LcMii6g4mjZsYYOSPPv.ZjH9oofYcntPd2JHEcOc5yFyJe'),(20,'[email protected]','Sylvester','Champlin',28,'Male',NULL,'2017-11-07 19:42:10','2017-11-07 19:42:10','$2a$10$6EbP8G4YI6OjZBJ.QGpJSOvRS.FbiuxIjb156HVodukVT93N2LiL2'),(21,'[email protected]','Melba','Lehner',29,'Female',NULL,'2017-11-07 19:42:11','2017-11-07 19:42:11','$2a$10$iEocWzmZ0eO3oNuAVu0Bqe4XtgOGzaxwjVwN6d79g25UGLTW67uVG'); | |
/*!40000 ALTER TABLE `users` 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 2017-11-07 15:43:51 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment