mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 20:55:46 +08:00
FIX ci repos dependent destroy bug
This commit is contained in:
@@ -134,6 +134,7 @@ class Ci::CloudAccountsController < Ci::BaseController
|
|||||||
cloud_account.destroy!
|
cloud_account.destroy!
|
||||||
when User::DEVOPS_CERTIFICATION
|
when User::DEVOPS_CERTIFICATION
|
||||||
cloud_account.ci_user.destroy!
|
cloud_account.ci_user.destroy!
|
||||||
|
Ci::Repo.where(repo_namespace: user.login).delete_all
|
||||||
end
|
end
|
||||||
user.projects.update_all(open_devops: false)
|
user.projects.update_all(open_devops: false)
|
||||||
user.set_drone_step!(User::DEVOPS_UNINIT)
|
user.set_drone_step!(User::DEVOPS_UNINIT)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class Ci::User < Ci::RemoteBase
|
|||||||
self.primary_key = 'user_id'
|
self.primary_key = 'user_id'
|
||||||
|
|
||||||
has_many :repos, foreign_key: "repo_user_id", dependent: :destroy
|
has_many :repos, foreign_key: "repo_user_id", dependent: :destroy
|
||||||
has_many :perms, foreign_key: "perm_user_id", dependent: :destroy
|
has_many :perms, foreign_key: "perm_user_id", dependent: :delete_all
|
||||||
has_one :ci_cloud_account, class_name: 'Ci::CloudAccount', foreign_key: :ci_user_id
|
has_one :ci_cloud_account, class_name: 'Ci::CloudAccount', foreign_key: :ci_user_id
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user