project表添加字段,记录project对应gitlba中project id
This commit is contained in:
parent
fbeb6585d2
commit
73898953d9
|
@ -254,7 +254,10 @@ update
|
|||
#if( !User.current.member_of?(@project) || @project.hidden_repo)
|
||||
@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
|
||||
@entries = @repository.entries(@path, @rev)
|
||||
@changeset = @repository.find_changeset_by_name(@rev)
|
||||
|
|
|
@ -768,7 +768,8 @@ class Project < ActiveRecord::Base
|
|||
'project_type',
|
||||
'dts_test',
|
||||
'attachmenttype',
|
||||
'enterprise_name'
|
||||
'enterprise_name',
|
||||
'gpid'
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddGpidToProject < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :gpid, :integer
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# 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|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -1146,6 +1146,7 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
|
|||
t.string "enterprise_name"
|
||||
t.integer "organization_id"
|
||||
t.integer "project_new_type"
|
||||
t.integer "gpid"
|
||||
end
|
||||
|
||||
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
||||
|
|
|
@ -60,7 +60,9 @@ namespace :gitlab do
|
|||
user_id: gid,
|
||||
import_url: 'https://github.com/gitlabhq/gitlab-cli.git'
|
||||
)
|
||||
|
||||
project.gpid = gproject.id
|
||||
project.save!
|
||||
puts "Successfully created #{project.name}"
|
||||
# add team members
|
||||
#
|
||||
GUEST = 10
|
||||
|
|
Loading…
Reference in New Issue