diff options
author | Avi Miller <avi.miller@gmail.com> | 2009-10-02 21:55:35 +1000 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-10-24 08:36:58 +1100 |
commit | c61335f66f897bc64992c4e9209ea517193c8e30 (patch) | |
tree | 16e53b465cf88fd6162f7e73fea045b189bc0fa9 /lib/puppet/rails/database | |
parent | aea1e5fa34412dd843b937263d92c4fab9628b83 (diff) | |
download | puppet-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.rb | 9 |
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 |