Skip to content

Commit

Permalink
Change the timestamp column in the past answer table to BIGINT.
Browse files Browse the repository at this point in the history
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 openwebwork#952.
  • Loading branch information
drgrice1 committed Dec 18, 2024
1 parent 7e386f9 commit fe46bce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/WeBWorK/DB/Record/PastAnswer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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)" },
Expand Down

0 comments on commit fe46bce

Please sign in to comment.