summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorAravinth Manivannan <realaravinth@batsense.net>2022-01-13 06:03:30 +0000
committerGitHub <noreply@github.com>2022-01-13 14:03:30 +0800
commit69a28299e2e3a8e40023581c27a5a2193949efa0 (patch)
tree139e58d9aad198a44acc87d36e957dad020b5db9 /models
parenteaf09a53687844603dfd1bd3b88ed44d07f8e094 (diff)
downloadgitea-69a28299e2e3a8e40023581c27a5a2193949efa0.tar.gz
gitea-69a28299e2e3a8e40023581c27a5a2193949efa0.zip
migrations: a deadline at January 1st, 1970 is valid (#18237)
* 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 <loic@dachary.org> * 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 <loic@dachary.org> Co-authored-by: Loïc Dachary <loic@dachary.org> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'models')
-rw-r--r--models/fixtures/milestone.yml5
1 files changed, 5 insertions, 0 deletions
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