diff --git a/SQL/database_changelog.txt b/SQL/database_changelog.txt index 9835d792f6e4..85afa5fa07d2 100644 --- a/SQL/database_changelog.txt +++ b/SQL/database_changelog.txt @@ -1,3 +1,13 @@ +3 July 2016, by Jordie0608 + +Modified table 'poll_question', adding column 'dontshow' which was recently added to the server schema. + +ALTER TABLE `feedback`.`poll_question` ADD COLUMN `dontshow` TINYINT(1) NOT NULL DEFAULT '0' AFTER `for_trialmin` + +Remember to add a prefix to the table name if you use them + +---------------------------------------------------- + 16th April 2016 Added ipintel table, only required if ip intel is enabled in the config diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index 72d08af90f71..666ae0a53af3 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -266,6 +266,7 @@ CREATE TABLE `poll_question` ( `createdby_ckey` varchar(45) NULL DEFAULT NULL, `createdby_ip` varchar(45) NULL DEFAULT NULL, `for_trialmin` varchar(45) NULL DEFAULT NULL, + `dontshow` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/SQL/tgstation_schema_prefixed.sql b/SQL/tgstation_schema_prefixed.sql index ab49b337cf34..44b8b5da50aa 100644 --- a/SQL/tgstation_schema_prefixed.sql +++ b/SQL/tgstation_schema_prefixed.sql @@ -261,6 +261,7 @@ CREATE TABLE `SS13_poll_question` ( `createdby_ckey` varchar(45) NULL DEFAULT NULL, `createdby_ip` varchar(45) NULL DEFAULT NULL, `for_trialmin` varchar(45) NULL DEFAULT NULL, + `dontshow` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm index 23c07c4228e4..584dc7f4f1a4 100644 --- a/code/modules/admin/create_poll.dm +++ b/code/modules/admin/create_poll.dm @@ -81,12 +81,20 @@ adminonly = 0 else return + var/dontshow + switch(alert("Hide poll results from tracking until completed?",,"Yes","No","Cancel")) + if("Yes") + dontshow = 1 + if("No") + dontshow = 0 + else + return var/sql_ckey = sanitizeSQL(ckey) var/question = input("Write your question","Question") as message|null if(!question) return question = sanitizeSQL(question) - var/DBQuery/query_polladd_question = dbcon.NewQuery("INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]')") + var/DBQuery/query_polladd_question = dbcon.NewQuery("INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip, dontshow) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', '[address]', '[dontshow]')") if(!query_polladd_question.Execute()) var/err = query_polladd_question.ErrorMsg() log_game("SQL ERROR adding new poll question to table. Error : \[[err]\]\n")