From 2c73575f763991beb0f3726950a6f01cd9556e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B5=AB=E7=84=B6?= Date: Mon, 19 Aug 2024 10:58:43 +0800 Subject: [PATCH] Delete RepoTokenPeerInfo when del repo --- .github/workflows/golangci-lint.yml | 4 ++-- server/repo-mgr.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index fd260fc5..f20e8073 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: stable + go-version: "1.22" - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: stable + go-version: "1.22" - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: diff --git a/server/repo-mgr.c b/server/repo-mgr.c index fb00f89f..205c00c0 100644 --- a/server/repo-mgr.c +++ b/server/repo-mgr.c @@ -611,7 +611,9 @@ seaf_repo_manager_del_repo (SeafRepoManager *mgr, } seaf_db_statement_query (mgr->seaf->db, - "DELETE FROM RepoUserToken WHERE repo_id = ?", + "DELETE t.*, i.* FROM RepoUserToken t, " + "RepoTokenPeerInfo i WHERE t.token=i.token AND " + "t.repo_id=?", 1, "string", repo_id); seaf_db_statement_query (mgr->seaf->db,