mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-27 21:42:16 -08:00
User persistence to sqlite.
This commit is contained in:
parent
48ca57c43d
commit
ccdf7779a5
12 changed files with 172 additions and 115 deletions
26
sql/init.sql
26
sql/init.sql
|
|
@ -1,10 +1,20 @@
|
|||
CREATE TABLE user (id integer not null primary key autoincrement, nick text not null, hash blob not null)
|
||||
CREATE UNIQUE INDEX user_id ON user (id)
|
||||
CREATE UNIQUE INDEX user_nick ON user (nick)
|
||||
CREATE TABLE user (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
nick TEXT NOT NULL UNIQUE,
|
||||
hash BLOB NOT NULL
|
||||
);
|
||||
CREATE INDEX index_user_id ON user(id);
|
||||
CREATE INDEX index_user_nick ON user(nick);
|
||||
|
||||
CREATE TABLE channel (id integer not null primary key autoincrement, name text not null)
|
||||
CREATE UNIQUE INDEX channel_id ON channel (id)
|
||||
CREATE UNIQUE INDEX channel_name ON channel (name)
|
||||
CREATE TABLE channel (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
name TEXT NOT NULL UNIQUE
|
||||
);
|
||||
CREATE INDEX index_channel_id ON channel(id);
|
||||
|
||||
CREATE_TABLE user_channel (id integer not null primary key autoincrement, user_id integer not null, channel_id integer not null)
|
||||
CREATE UNIQUE INDEX user_id_channel_id ON user_channel (user_id, channel_id)
|
||||
CREATE TABLE user_channel (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
user_id INTEGER NOT NULL,
|
||||
channel_id INTEGER NOT NULL
|
||||
);
|
||||
CREATE UNIQUE INDEX index_user_id_channel_id ON user_channel (user_id, channel_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue