cauta-desert 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,8 +3,11 @@ ActiveRecord::ConnectionAdapters::SchemaStatements.module_eval do
3
3
  initialize_schema_migrations_table_without_plugins
4
4
 
5
5
  begin
6
- execute "CREATE TABLE #{Desert::PluginMigrations::Migrator.schema_migrations_table_name} (plugin_name #{type_to_sql(:string)}, version #{type_to_sql(:string)})"
7
- plugins_and_versions = select_all("SELECT plugin_name, version from #{Desert::PluginMigrations::Migrator.schema_migrations_table_name}")
6
+ psm_table = ActiveRecord::Migrator.schema_migrations_table_name
7
+ unless ActiveRecord::Base.connection.table_exists?(psm_table)
8
+ execute "CREATE TABLE #{psm_table} (plugin_name #{type_to_sql(:string)}, version #{type_to_sql(:string)})"
9
+ end
10
+ plugins_and_versions = select_all("SELECT plugin_name, version from #{psm_table}")
8
11
  plugins_and_versions.each do |plugin_data|
9
12
  plugin_name, version = plugin_data["plugin_name"], plugin_data["version"]
10
13
  plugin = Desert::Manager.find_plugin(plugin_name)
@@ -30,4 +33,4 @@ ActiveRecord::ConnectionAdapters::SchemaStatements.module_eval do
30
33
  end
31
34
  end
32
35
  alias_method_chain :initialize_schema_migrations_table, :plugins
33
- end
36
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cauta-desert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal Labs