diff options
author | ballman <ballman@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-06-12 00:31:16 +0000 |
---|---|---|
committer | ballman <ballman@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-06-12 00:31:16 +0000 |
commit | 68e37a99d5357f022662f9ba7cc564c48aed21a9 (patch) | |
tree | e8d94cc9ea44d312e8b96f94c887b88fc1b04e0f /lib/puppet/rails/database/schema.rb | |
parent | c26f678178d173bd7360362b2959af51c4d39762 (diff) | |
download | puppet-68e37a99d5357f022662f9ba7cc564c48aed21a9.tar.gz puppet-68e37a99d5357f022662f9ba7cc564c48aed21a9.tar.xz puppet-68e37a99d5357f022662f9ba7cc564c48aed21a9.zip |
Major rework of the rails feature. Changed the relationship between
host and facts (now many-to-many with fact_name through fact_values).
Also changed the relationship between resource and params (similarly
many-to-many with param_names through param_values).
Added the resource_tags and puppet_tags. The latter has the tag names
and the former is the man-to-many link with resources.
There is a little clean up left but the schema is in order. Also a test
for the tags stuff is required.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2565 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/rails/database/schema.rb')
-rw-r--r-- | lib/puppet/rails/database/schema.rb | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/lib/puppet/rails/database/schema.rb b/lib/puppet/rails/database/schema.rb index f8960f2d0..d66d9f56e 100644 --- a/lib/puppet/rails/database/schema.rb +++ b/lib/puppet/rails/database/schema.rb @@ -22,10 +22,14 @@ class Puppet::Rails::Schema t.column :updated_at, :datetime end - create_table :puppet_classes do |t| + create_table :resource_tags do |t| + t.column :resource_id, :integer + t.column :puppet_tag_id, :integer + t.column :updated_at, :datetime + end + + create_table :puppet_tags do |t| t.column :name, :string - t.column :host_id, :integer - t.column :source_file_id, :integer t.column :updated_at, :datetime end @@ -42,47 +46,34 @@ class Puppet::Rails::Schema create_table :fact_names do |t| t.column :name, :string, :null => false - t.column :host_id, :integer, :null => false t.column :updated_at, :datetime end create_table :fact_values do |t| t.column :value, :text, :null => false t.column :fact_name_id, :integer, :null => false + t.column :host_id, :integer, :null => false t.column :updated_at, :datetime end create_table :param_values do |t| t.column :value, :text, :null => false t.column :param_name_id, :integer, :null => false + t.column :line, :integer + t.column :resource_id, :integer t.column :updated_at, :datetime end create_table :param_names do |t| t.column :name, :string, :null => false - t.column :resource_id, :integer - t.column :line, :integer - t.column :updated_at, :datetime - end - - create_table :tags do |t| - t.column :name, :string - t.column :updated_at, :datetime - end - - create_table :taggings do |t| - t.column :tag_id, :integer - t.column :taggable_id, :integer - t.column :taggable_type, :string t.column :updated_at, :datetime end - end - $stdout.close - $stdout = oldout - oldout = nil + end end ensure + $stdout.close $stdout = oldout if oldout + oldout = nil end end |