diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index ea9ace77c6a..54e5a628563 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -164,16 +164,16 @@ CREATE TABLE `erro_legacy_population` ( -- 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