Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

schema_migrations.version is an INTEGER in test db

#1739

On MySQL, I'm getting a strange bug in test, but not in dev. I can run rake db:migrate or rake db:schema:load just fine.

In test, I get "Mysql::Error: Duplicate entry '2147483647' for key 1: INSERT INTO ts_schema_migrations (version) VALUES ('20081008010000')."

On further investigation, the version column in ts_schema_migrations in my dev database is a VARCHAR(255). In the test database, it's an INTEGER.

WHY???!?!?!?!?

Reported by Gaius Centus Novus · January 12th, 2009 @ 07:42 PM

State: invalid
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • State changed from new to invalid
    • Assigned user set to Pratik

    You should submit a failing test or a patch - http://guides.rails.info/contrib...

    Thanks !

    March 13th, 2009 @ 11:08 AM

  2. Ben Woosley
    Ben Woosley
    • Tag changed from 2.1.1, migrations, schema to 2.1.1, 2.3.5, migrations, schema
    • Importance changed from to

    I ran into the same problem in 2.3.5, and it seems to be an issue with the prefix, as it was resolved once I dropped the prefix and monkey-patched the migrator to look for the prefix-less schema_migrations table. e.g:

    module ActiveRecord
      class Migrator
        class << self
          def schema_migrations_table_name
            return 'schema_migrations' if Base.connection.table_exists?('schema_migrations')
            Base.table_name_prefix + 'schema_migrations' + Base.table_name_suffix
          end
        end
      end
    end
    

    August 5th, 2010 @ 08:56 PM