-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Closed
Copy link
Description
- Gitea version (or commit ref): 1.12.0+dev-307-g62a1322cf
- Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
- No
- Not relevant
Description
After deleting a repo the times API has become unusable:
$ curl -X GET "https://bobemoe:xxxx@try.gitea.io/api/v1/user/times" -H "accept: application/json"
{"message":"issue does not exist [id: 9010, repo_id: 0, index: 0]","url":"https://try.gitea.io/api/swagger"}
I've checked the DB and indeed the issue
records for the deleted repo have been deleted but there are still records in the tracked_time
table that now have a non-existent issue_id
:
mysql> select t.*,i.id from tracked_time t left join issue i on t.issue_id=i.id having i.id is null;
+----+----------+---------+--------------+-------+---------+------+
| id | issue_id | user_id | created_unix | time | deleted | id |
+----+----------+---------+--------------+-------+---------+------+
| 3 | 1361 | 1 | 1571125831 | 3600 | 0 | NULL |
| 4 | 1361 | 1 | 1571125838 | 1500 | 0 | NULL |
....
Metadata
Metadata
Assignees
Labels
No labels