From 6d6bca86f56ad7334034ca634a0840095b7492c9 Mon Sep 17 00:00:00 2001 From: Leigh B Stoller Date: Tue, 31 Dec 2013 11:49:55 -0700 Subject: [PATCH] Add urlhash and urlstamp to tiplines table to allow for temporary magic URLs that grant access to console lines. --- sql/database-create.sql | 2 ++ sql/updates/4/374 | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 sql/updates/4/374 diff --git a/sql/database-create.sql b/sql/database-create.sql index 66a454b22..3829bfb11 100644 --- a/sql/database-create.sql +++ b/sql/database-create.sql @@ -4117,6 +4117,8 @@ CREATE TABLE `tiplines` ( `portnum` int(11) NOT NULL default '0', `keylen` smallint(6) NOT NULL default '0', `keydata` text, + `urlhash` varchar(64) default NULL, + `urlstamp` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`tipname`), KEY `node_id` (`node_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; diff --git a/sql/updates/4/374 b/sql/updates/4/374 new file mode 100644 index 000000000..3862f02e7 --- /dev/null +++ b/sql/updates/4/374 @@ -0,0 +1,25 @@ +# +# Add url hash and stamp to tiplines +# +use strict; +use libdb; + +sub DoUpdate($$$) +{ + my ($dbhandle, $dbname, $version) = @_; + + if (! DBSlotExists("tiplines", "urlhash")) { + DBQueryFatal("alter table tiplines add ". + " `urlhash` varchar(64) default NULL"); + } + if (! DBSlotExists("tiplines", "urlhash")) { + DBQueryFatal("alter table tiplines add ". + " `urlstamp` int(10) unsigned NOT NULL default '0'"); + } + return 0; +} +1; + +# Local Variables: +# mode:perl +# End: -- GitLab