Handle not ready repos
[gitorious.git] / db / migrate / 20090203101718_add_hashed_path_to_repositories.rb
blob746667773bfa805e7d0b89809bb78076bbd10ffd
1 class AddHashedPathToRepositories < ActiveRecord::Migration
2   def self.up
3     transaction do
4       add_column :repositories, :hashed_path, :string
5       add_index :repositories, :hashed_path
7       Repository.reset_column_information
9       Repository.all.each do |repo|
10         repo.update_attribute(:hashed_path, repo.send(:set_repository_hash))
11       end
12       say "\e[1;31m===> Now go and run script/shard_git_repositories_by_hash as the #{Gitorious.user} user <===\e[0m"
13     end
14   end
16   def self.down
17     remove_column :repositories, :hashed_path
18   end
19 end