A WhatsApp (Web) transport for XMPP.
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.

19 lines
552B

  1. BEGIN;
  2. CREATE TABLE new_user_contacts (
  3. id INTEGER PRIMARY KEY,
  4. user_id INT NOT NULL REFERENCES users,
  5. wa_jid VARCHAR NOT NULL,
  6. subscription_state VARCHAR NOT NULL DEFAULT 'none',
  7. avatar_url VARCHAR,
  8. name VARCHAR,
  9. notify VARCHAR,
  10. status VARCHAR,
  11. UNIQUE(user_id, wa_jid)
  12. );
  13. INSERT INTO new_user_contacts SELECT * FROM user_contacts;
  14. DROP TABLE user_contacts;
  15. ALTER TABLE new_user_contacts RENAME TO user_contacts;
  16. CREATE INDEX user_contacts_idx ON user_contacts (user_id, wa_jid);
  17. COMMIT;