From c61335f66f897bc64992c4e9209ea517193c8e30 Mon Sep 17 00:00:00 2001 From: Avi Miller Date: Fri, 2 Oct 2009 21:55:35 +1000 Subject: Patch to address feature #2571 to add Oracle support to Puppet Adapter requires specifying database, username and password. Signed-off-by: Avi Miller --- lib/puppet/rails/database/schema.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/puppet/rails/database') diff --git a/lib/puppet/rails/database/schema.rb b/lib/puppet/rails/database/schema.rb index d8fcbb418..434197b05 100644 --- a/lib/puppet/rails/database/schema.rb +++ b/lib/puppet/rails/database/schema.rb @@ -21,9 +21,10 @@ class Puppet::Rails::Schema # Thanks, mysql! MySQL requires a length on indexes in text fields. # So, we provide them for mysql and handle everything else specially. + # Oracle doesn't index on CLOB fields, so we skip it if Puppet[:dbadapter] == "mysql" execute "CREATE INDEX typentitle ON resources (restype,title(50));" - else + elsif Puppet[:dbadapter] != "oracle_enhanced" add_index :resources, [:title, :restype] end @@ -49,7 +50,11 @@ class Puppet::Rails::Schema t.column :updated_at, :datetime t.column :created_at, :datetime end - add_index :puppet_tags, :id, :integer => true + + # Oracle automatically creates a primary key index + if Puppet[:dbadapter] != "oracle_enhanced" + add_index :puppet_tags, :id, :integer => true + end create_table :hosts do |t| t.column :name, :string, :null => false -- cgit