Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sqlite 删除Gogs中的问题_Sqlite_Gogs - Fatal编程技术网

Sqlite 删除Gogs中的问题

Sqlite 删除Gogs中的问题,sqlite,gogs,Sqlite,Gogs,目前无法删除Gogs中的问题: 有解决方法吗?作为一种解决方法,我使用以下SQL删除了一个问题,例如问题19和SQLite上的所有相关数据。Gogs版本:0.11.4.0405 -- Delete issue-user records releated with issue #19 DELETE FROM issue_user WHERE issue_id IN (SELECT id FROM issue WHERE [index] = 19); -- Decrease number of i

目前无法删除Gogs中的问题:


有解决方法吗?

作为一种解决方法,我使用以下SQL删除了一个问题,例如问题19和SQLite上的所有相关数据。Gogs版本:0.11.4.0405

-- Delete issue-user records releated with issue #19
DELETE FROM issue_user WHERE issue_id IN (SELECT id FROM issue WHERE [index] = 19);

-- Decrease number of issues value of repository on which issue #19 has been created
UPDATE repository SET num_issues = num_issues - 1 WHERE id IN (SELECT repo_id FROM issue WHERE [index] = 19);

-- Delete action records added while issue #19 has been created
-- op_type 6 is ACTION_CREATE_ISSUE: https://github.com/gogits/gogs/blob/master/models/action.go
DELETE FROM action WHERE (op_type = 6) AND (repo_id IN (SELECT repo_id FROM issue WHERE [index] = 19)) AND (content LIKE '19|%');

-- At last, delete issue #19
DELETE FROM issue WHERE [index] = 19;