summaryrefslogtreecommitdiff
path: root/sql/lite.sql
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2017-02-22 11:09:15 +0100
committerChristophe Romain <christophe.romain@process-one.net>2017-02-22 15:47:36 +0100
commit56df6e7ba83ee615296691696f638dfc89dd4da8 (patch)
treef540cf0c7228c2794870ebb8167c55ea43ea6547 /sql/lite.sql
parentMove archive tables into lite.sql for better comparison with other schemas (diff)
Add missing NOT NULL restrictions
Diffstat (limited to 'sql/lite.sql')
-rw-r--r--sql/lite.sql34
1 files changed, 17 insertions, 17 deletions
diff --git a/sql/lite.sql b/sql/lite.sql
index 2a52c012..3e923176 100644
--- a/sql/lite.sql
+++ b/sql/lite.sql
@@ -41,7 +41,7 @@ CREATE TABLE rosterusers (
ask character(1) NOT NULL,
askmessage text NOT NULL,
server character(1) NOT NULL,
- subscribe text,
+ subscribe text NOT NULL,
type text,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
@@ -206,10 +206,10 @@ CREATE TABLE roster_version (
);
CREATE TABLE pubsub_node (
- host text,
- node text,
- parent text,
- type text,
+ host text NOT NULL,
+ node text NOT NULL,
+ parent text NOT NULL DEFAULT '',
+ type text NOT NULL,
nodeid INTEGER PRIMARY KEY AUTOINCREMENT
);
CREATE INDEX i_pubsub_node_parent ON pubsub_node (parent);
@@ -217,22 +217,22 @@ CREATE UNIQUE INDEX i_pubsub_node_tuple ON pubsub_node (host, node);
CREATE TABLE pubsub_node_option (
nodeid bigint REFERENCES pubsub_node(nodeid) ON DELETE CASCADE,
- name text,
- val text
+ name text NOT NULL,
+ val text NOT NULL
);
CREATE INDEX i_pubsub_node_option_nodeid ON pubsub_node_option (nodeid);
CREATE TABLE pubsub_node_owner (
nodeid bigint REFERENCES pubsub_node(nodeid) ON DELETE CASCADE,
- owner text
+ owner text NOT NULL
);
CREATE INDEX i_pubsub_node_owner_nodeid ON pubsub_node_owner (nodeid);
CREATE TABLE pubsub_state (
nodeid bigint REFERENCES pubsub_node(nodeid) ON DELETE CASCADE,
- jid text,
+ jid text NOT NULL,
affiliation character(1),
- subscriptions text,
+ subscriptions text NOT NULL DEFAULT '',
stateid INTEGER PRIMARY KEY AUTOINCREMENT
);
CREATE INDEX i_pubsub_state_jid ON pubsub_state (jid);
@@ -240,19 +240,19 @@ CREATE UNIQUE INDEX i_pubsub_state_tuple ON pubsub_state (nodeid, jid);
CREATE TABLE pubsub_item (
nodeid bigint REFERENCES pubsub_node(nodeid) ON DELETE CASCADE,
- itemid text,
- publisher text,
- creation text,
- modification text,
- payload text
+ itemid text NOT NULL,
+ publisher text NOT NULL,
+ creation text NOT NULL,
+ modification text NOT NULL,
+ payload text NOT NULL DEFAULT ''
);
CREATE INDEX i_pubsub_item_itemid ON pubsub_item (itemid);
CREATE UNIQUE INDEX i_pubsub_item_tuple ON pubsub_item (nodeid, itemid);
CREATE TABLE pubsub_subscription_opt (
- subid text,
+ subid text NOT NULL,
opt_name varchar(32),
- opt_value text
+ opt_value text NOT NULL
);
CREATE UNIQUE INDEX i_pubsub_subscription_opt ON pubsub_subscription_opt (subid, opt_name);