Change indexes to composite, unique, case insensitive. Redo sync logging. Verbose params for tasks. Refs #112
This commit is contained in:
parent
fab4aa6eb6
commit
43a4aecc66
1
Gemfile
1
Gemfile
|
@ -4,6 +4,7 @@ gem 'rails', '3.0.11' #, :git => 'git://github.com/rails/rails.git'
|
|||
|
||||
gem 'pg', '~> 0.11.0'
|
||||
gem 'silent-postgres', '~> 0.1.1'
|
||||
gem 'redhillonrails_core', '~> 1.2.0'
|
||||
|
||||
gem 'devise', '~> 1.5.2'
|
||||
gem 'omniauth', '~> 1.0.1'
|
||||
|
|
|
@ -160,6 +160,8 @@ GEM
|
|||
rbx-require-relative (0.0.5)
|
||||
rdoc (3.11)
|
||||
json (~> 1.4)
|
||||
redhillonrails_core (1.2.0)
|
||||
activerecord (>= 2)
|
||||
rr (1.0.4)
|
||||
rspec (2.7.0)
|
||||
rspec-core (~> 2.7.0)
|
||||
|
@ -238,6 +240,7 @@ DEPENDENCIES
|
|||
rails-xmlrpc (~> 0.3.6)
|
||||
rails3-generators
|
||||
rails3-jquery-autocomplete
|
||||
redhillonrails_core (~> 1.2.0)
|
||||
rr
|
||||
rspec-rails (~> 2.7.0)
|
||||
ruby-debug
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
class ProjectImport < ActiveRecord::Base
|
||||
belongs_to :project
|
||||
|
||||
validates :name, :uniqueness => {:case_sensitive => false}, :presence => true
|
||||
|
||||
scope :by_name, lambda {|name| where('project_imports.name ILIKE ?', name)}
|
||||
|
||||
after_initialize lambda {|r| r.file_mtime ||= Time.current - 10.years } # default
|
||||
|
|
|
@ -13,11 +13,5 @@ every 5.minutes do
|
|||
end
|
||||
|
||||
every 1.day, :at => '4:00 am' do
|
||||
rake "import:sync:all > log/sync.log"
|
||||
# rake "import:sync:run" # RELEASE=official/2011 PLATFORM=mandriva2011 REPOSITORY=main
|
||||
# rake "import:sync:run REPOSITORY=contrib" # RELEASE=official/2011 PLATFORM=mandriva2011
|
||||
# rake "import:sync:run REPOSITORY=non-free" # RELEASE=official/2011 PLATFORM=mandriva2011
|
||||
# rake "import:sync:run RELEASE=devel/cooker PLATFORM=cooker" # REPOSITORY=main
|
||||
# rake "import:sync:run RELEASE=devel/cooker PLATFORM=cooker REPOSITORY=contrib"
|
||||
# rake "import:sync:run RELEASE=devel/cooker PLATFORM=cooker REPOSITORY=non-free"
|
||||
rake "import:sync:all", :output => 'sync.log'
|
||||
end
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
class AddIndexForProjectsName < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_index :projects, :name
|
||||
add_index :project_imports, :name
|
||||
add_index :projects, [:name, :owner_id, :owner_type], :unique => true, :case_sensitive => false
|
||||
add_index :project_imports, :name, :unique => true, :case_sensitive => false
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_index :projects, :name
|
||||
remove_index :projects, [:name, :owner_id, :owner_type]
|
||||
remove_index :project_imports, :name
|
||||
end
|
||||
end
|
||||
|
|
|
@ -230,7 +230,7 @@ ActiveRecord::Schema.define(:version => 20120127234602) do
|
|||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
add_index "project_imports", ["name"], :name => "index_project_imports_on_name"
|
||||
add_index "project_imports", ["name"], :name => "index_project_imports_on_name", :unique => true, :case_sensitive => false
|
||||
|
||||
create_table "project_to_repositories", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
|
@ -257,7 +257,7 @@ ActiveRecord::Schema.define(:version => 20120127234602) do
|
|||
end
|
||||
|
||||
add_index "projects", ["category_id"], :name => "index_projects_on_category_id"
|
||||
add_index "projects", ["name"], :name => "index_projects_on_name"
|
||||
add_index "projects", ["owner_id"], :name => "index_projects_on_name_and_owner_id_and_owner_type", :unique => true, :case_sensitive => false
|
||||
|
||||
create_table "relations", :force => true do |t|
|
||||
t.integer "object_id"
|
||||
|
|
|
@ -29,10 +29,10 @@ namespace :import do
|
|||
namespace :sync do
|
||||
desc "Sync all repos"
|
||||
task :all do
|
||||
system("bundle exec rake import:sync:run")
|
||||
system("bundle exec rake import:sync:run REPOSITORY=contrib")
|
||||
system("bundle exec rake import:sync:run REPOSITORY=non-free")
|
||||
system("bundle exec rake import:sync:run RELEASE=devel/cooker PLATFORM=cooker")
|
||||
system("bundle exec rake import:sync:run RELEASE=official/2011 PLATFORM=mandriva2011 REPOSITORY=main")
|
||||
system("bundle exec rake import:sync:run RELEASE=official/2011 PLATFORM=mandriva2011 REPOSITORY=contrib")
|
||||
system("bundle exec rake import:sync:run RELEASE=official/2011 PLATFORM=mandriva2011 REPOSITORY=non-free")
|
||||
system("bundle exec rake import:sync:run RELEASE=devel/cooker PLATFORM=cooker REPOSITORY=main")
|
||||
system("bundle exec rake import:sync:run RELEASE=devel/cooker PLATFORM=cooker REPOSITORY=contrib")
|
||||
system("bundle exec rake import:sync:run RELEASE=devel/cooker PLATFORM=cooker REPOSITORY=non-free")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue