Mercurial > hg > soundsoftware-site
comparison .svn/pristine/e9/e979556402c42701e57fd1a392fda3c520a262a5.svn-base @ 1296:038ba2d95de8 redmine-2.2
Fix redmine-2.2 branch update (add missing svn files)
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:05:06 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1294:3e4c3460b6ca | 1296:038ba2d95de8 |
---|---|
1 class ChangeRepositoriesToFullSti < ActiveRecord::Migration | |
2 def up | |
3 Repository.connection.select_rows("SELECT id, type FROM #{Repository.table_name}").each do |repository_id, repository_type| | |
4 unless repository_type =~ /^Repository::/ | |
5 Repository.update_all ["type = ?", "Repository::#{repository_type}"], ["id = ?", repository_id] | |
6 end | |
7 end | |
8 end | |
9 | |
10 def down | |
11 Repository.connection.select_rows("SELECT id, type FROM #{Repository.table_name}").each do |repository_id, repository_type| | |
12 if repository_type =~ /^Repository::(.+)$/ | |
13 Repository.update_all ["type = ?", $1], ["id = ?", repository_id] | |
14 end | |
15 end | |
16 end | |
17 end |