summaryrefslogtreecommitdiffstats
path: root/lib/puppet/rails/database/schema.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-06-14 03:38:19 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-06-14 03:38:19 +0000
commit9bc236b6a20f29d8e06b2769c74bd3d12dcd9081 (patch)
tree6b3d8f7d6bbaf732461c5d69b3003701cbb84f92 /lib/puppet/rails/database/schema.rb
parent7c53aab1ad228636c13aa558838d2d57234bf97a (diff)
downloadpuppet-9bc236b6a20f29d8e06b2769c74bd3d12dcd9081.tar.gz
puppet-9bc236b6a20f29d8e06b2769c74bd3d12dcd9081.tar.xz
puppet-9bc236b6a20f29d8e06b2769c74bd3d12dcd9081.zip
Adding indexes for the rails tables
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2575 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/rails/database/schema.rb')
-rw-r--r--lib/puppet/rails/database/schema.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/puppet/rails/database/schema.rb b/lib/puppet/rails/database/schema.rb
index d66d9f56e..0bc4bc5cb 100644
--- a/lib/puppet/rails/database/schema.rb
+++ b/lib/puppet/rails/database/schema.rb
@@ -15,23 +15,34 @@ class Puppet::Rails::Schema
t.column :line, :integer
t.column :updated_at, :datetime
end
+ add_index :resources, :id, :integer => true
+ add_index :resources, :host_id, :integer => true
+ add_index :resources, :source_file_id, :integer => true
+ add_index :resources, [:title, :restype]
create_table :source_files do |t|
t.column :filename, :string
t.column :path, :string
t.column :updated_at, :datetime
end
+ add_index :source_files, :id, :integer => true
+ add_index :source_files, :filename
create_table :resource_tags do |t|
t.column :resource_id, :integer
t.column :puppet_tag_id, :integer
t.column :updated_at, :datetime
end
+ add_index :resource_tags, :id, :integer => true
+ add_index :resource_tags, :resource_id, :integer => true
+ add_index :resource_tags, :puppet_tag_id, :integer => true
create_table :puppet_tags do |t|
t.column :name, :string
t.column :updated_at, :datetime
end
+ add_index :puppet_tags, :id, :integer => true
+ add_index :puppet_tags, :name
create_table :hosts do |t|
t.column :name, :string, :null => false
@@ -43,11 +54,16 @@ class Puppet::Rails::Schema
t.column :updated_at, :datetime
t.column :source_file_id, :integer
end
+ add_index :hosts, :id, :integer => true
+ add_index :hosts, :source_file_id, :integer => true
+ add_index :hosts, :name
create_table :fact_names do |t|
t.column :name, :string, :null => false
t.column :updated_at, :datetime
end
+ add_index :fact_names, :id, :integer => true
+ add_index :fact_names, :name
create_table :fact_values do |t|
t.column :value, :text, :null => false
@@ -55,6 +71,9 @@ class Puppet::Rails::Schema
t.column :host_id, :integer, :null => false
t.column :updated_at, :datetime
end
+ add_index :fact_values, :id, :integer => true
+ add_index :fact_values, :fact_name_id, :integer => true
+ add_index :fact_values, :host_id, :integer => true
create_table :param_values do |t|
t.column :value, :text, :null => false
@@ -63,11 +82,16 @@ class Puppet::Rails::Schema
t.column :resource_id, :integer
t.column :updated_at, :datetime
end
+ add_index :param_values, :id, :integer => true
+ add_index :param_values, :param_name_id, :integer => true
+ add_index :param_values, :resource_id, :integer => true
create_table :param_names do |t|
t.column :name, :string, :null => false
t.column :updated_at, :datetime
end
+ add_index :param_names, :id, :integer => true
+ add_index :param_names, :name
end
end
ensure