mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-04 04:03:25 +08:00
fixed memos表判断是否存在
This commit is contained in:
@@ -32,7 +32,11 @@ class Api::V1::Users::DeleteUserService < ApplicationService
|
||||
end
|
||||
|
||||
def del_user_data_by_sql(user_id)
|
||||
sql1 = "delete from memos where author_id=#{user_id}"
|
||||
ActiveRecord::Base.connection.execute(sql1)
|
||||
if ActiveRecord::Base.connection.table_exists?("memos")
|
||||
sql1 = "delete from memos where author_id=#{user_id}"
|
||||
ActiveRecord::Base.connection.execute(sql1)
|
||||
else
|
||||
Rails.logger.info "memos table does not exist"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user