[Pkg-puppet-devel] Bug#774643: [DRE-maint] Bug#774643: verify_active_connections is not present in ruby-activerecord 4.1.8

Apollon Oikonomopoulos apoikos at debian.org
Tue Mar 3 14:50:47 UTC 2015


Just a small update to the patch, to fix database creation.  
lib/puppet/rails/database/schema.rb contains a lot of:

  add_index <blah>, :integer => true

statements. The :integer => true option to add_index method is not documented
anywhere, not even in the earliest versions of ActiveRecord. Up to Rails 4.0[1]
it was ignored, but now it causes the application to break:
    
    stderr: Unknown key: :integer. Valid keys are: :unique, :order, :name,
            :where, :length, :internal, :using, :algorithm, :type
    
It looks like we can safely remove these options altogether, as they
were never valid in the first place. See interdiff at [2].

Regards,
Apollon

[1] https://github.com/rails/rails/commit/8fc52706c376be03f644e847d1dd357fc88ead6f

[2] interdiff:
diff --git a/lib/puppet/rails/database/schema.rb b/lib/puppet/rails/database/schema.rb
index 931a1b6..1216719 100644
--- a/lib/puppet/rails/database/schema.rb
+++ b/lib/puppet/rails/database/schema.rb
@@ -19,8 +19,8 @@ class Puppet::Rails::Schema
           t.column :updated_at, :datetime
           t.column :created_at, :datetime
         end
-        add_index :resources, :host_id, :integer => true
-        add_index :resources, :source_file_id, :integer => true
+        add_index :resources, :host_id
+        add_index :resources, :source_file_id
 
         # Thanks, mysql!  MySQL requires a length on indexes in text fields.
         # So, we provide them for mysql and handle everything else specially.
@@ -45,8 +45,8 @@ class Puppet::Rails::Schema
           t.column :updated_at, :datetime
           t.column :created_at, :datetime
         end
-        add_index :resource_tags, :resource_id, :integer => true
-        add_index :resource_tags, :puppet_tag_id, :integer => true
+        add_index :resource_tags, :resource_id
+        add_index :resource_tags, :puppet_tag_id
 
         create_table :puppet_tags do |t|
           t.column :name, :string
@@ -55,7 +55,7 @@ class Puppet::Rails::Schema
         end
 
         # Oracle automatically creates a primary key index
-        add_index :puppet_tags, :id, :integer => true if Puppet[:dbadapter] != "oracle_enhanced"
+        add_index :puppet_tags, :id if Puppet[:dbadapter] != "oracle_enhanced"
 
         create_table :hosts do |t|
           t.column :name, :string, :null => false
@@ -69,7 +69,7 @@ class Puppet::Rails::Schema
           t.column :source_file_id, :integer
           t.column :created_at, :datetime
         end
-        add_index :hosts, :source_file_id, :integer => true
+        add_index :hosts, :source_file_id
         add_index :hosts, :name
 
         create_table :fact_names do |t|
@@ -86,8 +86,8 @@ class Puppet::Rails::Schema
           t.column :updated_at, :datetime
           t.column :created_at, :datetime
         end
-        add_index :fact_values, :fact_name_id, :integer => true
-        add_index :fact_values, :host_id, :integer => true
+        add_index :fact_values, :fact_name_id
+        add_index :fact_values, :host_id
 
         create_table :param_values do |t|
           t.column :value,  :text, :null => false
@@ -97,8 +97,8 @@ class Puppet::Rails::Schema
           t.column :updated_at, :datetime
           t.column :created_at, :datetime
         end
-        add_index :param_values, :param_name_id, :integer => true
-        add_index :param_values, :resource_id, :integer => true
+        add_index :param_values, :param_name_id
+        add_index :param_values, :resource_id
 
         create_table :param_names do |t|
           t.column :name, :string, :null => false

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Storeconfigs-compatibility-with-ActiveRecord-4.patch
Type: text/x-diff
Size: 9151 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-puppet-devel/attachments/20150303/03132977/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-puppet-devel/attachments/20150303/03132977/attachment.sig>


More information about the Pkg-puppet-devel mailing list