Skip to content

Commit 95277c1

Browse files
author
Tobias Fischer
committed
fix migrations when upgrading from previous versions / v1.0.1
1 parent bb7f2b0 commit 95277c1

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Diff for: db/migrate/001_create_project_aliases.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
class CreateProjectAliases < ActiveRecord::Migration
22

33
def self.up
4-
create_table :project_aliases do |t|
5-
t.column :project_id, :integer, :null => false
6-
t.column :alias, :string, :null => false
4+
unless table_exists? :project_aliases
5+
create_table :project_aliases do |t|
6+
t.column :project_id, :integer, :null => false
7+
t.column :alias, :string, :null => false
8+
end
9+
add_index :project_aliases, [ :alias ], :unique => true, :name => :project_alias
710
end
8-
add_index :project_aliases, [ :alias ], :unique => true, :name => :project_alias
911
end
1012

1113
def self.down

Diff for: db/migrate/002_add_project_aliases_undeletable.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
class AddProjectAliasesUndeletable < ActiveRecord::Migration
22

33
def self.up
4-
add_column :project_aliases, :undeletable, :boolean, :default => false, :null => false
4+
unless column_exists? :project_aliases, :undeletable
5+
add_column :project_aliases, :undeletable, :boolean, :default => false, :null => false
6+
end
57
end
68

79
def self.down

Diff for: init.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
author 'Andriy Lesyuk & Tobias Fischer'
2222
description 'Allows adding project identifier aliases or renaming of project identifiers.'
2323
url 'https://github.com/paginagmbh/redmine_project-alias-2'
24-
version '1.0.0'
24+
version '1.0.1'
2525
requires_redmine :version_or_higher => '2.6'
2626

2727
menu :admin_menu, :project_aliases,

0 commit comments

Comments
 (0)