From 5ea73bbfba2f48659346f9e5f6aae9b4b618daa9 Mon Sep 17 00:00:00 2001
From: pep <yes@peepee.me>
Date: Fri, 24 Jul 2020 00:33:16 +0000
Subject: good

---
 bucky-schema.sql | 55 ++++++++++++++++++++++++++++++-------------------------
 1 file changed, 30 insertions(+), 25 deletions(-)

(limited to 'bucky-schema.sql')

diff --git a/bucky-schema.sql b/bucky-schema.sql
index 2adcfec..0a66ca6 100644
--- a/bucky-schema.sql
+++ b/bucky-schema.sql
@@ -31,6 +31,32 @@ CREATE TABLE `boxes` (
 ) ENGINE=MyISAM AUTO_INCREMENT=662 DEFAULT CHARSET=utf8;
 /*!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`
-- 
cgit v1.2.3-70-g09d2

