From 69a28299e2e3a8e40023581c27a5a2193949efa0 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Thu, 13 Jan 2022 06:03:30 +0000 Subject: migrations: a deadline at January 1st, 1970 is valid (#18237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * migrations: a deadline at January 1st, 1970 is valid Do not change the deadline value if it is set to January 1st, 1970. Setting the deadline to year 9999 when it is zero (which is equal to January 1st, 1970) modifies a deadline set to January 1st, 1970 which is a valid date. In addition, setting a date in year 9999 will be converted to a null date in some cases. Signed-off-by: Loïc Dachary * tests: set milestone.deadline_unix in fixtures The value of deadline_unix must be set to 253370764800 (i.e. 9999-01-01) in fixtures, otherwise it will be inserted as null which leads to unexpected errors. For instance, DumpRepository will store a null deadline_unix as 0 (i.e. 1970-01-01) and RestoreRepository will change it to 9999-01-01. Signed-off-by: Loïc Dachary Co-authored-by: Loïc Dachary Co-authored-by: wxiaoguang --- models/fixtures/milestone.yml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'models') diff --git a/models/fixtures/milestone.yml b/models/fixtures/milestone.yml index d439ce81cb..4dd3445940 100644 --- a/models/fixtures/milestone.yml +++ b/models/fixtures/milestone.yml @@ -6,6 +6,7 @@ is_closed: false num_issues: 1 num_closed_issues: 0 + deadline_unix: 253370764800 - id: 2 @@ -15,6 +16,7 @@ is_closed: false num_issues: 0 num_closed_issues: 0 + deadline_unix: 253370764800 - id: 3 @@ -24,6 +26,7 @@ is_closed: true num_issues: 1 num_closed_issues: 0 + deadline_unix: 253370764800 - id: 4 @@ -33,6 +36,7 @@ is_closed: false num_issues: 0 num_closed_issues: 0 + deadline_unix: 253370764800 - id: 5 @@ -42,3 +46,4 @@ is_closed: false num_issues: 0 num_closed_issues: 0 + deadline_unix: 253370764800 -- cgit v1.2.3