# Install hook code here require File.join(File.dirname(__FILE__), "..", "..", "..", "config", "environment") db_path = File.join(File.dirname(__FILE__), "..", "..", "..", "db", "migrate", "") puts if ActiveRecord::Migrator.using_non_duplicate_migrations? if !ActiveRecord::Migrator.using_duplicate_migrations? puts "Creating a new schema_infos table and inserting default data according to existing schema_info." ActiveRecord::Migrator.convert_from_non_duplicates(db_path) puts "Success! You should be able to delete the schema_info table using the following task:" puts " rake db:cleanup:delete_nonduplicates" else puts "Not converting exsiting schema_info into schema_infos, because schema_infos table unexpectedly exists." puts "It's likely duplicate migrations has already been installed at some point." puts "If you want to overwrite schema_infos with the data from schema_info, run the following rake task:" puts " rake db:convert:allow_duplicates" end else if ActiveRecord::Migrator.using_duplicate_migrations? puts "Not converting existing schema_info, because no schema_info table present.\nDuplicate migrations has probably already been installed." else puts "Not converting existing schema_info, because no schema_info table present.\nRake db:migrate has probably not been run yet." end end puts