Skip to content

Instantly share code, notes, and snippets.

@felixjung
Created October 27, 2014 16:33
Show Gist options
  • Save felixjung/882cc8cfd1b2d91360f4 to your computer and use it in GitHub Desktop.
Save felixjung/882cc8cfd1b2d91360f4 to your computer and use it in GitHub Desktop.
Database migration error
== 20140907220153 SerializeServiceProperties: migrating =======================
-- add_column(:services, :properties, :text)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Duplicate column name 'properties': ALTER TABLE `services` ADD `properties` text/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `query'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/mysql2_adapter.rb:228:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:375:in `add_column'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:649:in `block in method_missing'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:621:in `block in say_with_time'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:621:in `say_with_time'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:641:in `method_missing'
/home/git/gitlab/db/migrate/20140907220153_serialize_service_properties.rb:3:in `change'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:595:in `exec_migration'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:578:in `block in migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:577:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:752:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:1040:in `ddl_transaction'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:953:in `block in migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:949:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:949:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:807:in `up'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:785:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment