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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. DROP TABLE cache_index;
  2. DROP TABLE cache_thread;
  3. DROP TABLE cache_messages;
  4. ALTER TABLE cache ADD expires datetime DEFAULT NULL;
  5. DROP INDEX ix_cache_created;
  6. ALTER TABLE cache_shared ADD expires datetime DEFAULT NULL;
  7. DROP INDEX ix_cache_shared_created;
  8. UPDATE cache SET expires = datetime(created, '+604800 seconds');
  9. UPDATE cache_shared SET expires = datetime(created, '+604800 seconds');
  10. CREATE INDEX ix_cache_expires ON cache(expires);
  11. CREATE INDEX ix_cache_shared_expires ON cache_shared(expires);
  12. CREATE TABLE cache_index (
  13. user_id integer NOT NULL,
  14. mailbox varchar(255) NOT NULL,
  15. expires datetime DEFAULT NULL,
  16. valid smallint NOT NULL DEFAULT '0',
  17. data text NOT NULL,
  18. PRIMARY KEY (user_id, mailbox)
  19. );
  20. CREATE INDEX ix_cache_index_expires ON cache_index (expires);
  21. CREATE TABLE cache_thread (
  22. user_id integer NOT NULL,
  23. mailbox varchar(255) NOT NULL,
  24. expires datetime DEFAULT NULL,
  25. data text NOT NULL,
  26. PRIMARY KEY (user_id, mailbox)
  27. );
  28. CREATE INDEX ix_cache_thread_expires ON cache_thread (expires);
  29. CREATE TABLE cache_messages (
  30. user_id integer NOT NULL,
  31. mailbox varchar(255) NOT NULL,
  32. uid integer NOT NULL,
  33. expires datetime DEFAULT NULL,
  34. data text NOT NULL,
  35. flags integer NOT NULL DEFAULT '0',
  36. PRIMARY KEY (user_id, mailbox, uid)
  37. );
  38. CREATE INDEX ix_cache_messages_expires ON cache_messages (expires);