project表添加字段,记录project对应gitlba中project id

This commit is contained in:
huang 2015-10-13 10:58:22 +08:00
parent fbeb6585d2
commit 73898953d9
5 changed files with 16 additions and 4 deletions

View File

@ -254,7 +254,10 @@ update
#if( !User.current.member_of?(@project) || @project.hidden_repo) #if( !User.current.member_of?(@project) || @project.hidden_repo)
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
g = Gitlab.client
# r = g.get("/users?search=#{user.mail}").first
# rr = g.trees(@project.id, @path)
# r = g.get ("/projects/#{@project}/repository/tree")
# :name, :path, :kind, :size, :lastrev, :changeset # :name, :path, :kind, :size, :lastrev, :changeset
@entries = @repository.entries(@path, @rev) @entries = @repository.entries(@path, @rev)
@changeset = @repository.find_changeset_by_name(@rev) @changeset = @repository.find_changeset_by_name(@rev)

View File

@ -768,7 +768,8 @@ class Project < ActiveRecord::Base
'project_type', 'project_type',
'dts_test', 'dts_test',
'attachmenttype', 'attachmenttype',
'enterprise_name' 'enterprise_name',
'gpid'

View File

@ -0,0 +1,5 @@
class AddGpidToProject < ActiveRecord::Migration
def change
add_column :projects, :gpid, :integer
end
end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150930011457) do ActiveRecord::Schema.define(:version => 20151013023237) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -1146,6 +1146,7 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
t.string "enterprise_name" t.string "enterprise_name"
t.integer "organization_id" t.integer "organization_id"
t.integer "project_new_type" t.integer "project_new_type"
t.integer "gpid"
end end
add_index "projects", ["lft"], :name => "index_projects_on_lft" add_index "projects", ["lft"], :name => "index_projects_on_lft"

View File

@ -60,7 +60,9 @@ namespace :gitlab do
user_id: gid, user_id: gid,
import_url: 'https://github.com/gitlabhq/gitlab-cli.git' import_url: 'https://github.com/gitlabhq/gitlab-cli.git'
) )
project.gpid = gproject.id
project.save!
puts "Successfully created #{project.name}"
# add team members # add team members
# #
GUEST = 10 GUEST = 10