From 5e697346a2a13e04cd9877c40eea9e3192415de2 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Sun, 8 Oct 2017 10:57:50 +0200 Subject: [PATCH] [fix] fixing primary key issue on csrf --- install/mysql.sql | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/install/mysql.sql b/install/mysql.sql index 7c4d363d..6f85452c 100644 --- a/install/mysql.sql +++ b/install/mysql.sql @@ -755,17 +755,16 @@ CREATE TABLE IF NOT EXISTS `alternc_status` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT = 'stores current AlternC schema version number'; - - +-- csrf token table CREATE TABLE IF NOT EXISTS `csrf` ( `cookie` char(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL, `token` char(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL, `created` datetime NOT NULL, - `used` tinyint(3) unsigned NOT NULL DEFAULT '0' + `used` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`cookie`,`token`), + KEY `created` (`created`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='csrf tokens for AlternC forms'; -ALTER TABLE `csrf` ADD PRIMARY KEY (`cookie`,`token`), ADD KEY `created` (`created`); - -- make it re-exec-proof DELETE FROM alternc_status WHERE name='alternc_version';