From 15100689c3f8a592d5c7c0e359dabf67276dcad8 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 14:01:48 +0800 Subject: [PATCH] =?UTF-8?q?rake=20commit=5Flog=5Fto=5Fdb=20sql=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/commit_log_to_db.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/commit_log_to_db.rake b/lib/tasks/commit_log_to_db.rake index bde59a337..bd45d91ce 100644 --- a/lib/tasks/commit_log_to_db.rake +++ b/lib/tasks/commit_log_to_db.rake @@ -30,7 +30,7 @@ namespace :commit_log_to_db do commit_date = Time.parse(commit['commit']['author']['date']) commit_date_str = commit_date.strftime("%a %b %d %H:%M:%S") - data += "(#{user&.id},#{project.id},#{project.repository&.id},'#{project.identifier}','#{project.owner.name}/#{project.identifier}','#{commit_sha}','#{ref}','#{commit_message}','#{commit_date_str}','#{commit_date_str}')," + data += "(#{user&.id},#{project.id},#{project.repository&.id},'#{project.identifier}','#{project.owner.name}/#{project.identifier}','#{commit_sha}','#{ref}',\"#{commit_message}\",'#{commit_date_str}','#{commit_date_str}')," end data = data[0,data.length-1] sql_connection = ActiveRecord::Base.connection @@ -64,7 +64,7 @@ namespace :commit_log_to_db do commit_date = Time.parse(commit['commit']['author']['date']) commit_date_str = commit_date.strftime("%Y-%m-%d %H:%M:%S") - data += "(#{user&.id},#{project.id},#{project.repository&.id},'#{project.identifier}','#{project.owner.name}/#{project.identifier}','#{commit_sha}','#{ref}','#{commit_message}','#{commit_date_str}','#{commit_date_str}')," + data += "(#{user&.id},#{project.id},#{project.repository&.id},'#{project.identifier}','#{project.owner.name}/#{project.identifier}','#{commit_sha}','#{ref}',\"#{commit_message}\",'#{commit_date_str}','#{commit_date_str}')," end data = data[0,data.length-1] sql_connection = ActiveRecord::Base.connection