Removed useless 'created' column from 'session' table (#5389)

pull/266/merge
Aleksander Machniak 8 years ago
parent 6f150372e1
commit 0836b213db

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Removed useless 'created' column from 'session' table (#5389)
- Require PHP >= 5.4
- Add possibility to preview and download attachments in mail compose (#5053)
- Add possibility to rename attachments in mail compose (#4996)

@ -1,7 +1,6 @@
CREATE TABLE [dbo].[cache] (
[user_id] [int] NOT NULL ,
[cache_key] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL ,
[created] [datetime] NOT NULL ,
[expires] [datetime] NULL ,
[data] [text] COLLATE Latin1_General_CI_AI NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
@ -315,7 +314,6 @@ GO
ALTER TABLE [dbo].[session] ADD
CONSTRAINT [DF_session_sess_id] DEFAULT ('') FOR [sess_id],
CONSTRAINT [DF_session_created] DEFAULT (getdate()) FOR [created],
CONSTRAINT [DF_session_ip] DEFAULT ('') FOR [ip]
GO
@ -395,6 +393,6 @@ CREATE TRIGGER [contact_delete_member] ON [dbo].[contacts]
WHERE [contact_id] IN (SELECT [contact_id] FROM deleted)
GO
INSERT INTO [dbo].[system] ([name], [value]) VALUES ('roundcube-version', '2015111100')
INSERT INTO [dbo].[system] ([name], [value]) VALUES ('roundcube-version', '2016081200')
GO

@ -0,0 +1,2 @@
ALTER TABLE [dbo].[session] DROP COLUMN [created]
GO

@ -7,7 +7,6 @@
CREATE TABLE `session` (
`sess_id` varchar(128) NOT NULL,
`created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`ip` varchar(40) NOT NULL,
`vars` mediumtext NOT NULL,
@ -211,4 +210,4 @@ CREATE TABLE `system` (
/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
INSERT INTO system (name, value) VALUES ('roundcube-version', '2015111100');
INSERT INTO system (name, value) VALUES ('roundcube-version', '2016081200');

@ -0,0 +1 @@
ALTER TABLE `session` DROP COLUMN `created`;

@ -26,7 +26,6 @@ END;
CREATE TABLE "session" (
"sess_id" varchar(128) NOT NULL PRIMARY KEY,
"created" timestamp with time zone DEFAULT current_timestamp NOT NULL,
"changed" timestamp with time zone DEFAULT current_timestamp NOT NULL,
"ip" varchar(41) NOT NULL,
"vars" long NOT NULL
@ -220,4 +219,4 @@ CREATE TABLE "system" (
"value" long
);
INSERT INTO "system" ("name", "value") VALUES ('roundcube-version', '2015111100');
INSERT INTO "system" ("name", "value") VALUES ('roundcube-version', '2016081200');

@ -0,0 +1 @@
ALTER TABLE "session" DROP COLUMN "created";

@ -37,7 +37,6 @@ CREATE TABLE users (
CREATE TABLE "session" (
sess_id varchar(128) DEFAULT '' PRIMARY KEY,
created timestamp with time zone DEFAULT now() NOT NULL,
changed timestamp with time zone DEFAULT now() NOT NULL,
ip varchar(41) NOT NULL,
vars text NOT NULL
@ -292,4 +291,4 @@ CREATE TABLE "system" (
value text
);
INSERT INTO system (name, value) VALUES ('roundcube-version', '2015111100');
INSERT INTO system (name, value) VALUES ('roundcube-version', '2016081200');

@ -0,0 +1 @@
ALTER TABLE "session" DROP COLUMN created;

@ -86,7 +86,6 @@ CREATE UNIQUE INDEX ix_users_username ON users(username, mail_host);
CREATE TABLE session (
sess_id varchar(128) NOT NULL PRIMARY KEY,
created datetime NOT NULL default '0000-00-00 00:00:00',
changed datetime NOT NULL default '0000-00-00 00:00:00',
ip varchar(40) NOT NULL default '',
vars text NOT NULL
@ -203,4 +202,4 @@ CREATE TABLE system (
value text NOT NULL
);
INSERT INTO system (name, value) VALUES ('roundcube-version', '2015111100');
INSERT INTO system (name, value) VALUES ('roundcube-version', '2016081200');

@ -0,0 +1,9 @@
DROP TABLE session;
CREATE TABLE session (
sess_id varchar(128) NOT NULL PRIMARY KEY,
changed datetime NOT NULL default '0000-00-00 00:00:00',
ip varchar(40) NOT NULL default '',
vars text NOT NULL
);
CREATE INDEX ix_session_changed ON session (changed);

@ -126,8 +126,8 @@ class rcube_session_db extends rcube_session
$now = $this->db->now();
$this->db->query("INSERT INTO {$this->table_name}"
. " (`sess_id`, `vars`, `ip`, `created`, `changed`)"
. " VALUES (?, ?, ?, $now, $now)",
. " (`sess_id`, `vars`, `ip`, `changed`)"
. " VALUES (?, ?, ?, $now)",
$key, base64_encode($vars), (string)$this->ip);
return true;

Loading…
Cancel
Save