summaryrefslogtreecommitdiffstats
path: root/lib/puppet/rails/database
diff options
context:
space:
mode:
authorAvi Miller <avi.miller@gmail.com>2009-10-02 21:55:35 +1000
committerJames Turnbull <james@lovedthanlost.net>2009-10-24 08:36:58 +1100
commitc61335f66f897bc64992c4e9209ea517193c8e30 (patch)
tree16e53b465cf88fd6162f7e73fea045b189bc0fa9 /lib/puppet/rails/database
parentaea1e5fa34412dd843b937263d92c4fab9628b83 (diff)
downloadpuppet-c61335f66f897bc64992c4e9209ea517193c8e30.tar.gz
puppet-c61335f66f897bc64992c4e9209ea517193c8e30.tar.xz
puppet-c61335f66f897bc64992c4e9209ea517193c8e30.zip
Patch to address feature #2571 to add Oracle support to Puppet
Adapter requires specifying database, username and password. Signed-off-by: Avi Miller <avi.miller@gmail.com>
Diffstat (limited to 'lib/puppet/rails/database')
-rw-r--r--lib/puppet/rails/database/schema.rb9
1 files changed, 7 insertions, 2 deletions
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