pgsql-update.sql 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. -- 19.02
  2. CREATE TABLE mix_channel (
  3. channel text NOT NULL,
  4. service text NOT NULL,
  5. username text NOT NULL,
  6. domain text NOT NULL,
  7. jid text NOT NULL,
  8. hidden boolean NOT NULL,
  9. hmac_key text NOT NULL,
  10. created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  11. );
  12. CREATE UNIQUE INDEX i_mix_channel ON mix_channel (channel, service);
  13. CREATE INDEX i_mix_channel_serv ON mix_channel (service);
  14. CREATE TABLE mix_participant (
  15. channel text NOT NULL,
  16. service text NOT NULL,
  17. username text NOT NULL,
  18. domain text NOT NULL,
  19. jid text NOT NULL,
  20. id text NOT NULL,
  21. nick text NOT NULL,
  22. created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  23. );
  24. CREATE UNIQUE INDEX i_mix_participant ON mix_participant (channel, service, username, domain);
  25. CREATE INDEX i_mix_participant_chan_serv ON mix_participant (channel, service);
  26. CREATE TABLE mix_subscription (
  27. channel text NOT NULL,
  28. service text NOT NULL,
  29. username text NOT NULL,
  30. domain text NOT NULL,
  31. node text NOT NULL,
  32. jid text NOT NULL
  33. );
  34. CREATE UNIQUE INDEX i_mix_subscription ON mix_subscription (channel, service, username, domain, node);
  35. CREATE INDEX i_mix_subscription_chan_serv_ud ON mix_subscription (channel, service, username, domain);
  36. CREATE INDEX i_mix_subscription_chan_serv_node ON mix_subscription (channel, service, node);
  37. CREATE INDEX i_mix_subscription_chan_serv ON mix_subscription (channel, service);
  38. CREATE TABLE mix_pam (
  39. username text NOT NULL,
  40. channel text NOT NULL,
  41. service text NOT NULL,
  42. id text NOT NULL,
  43. created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  44. );
  45. CREATE UNIQUE INDEX i_mix_pam ON mix_pam (username, channel, service);
  46. CREATE INDEX i_mix_pam_us ON mix_pam (username);
  47. -- 20.01
  48. CREATE TABLE oauth_client (
  49. client_id text PRIMARY KEY,
  50. client_name text NOT NULL,
  51. grant_type text NOT NULL,
  52. options text NOT NULL
  53. );