Skip to content

Instantly share code, notes, and snippets.

@walter
Created August 23, 2011 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walter/1164428 to your computer and use it in GitHub Desktop.
Save walter/1164428 to your computer and use it in GitHub Desktop.
MySQL dump with issue
-- you'll need a users table with corresponding roles for ids 1-6
--
-- Table structure for table `roles`
--
DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
`authorizable_type` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
`authorizable_id` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `roles`
--
LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES (1,'site_admin','Basket',1,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(2,'admin','Basket',2,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(3,'admin','Basket',3,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(4,'tech_admin','Basket',1,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(5,'admin','Basket',4,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(6,'member','Basket',1,'2011-08-03 10:58:06','2011-08-03 10:58:06');
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `roles_users`
--
DROP TABLE IF EXISTS `roles_users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles_users` (
`user_id` int(11) DEFAULT NULL,
`role_id` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
KEY `user_id` (`user_id`),
KEY `role_id` (`role_id`),
CONSTRAINT `roles_users_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `roles_users_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `roles_users`
--
----WORKING VERSION!!!!
LOCK TABLES `roles_users` WRITE;
/*!40000 ALTER TABLE `roles_users` DISABLE KEYS */;
INSERT INTO `roles_users` VALUES (1,2,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(2,6,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(1,5,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(1,4,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(1,3,'2011-08-03 10:58:06','2011-08-03 10:58:06'),(1,1,'2011-08-03 10:58:06','2011-08-03 10:58:06');
/*!40000 ALTER TABLE `roles_users` ENABLE KEYS */;
UNLOCK TABLES;
----END WORKING VERSION!!!!
----NOT WORKING VERSION!!!!
LOCK TABLES `roles_users` WRITE;
/*!40000 ALTER TABLE `roles_users` DISABLE KEYS */;
INSERT INTO `roles_users` VALUES (1,2,'2011-08-01 22:29:58','2011-08-01 22:29:58'),(2,6,'2011-08-01 22:29:58','2011-08-01 22:29:58'),(1,5,'2011-08-01 22:29:58','2011-08-01 22:29:58'),(1,4,'2011-08-01 22:29:58','2011-08-01 22:\
29:58'),(1,3,'2011-08-01 22:29:58','2011-08-01 22:29:58'),(1,1,'2011-08-01 22:29:58','2011-08-01 22:29:58');
/*!40000 ALTER TABLE `roles_users` ENABLE KEYS */;
UNLOCK TABLES;
----END NOT WORKING VERSION!!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment