diff options
Diffstat (limited to 'lib/puppet/rails/database.rb')
-rw-r--r-- | lib/puppet/rails/database.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/puppet/rails/database.rb b/lib/puppet/rails/database.rb new file mode 100644 index 000000000..3127693cf --- /dev/null +++ b/lib/puppet/rails/database.rb @@ -0,0 +1,36 @@ +class Puppet::Rails::Database < ActiveRecord::Migration + require 'sqlite3' + + def self.up + ActiveRecord::Migration.verbose = false + + create_table :rails_objects do |table| + table.column :name, :string, :null => false + table.column :ptype, :string, :null => false + table.column :tags, :string + table.column :file, :string + table.column :line, :integer + table.column :host_id, :integer + table.column :collectable, :boolean + end + + create_table :rails_parameters do |table| + table.column :name, :string, :null => false + table.column :value, :string, :null => false + table.column :rails_object_id, :integer + end + + create_table :hosts do |table| + table.column :name, :string, :null => false + table.column :ip, :string + table.column :facts, :string + table.column :classes, :string + end + end + + def self.down + drop_table :rails_objects + drop_table :rails_parameters + drop_table :hosts + end +end |