From 6cd35dbc723a64720c08a331ede9e605df11b8b4 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Sat, 28 Jan 2023 19:58:01 +0300
Subject: CI: enable sqlserver job

---
 src/main/resources/schema-sqlserver.sql | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

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

diff --git a/src/main/resources/schema-sqlserver.sql b/src/main/resources/schema-sqlserver.sql
index 5fbe9569..71539577 100644
--- a/src/main/resources/schema-sqlserver.sql
+++ b/src/main/resources/schema-sqlserver.sql
@@ -9,6 +9,7 @@ CREATE TABLE users (
     lastphoto bigint DEFAULT (0) NOT NULL,
     karma smallint DEFAULT (0) NOT NULL,
     last_seen datetimeoffset,
+    UNIQUE(nick),
     PRIMARY KEY (id)
 );
 CREATE TABLE user_services (
@@ -30,7 +31,7 @@ CREATE TABLE tags (
     tag_id INTEGER IDENTITY(1,1) PRIMARY KEY NOT NULL,
     synonym_id integer,
     name character varying(70),
-    [top] bit DEFAULT 0 NOT NULL,
+    notop bit DEFAULT 0 NOT NULL,
     noindex bit DEFAULT 0 NOT NULL,
     stat_messages bigint DEFAULT (0) NOT NULL,
     stat_users smallint DEFAULT (0) NOT NULL,
@@ -120,7 +121,7 @@ CREATE TABLE meon (
 CREATE TABLE messages (
     message_id INTEGER IDENTITY(1,1) PRIMARY KEY NOT NULL,
     user_id bigint NOT NULL,
-    lang TEXT DEFAULT '__' NOT NULL,
+    lang varchar(max) DEFAULT '__' NOT NULL,
     ts datetimeoffset DEFAULT CURRENT_TIMESTAMP NOT NULL,
     replies smallint DEFAULT (0) NOT NULL,
     maxreplyid smallint DEFAULT (0) NOT NULL,
@@ -143,7 +144,7 @@ CREATE TABLE messages_access (
     FOREIGN KEY (message_id) REFERENCES messages(message_id)
 );
 CREATE TABLE messages_properties (
-    message_id INTEGER PRIMARY KEY NOT NULL,
+    message_id INTEGER NOT NULL,
     reply_id smallint NOT NULL,
     property_key character varying(255) NOT NULL,
     property_value character varying(255) NOT NULL,
@@ -181,7 +182,7 @@ CREATE TABLE pm (
     user_id bigint NOT NULL,
     user_id_to bigint NOT NULL,
     ts datetimeoffset DEFAULT CURRENT_TIMESTAMP NOT NULL,
-    txt text NOT NULL,
+    txt varchar(max) NOT NULL,
     FOREIGN KEY (user_id) REFERENCES users(id),
     FOREIGN KEY (user_id_to) REFERENCES users(id)
 );
@@ -192,7 +193,7 @@ CREATE TABLE replies (
     replyto smallint DEFAULT (0) NOT NULL,
     ts datetimeoffset DEFAULT CURRENT_TIMESTAMP NOT NULL,
     attach VARCHAR(10) CHECK (attach IN ('jpg', 'mp4', 'png')),
-    txt text NOT NULL,
+    txt varchar(max) NOT NULL,
     updated_at datetimeoffset DEFAULT CURRENT_TIMESTAMP NOT NULL,
     user_uri character varying(255) DEFAULT NULL,
     reply_uri character varying(255) DEFAULT NULL,
@@ -270,7 +271,7 @@ CREATE TABLE usersinfo (
     url character varying(128),
     gender character varying(32),
     bday character varying(32),
-    descr text,
+    descr varchar(max),
     UNIQUE(user_id),
     FOREIGN KEY (user_id) REFERENCES users(id)
 );
-- 
cgit v1.2.3

