rake db:schema:load not populating schema_migrations table

ruby-on-rails, schema, sql-server

Solution

Per D. Patrick, answering my own question:

So the end result was that another developer had installed `activerecord-nulldb-adapter`, which monkey patches `ActiveRecord::Schema.define` and doesn't run `initialize_schema_migrations_table()` or `assume_migrated_up_version()`. I uninstalled the gem, ran my `db:schema:load` just fine.

Problem

I have a fresh database that I'm attempting to recreate, but running rake db:schema:load does not populate the schema_migrations table at all. The result of this is every migration is now pending. The schema version in schema.rb matches the latest migration, and this answer would indicate what I thought was happening (Rails populates the migrations table with all migration numbers prior to the current migration nubmer) is, in this particular instance, not happening. My coworkers have confirmed this is happening with their databases as well so it's definitely a project-wide problem. We're using SQLServer with a custom schema, though the db user is correctly creating all tables. I'm completely stumped. Any ideas?

Original source