mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-04 23:34:01 +01:00
Fixed redundancy in sql caching system and compatibility with Galera Cluster (#5439)
- Removed redundant 'created' column from cache and cache_shared tables - Removed use of redundant data records - Added missing primary keys (dictionary, cache, cache_shared tables)
This commit is contained in:
@@ -126,23 +126,21 @@ CREATE TABLE "cache" (
|
||||
"user_id" integer NOT NULL
|
||||
REFERENCES "users" ("user_id") ON DELETE CASCADE,
|
||||
"cache_key" varchar(128) NOT NULL,
|
||||
"created" timestamp with time zone DEFAULT current_timestamp NOT NULL,
|
||||
"expires" timestamp with time zone DEFAULT NULL,
|
||||
"data" long NOT NULL
|
||||
"data" long NOT NULL,
|
||||
PRIMARY KEY ("user_id", "cache_key")
|
||||
);
|
||||
|
||||
CREATE INDEX "cache_user_id_idx" ON "cache" ("user_id", "cache_key");
|
||||
CREATE INDEX "cache_expires_idx" ON "cache" ("expires");
|
||||
|
||||
|
||||
CREATE TABLE "cache_shared" (
|
||||
"cache_key" varchar(255) NOT NULL,
|
||||
"created" timestamp with time zone DEFAULT current_timestamp NOT NULL,
|
||||
"expires" timestamp with time zone DEFAULT NULL,
|
||||
"data" long NOT NULL
|
||||
"data" long NOT NULL,
|
||||
PRIMARY KEY ("cache_key")
|
||||
);
|
||||
|
||||
CREATE INDEX "cache_shared_cache_key_idx" ON "cache_shared" ("cache_key");
|
||||
CREATE INDEX "cache_shared_expires_idx" ON "cache_shared" ("expires");
|
||||
|
||||
|
||||
@@ -219,4 +217,4 @@ CREATE TABLE "system" (
|
||||
"value" long
|
||||
);
|
||||
|
||||
INSERT INTO "system" ("name", "value") VALUES ('roundcube-version', '2016100900');
|
||||
INSERT INTO "system" ("name", "value") VALUES ('roundcube-version', '2016112200');
|
||||
|
||||
Reference in New Issue
Block a user