From fe46bceb984b549d9e38a12f248dd7155a3ba562 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Wed, 18 Dec 2024 10:44:23 -0600 Subject: [PATCH] Change the `timestamp` column in the past answer table to `BIGINT`. Currently this column is of `INT` type. The `INT` type is a 4 bit integer, and so a timestamp stored in this column that is after the year 2038 will not work. A `BIGINT` is large enough for my lifetime at least (and then another 292 billion years or so). There is no need to update databases since the INT and BIGINT types are compatible. However, at some point you will need to make sure that the type of the column in all courses is updated. You can run the `upgrade-database-to-utf8mb4.pl` script to do this. For example, running `upgrade-database-to-utf8mb4.pl -c courseId` will update the past answer table for the named course. This fixes issue #952. --- lib/WeBWorK/DB/Record/PastAnswer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WeBWorK/DB/Record/PastAnswer.pm b/lib/WeBWorK/DB/Record/PastAnswer.pm index 65a8bce4ba..db1178a9da 100644 --- a/lib/WeBWorK/DB/Record/PastAnswer.pm +++ b/lib/WeBWorK/DB/Record/PastAnswer.pm @@ -32,7 +32,7 @@ BEGIN { set_id => { type => "VARCHAR(100) NOT NULL", key => 1 }, problem_id => { type => "INT NOT NULL", key => 1 }, source_file => { type => "TEXT" }, - timestamp => { type => "INT" }, + timestamp => { type => "BIGINT" }, scores => { type => "TINYTEXT" }, answer_string => { type => "VARCHAR(5012)" }, comment_string => { type => "VARCHAR(5012)" },