aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/schema-sqlserver.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/schema-sqlserver.sql')
-rw-r--r--src/main/resources/schema-sqlserver.sql13
1 files changed, 7 insertions, 6 deletions
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)
);