From 8a0fbbd35c13054a947ea0d27ca117542bc452b9 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Fri, 18 May 2018 15:33:38 +0300
Subject: JPA WIP

---
 juick-server/src/main/resources/schema.sql | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

(limited to 'juick-server/src/main/resources/schema.sql')

diff --git a/juick-server/src/main/resources/schema.sql b/juick-server/src/main/resources/schema.sql
index 296fd486..990be36b 100644
--- a/juick-server/src/main/resources/schema.sql
+++ b/juick-server/src/main/resources/schema.sql
@@ -90,14 +90,6 @@ CREATE TABLE IF NOT EXISTS `messages_tags` (
   UNIQUE KEY `message_id_2` (`message_id`,`tag_id`)
 );
 
-CREATE TABLE IF NOT EXISTS `messages_txt` (
-  `message_id` int(10) unsigned NOT NULL,
-  `tags` varchar(255) DEFAULT NULL,
-  `repliesby` varchar(96) DEFAULT NULL,
-  `txt` mediumtext NOT NULL,
-  PRIMARY KEY (`message_id`)
-);
-
 CREATE TABLE IF NOT EXISTS `messages_votes` (
   `message_id` int(10) unsigned NOT NULL,
   `user_id` int(10) unsigned NOT NULL,
@@ -341,6 +333,13 @@ CREATE TABLE IF NOT EXISTS `messages` (
   `updated` timestamp(9) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (`user_id`) references users(id)
 );
+CREATE TABLE IF NOT EXISTS `messages_txt` (
+  `message_id` int(10) unsigned NOT NULL,
+  `tags` varchar(255) DEFAULT NULL,
+  `repliesby` varchar(96) DEFAULT NULL,
+  `txt` mediumtext NOT NULL,
+  FOREIGN KEY (message_id) references messages(message_id)
+);
 CREATE TABLE IF NOT EXISTS `pm_inroster` (
   `user_id` int(10) unsigned NOT NULL,
   `jid` char(64) NOT NULL,
-- 
cgit v1.2.3

