From 8a8a5167734f573b97db94d6a38875d8601e75dc Mon Sep 17 00:00:00 2001 From: errorage Date: Sun, 21 Apr 2013 19:35:42 +0200 Subject: [PATCH] - Updates library table definition - Adds a ckey and datetime column to the library table so we can finally see who is uploading all the exploitive books. --- SQL/tgstation_schema.sql | 18 +++++++++--------- code/modules/library/lib_machines.dm | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index ea9ace77c6a..e5a2d6ba7ec 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -162,18 +162,18 @@ CREATE TABLE `erro_legacy_population` ( -- -- Table structure for table `erro_library` -- +delimiter $$ -DROP TABLE IF EXISTS `erro_library`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; CREATE TABLE `erro_library` ( - `id` int(11) NOT NULL DEFAULT '0', - `author` text NOT NULL, - `title` text NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(45) NOT NULL, + `title` varchar(45) NOT NULL, `content` text NOT NULL, - `category` text NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; + `category` varchar(45) NOT NULL, + `ckey` varchar(45) DEFAULT 'LEGACY', + `datetime` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5370 DEFAULT CHARSET=latin1$$ -- -- Table structure for table `erro_player` diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index d5c6a696b67..110b79ed8d1 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -351,7 +351,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f var/sqlauthor = sanitizeSQL(scanner.cache.author) var/sqlcontent = sanitizeSQL(scanner.cache.dat) var/sqlcategory = sanitizeSQL(upload_category) - var/DBQuery/query = dbcon.NewQuery("INSERT INTO erro_library (author, title, content, category) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]')") + var/DBQuery/query = dbcon.NewQuery("INSERT INTO erro_library (author, title, content, category, ckey, datetime) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now())") if(!query.Execute()) usr << query.ErrorMsg() else