Open gilbertf opened 11 years ago
I got the same problem:
== AddMissingColumnToWikiTemplates: migrating ================================ -- add_column(:wiki_templates, :visible_children, :boolean, {:default=>true}) rake aborted! An error has occurred, all later migrations canceled:
Mysql2::Error: Duplicate column name 'visible_children': ALTER TABLE wiki_templates
ADD visible_children
tinyint(1) DEFAULT 1
Hi, @huangxh16888, @gilbertf I saw the same situation on fresh install.
Please try to change db/migrate/005_add_missing_indexes_to_wiki_templates.rb like this:
class AddMissingIndexesToWikiTemplates < ActiveRecord::Migration
def self.up
add_index :wiki_templates, [:author_id], :name => :index_wiki_templates_on_author_id
add_index :wiki_templates, [:project_id], :name => :index_wiki_templates_on_project_id
end
def self.down
remove_index :wiki_templates, :name => :index_wiki_templates_on_author_id
remove_index :wiki_templates, :name => :index_wiki_templates_on_project_id
end
end
@akiko-pusu Thank you! It works correctly.
Hi, when I run rake redmine:plugins:migrate RAILS_ENV=production on a fresh installation with this plugin added to the plugin folder, db/migrate/012_add_missing_column_to_wiki_templates.rb fails with the following message:
SQLite3::SQLException: duplicate column name: visible_children: ALTER TABLE "wiki_templates" ADD "visible_children" boolean DEFAULT 't'