Mercurial > hg > soundsoftware-site
comparison .svn/pristine/27/27ce56818e709e285d3d63b2d5d116ba119243bf.svn-base @ 1298:4f746d8966dd redmine_2.3_integration
Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:28:30 +0100 |
parents | 622f24f53b42 |
children |
comparison
equal
deleted
inserted
replaced
1297:0a574315af3e | 1298:4f746d8966dd |
---|---|
1 class ChangeChangesetsRevisionToString < ActiveRecord::Migration | |
2 def self.up | |
3 # Some backends (eg. SQLServer 2012) do not support changing the type | |
4 # of an indexed column so the index needs to be dropped first | |
5 # BUT this index is renamed with some backends (at least SQLite3) for | |
6 # some (unknown) reasons, thus we check for the other name as well | |
7 # so we don't end up with 2 identical indexes | |
8 if index_exists? :changesets, [:repository_id, :revision], :name => :changesets_repos_rev | |
9 remove_index :changesets, :name => :changesets_repos_rev | |
10 end | |
11 if index_exists? :changesets, [:repository_id, :revision], :name => :altered_changesets_repos_rev | |
12 remove_index :changesets, :name => :altered_changesets_repos_rev | |
13 end | |
14 | |
15 change_column :changesets, :revision, :string, :null => false | |
16 | |
17 add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev | |
18 end | |
19 | |
20 def self.down | |
21 if index_exists? :changesets, :changesets_repos_rev | |
22 remove_index :changesets, :name => :changesets_repos_rev | |
23 end | |
24 if index_exists? :changesets, [:repository_id, :revision], :name => :altered_changesets_repos_rev | |
25 remove_index :changesets, :name => :altered_changesets_repos_rev | |
26 end | |
27 | |
28 change_column :changesets, :revision, :integer, :null => false | |
29 | |
30 add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev | |
31 end | |
32 end |