Created
November 13, 2011 23:56
-
-
Save ZenCocoon/1362938 to your computer and use it in GitHub Desktop.
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
| -- How to get all queries that has not been used by the site id 1 ? | |
| DROP TABLE IF EXISTS `queries`; | |
| SET @saved_cs_client = @@character_set_client; | |
| SET character_set_client = utf8; | |
| CREATE TABLE `queries` ( | |
| `id` int(11) NOT NULL auto_increment, | |
| `created_at` datetime default NULL, | |
| `updated_at` datetime default NULL, | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| SET character_set_client = @saved_cs_client; | |
| DROP TABLE IF EXISTS `sites`; | |
| SET @saved_cs_client = @@character_set_client; | |
| SET character_set_client = utf8; | |
| CREATE TABLE `sites` ( | |
| `id` int(11) NOT NULL auto_increment, | |
| `created_at` datetime default NULL, | |
| `updated_at` datetime default NULL, | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| SET character_set_client = @saved_cs_client; | |
| DROP TABLE IF EXISTS `sites_queries`; | |
| SET @saved_cs_client = @@character_set_client; | |
| SET character_set_client = utf8; | |
| CREATE TABLE `sites_queries` ( | |
| `id` int(11) NOT NULL auto_increment, | |
| `site_id` int(11) NOT NULL, | |
| `query_id` int(11) NOT NULL, | |
| `created_at` datetime default NULL, | |
| `updated_at` datetime default NULL, | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| SET character_set_client = @saved_cs_client; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment