pivotalexperimental / desert

Desert is a component framework for Rails that allows your plugins have a Rails app like directory structure, routes, migrations, and dependencies.
http://desert.rubyforge.org
186 stars 31 forks source link

backfilling plugin_schema_migrations broken plugin_schema_migrations already exists #2

Open joemoore opened 15 years ago

joemoore commented 15 years ago

On our project we collapsed our migrations, and after the first migration runs we have a plugin_schema_info table that looks like this:

  +----------------+---------+
  | plugin_name    | version |
  +----------------+---------+
  | tags           |       3 |
  | user           |      17 |
  +----------------+---------+

We also have an empty plugin_schema_migrations table.

Later, we run the following:

  class UpgradeUserPluginTo18 < ActiveRecord::Migration
    def self.up
      migrate_plugin('user', 18)
    end
  ...

The code on line 6 of lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb blows up and the exception is eaten silently when the plugin_schema_migrations already exists. The plugin versions are not backfilled and the User plugin migrations run from migration 1.