You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.sql 579B

1234567891011121314151617181920
  1. CREATE TABLE user (
  2. id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  3. nick TEXT NOT NULL UNIQUE,
  4. hash BLOB NOT NULL
  5. );
  6. CREATE INDEX index_user_id ON user(id);
  7. CREATE INDEX index_user_nick ON user(nick);
  8. CREATE TABLE channel (
  9. id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  10. name TEXT NOT NULL UNIQUE
  11. );
  12. CREATE INDEX index_channel_id ON channel(id);
  13. CREATE TABLE user_channel (
  14. id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  15. user_id INTEGER NOT NULL,
  16. channel_id INTEGER NOT NULL
  17. );
  18. CREATE UNIQUE INDEX index_user_id_channel_id ON user_channel (user_id, channel_id);