summaryrefslogtreecommitdiff
path: root/bucky-schema.sql
diff options
context:
space:
mode:
Diffstat (limited to 'bucky-schema.sql')
-rw-r--r--bucky-schema.sql55
1 files changed, 30 insertions, 25 deletions
diff --git a/bucky-schema.sql b/bucky-schema.sql
index 2adcfec..0a66ca6 100644
--- a/bucky-schema.sql
+++ b/bucky-schema.sql
@@ -32,6 +32,32 @@ CREATE TABLE `boxes` (
/*!40101 SET character_set_client = @saved_cs_client */;
--
+-- Table structure for table `threads`
+--
+
+DROP TABLE IF EXISTS `threads`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `threads` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `title` varchar(64) NOT NULL DEFAULT '',
+ `username` varchar(16) NOT NULL DEFAULT '',
+ `keyword` varchar(16) DEFAULT NULL,
+ `createdate` int(11) NOT NULL DEFAULT 0,
+ `lastmodified` int(11) DEFAULT NULL,
+ `size` int(11) DEFAULT NULL,
+ `privacy` smallint(6) DEFAULT 0,
+ `allowed` varchar(500) DEFAULT NULL,
+ `flagged` int(11) DEFAULT NULL,
+ `color` varchar(16) DEFAULT NULL,
+ `viewed` int(11) DEFAULT NULL,
+ `revision` int(11) DEFAULT 0,
+ `settings` varchar(512) DEFAULT '{}',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=4504 DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
-- Table structure for table `comments`
--
@@ -50,6 +76,8 @@ CREATE TABLE `comments` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=35359 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
+alter table comments add foreign key (thread) references threads(id);
+
--
-- Table structure for table `files`
@@ -70,6 +98,8 @@ CREATE TABLE `files` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=29503 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
+alter table files add foreign key (thread) references threads(id);
+
--
-- Table structure for table `invites`
@@ -144,31 +174,6 @@ CREATE TABLE `search_log` (
) ENGINE=MyISAM AUTO_INCREMENT=12711 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
---
--- Table structure for table `threads`
---
-
-DROP TABLE IF EXISTS `threads`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `threads` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `title` varchar(64) NOT NULL DEFAULT '',
- `username` varchar(16) NOT NULL DEFAULT '',
- `keyword` varchar(16) DEFAULT NULL,
- `createdate` int(11) NOT NULL DEFAULT 0,
- `lastmodified` int(11) DEFAULT NULL,
- `size` int(11) DEFAULT NULL,
- `privacy` smallint(6) DEFAULT 0,
- `allowed` varchar(500) DEFAULT NULL,
- `flagged` int(11) DEFAULT NULL,
- `color` varchar(16) DEFAULT NULL,
- `viewed` int(11) DEFAULT NULL,
- `revision` int(11) DEFAULT 0,
- `settings` varchar(512) DEFAULT '{}',
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=4504 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`