markov: Update gitignore to allow db.sql to be added
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,7 +1,7 @@
|
|||||||
# Don't add production config.toml to the repo
|
# Don't add production config.toml to the repo
|
||||||
config.toml
|
config.toml
|
||||||
# Ignore markov data (default path)
|
# Ignore markov data (default path)
|
||||||
data/markov/
|
data/markov/markov.db
|
||||||
|
|
||||||
# Pickle files
|
# Pickle files
|
||||||
*.pkl
|
*.pkl
|
||||||
|
|||||||
19
data/markov/db.sql
Normal file
19
data/markov/db.sql
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS user (
|
||||||
|
id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
|
nick varchar(255) NOT NULL,
|
||||||
|
channel varchar(255) NOT NULL,
|
||||||
|
reply_chance real NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS user_nick_channel ON user(nick, channel);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS chain (
|
||||||
|
id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
|
user integer NOT NULL,
|
||||||
|
value text NOT NULL,
|
||||||
|
weight integer NOT NULL DEFAULT 1,
|
||||||
|
next text NOT NULL,
|
||||||
|
FOREIGN KEY(user) REFERENCES user(id)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX IF NOT EXISTS chain_value_next ON chain(user, value, next);
|
||||||
Reference in New Issue
Block a user