From cf00942261c8392c08ae15d7e4b1baa9fff4b658 Mon Sep 17 00:00:00 2001 From: nwb Date: Tue, 1 Jul 2014 16:19:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=BF=81=E7=A7=BB=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20140603042015_stored_course_procedure.rb | 16 ++++-- db/schema.rb | 52 +++++++++++++++++++ 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/db/migrate/20140603042015_stored_course_procedure.rb b/db/migrate/20140603042015_stored_course_procedure.rb index 40cb87e2..2f5faf5c 100644 --- a/db/migrate/20140603042015_stored_course_procedure.rb +++ b/db/migrate/20140603042015_stored_course_procedure.rb @@ -8,13 +8,19 @@ class StoredCourseProcedure < ActiveRecord::Migration if project.project_type == 1 course = Course.find_by_extra(project.identifier) if course - course.name = project.name - course.description = project.description - course.status = project.status - course.attachmenttype = 2 + sql = "update courses set name='" + project.name.to_s + "',description='" + sql += project.description.to_s + "',status=" + project.status.to_s + sql += ",attachmenttype=2 where id=" +course.id.to_s + execute(sql) + + # 以下方式保存,描述等经常不能成功 + #course.name = project.name + #course.description = project.description + #course.status = project.status + #course.attachmenttype = 2 #course.lft = project.lft #course.rgt = project.rgt - course.save(:validate => false) + #course.save(:validate => false) # 更新状态表 projectstatus = ProjectStatus.find_by_project_id(project.id) diff --git a/db/schema.rb b/db/schema.rb index 67ea26a2..9962892d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -175,6 +175,58 @@ ActiveRecord::Schema.define(:version => 20140626012511) do add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + create_table "code_review_assignments", :force => true do |t| + t.integer "issue_id" + t.integer "change_id" + t.integer "attachment_id" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.string "action_type" + t.integer "changeset_id" + end + + create_table "code_review_project_settings", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "updated_by" + t.boolean "hide_code_review_tab", :default => false + t.integer "auto_relation", :default => 1 + t.integer "assignment_tracker_id" + t.text "auto_assign" + t.integer "lock_version", :default => 0, :null => false + t.boolean "tracker_in_review_dialog", :default => false + end + + create_table "code_review_user_settings", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "mail_notification", :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "code_reviews", :force => true do |t| + t.integer "project_id" + t.integer "change_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "line" + t.integer "updated_by_id" + t.integer "lock_version", :default => 0, :null => false + t.integer "status_changed_from" + t.integer "status_changed_to" + t.integer "issue_id" + t.string "action_type" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.integer "attachment_id" + t.integer "file_count", :default => 0, :null => false + t.boolean "diff_all" + end + create_table "comments", :force => true do |t| t.string "commented_type", :limit => 30, :default => "", :null => false t.integer "commented_id", :default => 0, :null => false