Mysql::Error: Duplicate column name 'position': ALTER TABLE `templates` ADD `position` int(11)

It would appear that the templates table already has a position field before the migrations are run. Is it possible that you're working with a database that has some of the structure already setup?

On Feb 5, 2009, at 11:11 PM, N. Turnage wrote:

I installed the templates extension on my project on my laptop, but when I deployed the updated project and migrated the templates extension things went horribly wrong.

First, the rake was aborted on the 4th migration with an error that the position column had already been created (not possible). Second, I cannot get into the admin portion of my site any more, even if I migrate the extension to VERSION=0 and delete it completely.

The only thing I could think might be a problem is that I did add the arrow image and the templates javascript files into source control, but neither should affect a migration. I am really at a loss as to what could make this break this way.

The project is on 0.6.9.

Trace from the migration:

rake production radiant:extensions:templates:migrate --trace
(in /home/tanji/app/goodtaste_new/releases/20090206034811)
** Invoke production (first_time)
** Execute production
** Invoke environment (first_time)
** Execute environment
** Invoke radiant:extensions:templates:migrate (first_time)
** Invoke environment
** Execute radiant:extensions:templates:migrate
== 4 AddPositionToTemplates: migrating ========================================
-- add_column(:templates, :position, :integer)
rake aborted!
Mysql::Error: Duplicate column name 'position': ALTER TABLE `templates` ADD `position` int(11) /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/connection_adapters/ abstract_adapter.rb:150:in `log' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/connection_adapters/mysql_adapter.rb: 281:in `execute' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/connection_adapters/abstract/ schema_statements.rb:124:in `add_column' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:285:in `send' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:285:in `method_missing' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:265:in `say_with_time'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:265:in `say_with_time' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:281:in `method_missing' /home/tanji/app/goodtaste_new/releases/20090206034811/vendor/ extensions/templates/db/migrate/004_add_position_to_templates.rb: 3:in `up_without_benchmarks' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:219:in `send' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:219:in `migrate'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:219:in `migrate' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:348:in `migrate_without_extension_support' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:339:in `each' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/ activerecord/lib/active_record/migration.rb:339:in `migrate_without_extension_support' /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/lib/radiant/ extension_migrator.rb:33:in `migrate' /home/tanji/app/goodtaste_new/releases/20090206034811/vendor/ extensions/templates/lib/tasks/templates_extension_tasks.rake:11
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19


Thanks,

~Nate
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to