Change ID fields in SQL to be unique
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
-- chat index table
|
||||
CREATE TABLE IF NOT EXISTS chat_index (
|
||||
id TEXT NOT NULL,
|
||||
id TEXT NOT NULL UNIQUE,
|
||||
is_group_chat BOOLEAN DEFAULT 0 NOT NULL CHECK (is_group_chat IN (0, 1)),
|
||||
title TEXT NOT NULL,
|
||||
description TEXT,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
-- msgdata_template definition
|
||||
-- TODO Add IF NOT EXISTS to prevent panics
|
||||
CREATE TABLE msgdata_{chat_id} (
|
||||
msg_id TEXT NOT NULL,
|
||||
msg_id TEXT NOT NULL UNIQUE,
|
||||
timestamp INTEGER NOT NULL,
|
||||
sender_id TEXT NOT NULL,
|
||||
msg_type INTEGER NOT NULL,
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
user_name TEXT NOT NULL,
|
||||
user_name TEXT NOT NULL UNIQUE,
|
||||
display_name TEXT,
|
||||
activated BOOLEAN DEFAULT 0 NOT NULL CHECK (activated IN (0, 1)),
|
||||
created INTEGER NOT NULL,
|
||||
|
Reference in New Issue
Block a user