Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

2013061000.sql 1.3KB

123456789101112131415161718192021222324
  1. ALTER TABLE "cache" ADD expires timestamp with time zone DEFAULT NULL;
  2. ALTER TABLE "cache_shared" ADD expires timestamp with time zone DEFAULT NULL;
  3. ALTER TABLE "cache_index" ADD expires timestamp with time zone DEFAULT NULL;
  4. ALTER TABLE "cache_thread" ADD expires timestamp with time zone DEFAULT NULL;
  5. ALTER TABLE "cache_messages" ADD expires timestamp with time zone DEFAULT NULL;
  6. -- initialize expires column with created/changed date + 7days
  7. UPDATE "cache" SET expires = created + interval '604800 seconds';
  8. UPDATE "cache_shared" SET expires = created + interval '604800 seconds';
  9. UPDATE "cache_index" SET expires = changed + interval '604800 seconds';
  10. UPDATE "cache_thread" SET expires = changed + interval '604800 seconds';
  11. UPDATE "cache_messages" SET expires = changed + interval '604800 seconds';
  12. DROP INDEX cache_created_idx;
  13. DROP INDEX cache_shared_created_idx;
  14. ALTER TABLE "cache_index" DROP "changed";
  15. ALTER TABLE "cache_thread" DROP "changed";
  16. ALTER TABLE "cache_messages" DROP "changed";
  17. CREATE INDEX cache_expires_idx ON "cache" (expires);
  18. CREATE INDEX cache_shared_expires_idx ON "cache_shared" (expires);
  19. CREATE INDEX cache_index_expires_idx ON "cache_index" (expires);
  20. CREATE INDEX cache_thread_expires_idx ON "cache_thread" (expires);
  21. CREATE INDEX cache_messages_expires_idx ON "cache_messages" (expires);