diff options
author | alecpl <alec@alec.pl> | 2008-11-22 18:06:13 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-11-22 18:06:13 +0000 |
commit | dcf780a6bd5065ffb0dcc76233b1e5f601e258d2 (patch) | |
tree | f1e127b3cf04f18cf3776af057edd4fa57ec36e1 /SQL | |
parent | 3e48d2eee1d2af42aa777fd5e461fa570762732e (diff) |
- fix r2076: removed cache.session_id column, removed DELETEs from cache in session_gc
- trust DB server's time when "touching" cache and messages tables
Diffstat (limited to 'SQL')
-rw-r--r-- | SQL/mssql.initial.sql | 5 | ||||
-rw-r--r-- | SQL/mysql.initial.sql | 1 | ||||
-rw-r--r-- | SQL/mysql.update.sql | 7 | ||||
-rw-r--r-- | SQL/mysql5.initial.sql | 5 | ||||
-rw-r--r-- | SQL/postgres.initial.sql | 2 | ||||
-rw-r--r-- | SQL/postgres.update.sql | 4 | ||||
-rw-r--r-- | SQL/sqlite.initial.sql | 1 |
7 files changed, 3 insertions, 22 deletions
diff --git a/SQL/mssql.initial.sql b/SQL/mssql.initial.sql index fc60a4d8d..162495781 100644 --- a/SQL/mssql.initial.sql +++ b/SQL/mssql.initial.sql @@ -1,7 +1,6 @@ CREATE TABLE [dbo].[cache] (
[cache_id] [int] IDENTITY (1, 1) NOT NULL ,
[user_id] [int] NOT NULL ,
- [session_id] [varchar] (32) COLLATE Latin1_General_CI_AI NULL ,
[cache_key] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
[created] [datetime] NOT NULL ,
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
@@ -119,7 +118,6 @@ GO ALTER TABLE [dbo].[cache] ADD
CONSTRAINT [DF_cache_user_id] DEFAULT ('0') FOR [user_id],
- CONSTRAINT [DF_cache_session_id] DEFAULT (null) FOR [session_id],
CONSTRAINT [DF_cache_cache_key] DEFAULT ('') FOR [cache_key],
CONSTRAINT [DF_cache_created] DEFAULT (getdate()) FOR [created]
GO
@@ -130,9 +128,6 @@ GO CREATE INDEX [IX_cache_cache_key] ON [dbo].[cache]([cache_key]) ON [PRIMARY]
GO
- CREATE INDEX [IX_cache_session_id] ON [dbo].[cache]([session_id]) ON [PRIMARY]
-GO
-
ALTER TABLE [dbo].[contacts] ADD
CONSTRAINT [DF_contacts_user_id] DEFAULT (0) FOR [user_id],
CONSTRAINT [DF_contacts_changed] DEFAULT (getdate()) FOR [changed],
diff --git a/SQL/mysql.initial.sql b/SQL/mysql.initial.sql index 07f127cce..0f9fc8b92 100644 --- a/SQL/mysql.initial.sql +++ b/SQL/mysql.initial.sql @@ -11,7 +11,6 @@ CREATE TABLE `cache` ( `cache_id` int(10) unsigned NOT NULL auto_increment, `user_id` int(10) unsigned NOT NULL default '0', - `session_id` varchar(40) default NULL, `cache_key` varchar(128) NOT NULL default '', `created` datetime NOT NULL default '0000-00-00 00:00:00', `data` longtext NOT NULL, diff --git a/SQL/mysql.update.sql b/SQL/mysql.update.sql index a45ace1fd..1e8979d87 100644 --- a/SQL/mysql.update.sql +++ b/SQL/mysql.update.sql @@ -34,10 +34,7 @@ ALTER TABLE `messages` -- Updates from version 0.2-beta (InnoDB only) ALTER TABLE `cache` - ADD CONSTRAINT `session_id_fk_cache` FOREIGN KEY (`session_id`) - REFERENCES `session`(`sess_id`) - ON DELETE CASCADE - ON UPDATE CASCADE; - + DROP `session_id`; + ALTER TABLE `session` ADD INDEX `changed_index` (`changed`); diff --git a/SQL/mysql5.initial.sql b/SQL/mysql5.initial.sql index 7d11288e3..b162e4ddf 100644 --- a/SQL/mysql5.initial.sql +++ b/SQL/mysql5.initial.sql @@ -68,7 +68,6 @@ CREATE TABLE `messages` ( CREATE TABLE `cache` ( `cache_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `session_id` varchar(40) CHARACTER SET ascii COLLATE ascii_general_ci, `cache_key` varchar(128) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL, `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `data` longtext NOT NULL, @@ -78,10 +77,6 @@ CREATE TABLE `cache` ( CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`) ON DELETE CASCADE - ON UPDATE CASCADE, - CONSTRAINT `session_id_fk_cache` FOREIGN KEY (`session_id`) - REFERENCES `session`(`sess_id`) - ON DELETE CASCADE ON UPDATE CASCADE ) TYPE=INNODB CHARACTER SET utf8 COLLATE utf8_general_ci; diff --git a/SQL/postgres.initial.sql b/SQL/postgres.initial.sql index 128b484d7..9fb8d32fb 100644 --- a/SQL/postgres.initial.sql +++ b/SQL/postgres.initial.sql @@ -129,14 +129,12 @@ CREATE SEQUENCE cache_ids CREATE TABLE "cache" ( cache_id integer DEFAULT nextval('cache_ids'::text) PRIMARY KEY, user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE, - session_id character varying(40) REFERENCES "session" (sess_id) ON DELETE CASCADE ON UPDATE CASCADE, cache_key character varying(128) DEFAULT ''::character varying NOT NULL, created timestamp with time zone DEFAULT now() NOT NULL, data text NOT NULL ); CREATE INDEX cache_user_id_idx ON "cache" (user_id, cache_key); -CREATE INDEX cache_session_id_idx ON "cache" (session_id); -- -- Sequence "message_ids" diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql index f9cd431b6..6832b962f 100644 --- a/SQL/postgres.update.sql +++ b/SQL/postgres.update.sql @@ -24,8 +24,6 @@ CREATE INDEX messages_created_idx ON messages (created); -- Updates from version 0.2-beta -ALTER TABLE cache DROP CONSTRAINT cache_session_id_fkey; -ALTER TABLE cache ADD FOREIGN KEY (session_id) REFERENCES session (sess_id) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE cache DROP session_id; -CREATE INDEX cache_session_id_idx ON cache (session_id); CREATE INDEX session_changed_idx ON session (changed); diff --git a/SQL/sqlite.initial.sql b/SQL/sqlite.initial.sql index d09539d6f..e78ce42b5 100644 --- a/SQL/sqlite.initial.sql +++ b/SQL/sqlite.initial.sql @@ -11,7 +11,6 @@ CREATE TABLE cache ( cache_id integer NOT NULL PRIMARY KEY, user_id integer NOT NULL default 0, - session_id varchar(40) default NULL, cache_key varchar(128) NOT NULL default '', created datetime NOT NULL default '0000-00-00 00:00:00', data longtext NOT NULL |