Skip to content

Commit

Permalink
bugfix: migrate subject system group without subject
Browse files Browse the repository at this point in the history
  • Loading branch information
zhu327 authored Sep 13, 2023
2 parents d63313c + 445d647 commit 4b23ad6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build/support-files/migrate_subject_system_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def db_list_subject_pk(
sql = "SELECT MAX(pk) FROM subject WHERE type IN %s;"
cursor.execute(sql, [tuple(types)])
max_pk = cursor.fetchone()[0] # type: ignore
if not max_pk:
return

# 每次查询1000条
sql = "SELECT pk FROM subject WHERE type IN %s AND pk >= %s AND pk < %s;"
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/model/handler/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func BatchCreateActions(c *gin.Context) {
// @Header 200 {string} X-Request-Id "the request id"
// @Security AppCode
// @Security AppSecret
// @Router /api/v1/systems/{system_id}/action/{action_id} [put]
// @Router /api/v1/systems/{system_id}/actions/{action_id} [put]
func UpdateAction(c *gin.Context) {
systemID := c.Param("system_id")

Expand Down Expand Up @@ -256,7 +256,7 @@ func UpdateAction(c *gin.Context) {
// @Header 200 {string} X-Request-Id "the request id"
// @Security AppCode
// @Security AppSecret
// @Router /api/v1/systems/{system_id}/action/{action_id} [delete]
// @Router /api/v1/systems/{system_id}/actions/{action_id} [delete]
func DeleteAction(c *gin.Context) {
systemID := c.Param("system_id")
actionID := c.Param("action_id")
Expand Down

0 comments on commit 4b23ad6

Please sign in to comment.