mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-28 14:02:19 -08:00
Encapsulate SQL statements and refactor Save functions as transactionable.
This commit is contained in:
parent
f24bb5ee7d
commit
48ca57c43d
11 changed files with 347 additions and 12 deletions
10
sql/init.sql
Normal file
10
sql/init.sql
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
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 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 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue