Class: Desert::PluginMigrations::Migrator

Inherits:
ActiveRecord::Migrator
  • Object
show all
Defined in:
lib/desert/plugin_migrations/migrator.rb

Overview

Responsible for migrating plugins. PluginMigrations.Migrator.current_plugin indicates which plugin is currently being migrated

Class Method Summary collapse

Class Method Details

.migrate_plugin(plugin, version = nil) ⇒ Object

Runs the migrations from a plugin, up (or down) to the version given



11
12
13
14
15
16
17
# File 'lib/desert/plugin_migrations/migrator.rb', line 11

def migrate_plugin(plugin, version = nil)
  self.current_plugin = plugin
  if ActiveRecord::Base.connection.respond_to?(:initialize_schema_migrations_table)
    ActiveRecord::Base.connection.initialize_schema_migrations_table
  end
  migrate(plugin.migration_path, version)
end

.schema_info_table_nameObject

:nodoc:



19
20
21
# File 'lib/desert/plugin_migrations/migrator.rb', line 19

def schema_info_table_name #:nodoc:
  ActiveRecord::Base.table_name_prefix + 'plugin_schema_info' + ActiveRecord::Base.table_name_suffix
end

.schema_migrations_table_nameObject



23
24
25
# File 'lib/desert/plugin_migrations/migrator.rb', line 23

def schema_migrations_table_name
  ActiveRecord::Base.table_name_prefix + 'plugin_schema_migrations' + ActiveRecord::Base.table_name_suffix
end