<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -45,6 +45,7 @@ module Mack
       end
     end
     
+    # Loads the structure of the given file into the database
     def self.load_structure(file, env = Mack.env, repis = :default)
       Mack::Database.establish_connection(env)
       dbs = db_settings(env)
@@ -60,6 +61,7 @@ module Mack
       end
     end
     
+    # Dumps the structure of the database to a file.
     def self.dump_structure(env = Mack.env, repis = :default)
       Mack::Database.establish_connection(env)
       dbs = db_settings(env)
@@ -131,157 +133,4 @@ module Mack
     end
     
   end # Database
-  
-end # Mack
-
-
-# #
-# # AR db create/drop.
-# # Currently it supports 3 adapters: sqlite3, postgresql, and mysql
-# #
-# # ds - July 2008
-# #
-# 
-# module Mack
-#   module Database
-#     
-#     module Migrator
-#       def self.version
-#         ActiveRecord::Migrator.current_version
-#       end
-#       
-#       def self.migrate
-#         ActiveRecord::Migrator.up(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;))
-#       end
-#       
-#       def self.rollback(step = 1)
-#         step = (ENV[&quot;STEP&quot;] || step).to_i
-#         cur_version = version.to_i
-#         target_version = cur_version - step 
-#         target_version = 0 if target_version &lt; 0
-#         
-#         ActiveRecord::Migrator.down(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;), target_version)
-#       end
-#       
-#     end
-#         
-#     def self.db_settings(env)
-#       dbs = YAML::load(ERB.new(IO.read(File.join(Mack.root, &quot;config&quot;, &quot;database.yml&quot;))).result)
-#       dbs = dbs[env]
-#       dbs.symbolize_keys!
-#       return dbs
-#     end
-#     
-#     def self.establish_connection(env)
-#       dbs = db_settings(env)
-#       ActiveRecord::Base.establish_connection(dbs)
-#     end
-#     
-#     # Perform db create or drop
-#     # 
-#     # By default the mode is drop then create, but caller will be able to 
-#     # call this routine with a specific action (:drop, :create, or :drop_and_create)
-#     # 
-#     def self.drop_or_create_database(env, mode = :drop_and_create)
-#       dbs = db_settings(env)
-#       case dbs[:adapter]
-#         when &quot;mysql&quot;
-#           establish_mysql_connection
-#           drop_mysql_db(env, dbs) if mode == :drop or mode == :drop_and_create
-#           create_mysql_db(env, dbs) if mode == :create or mode == :drop_and_create
-#           
-#         when &quot;postgresql&quot;
-#           ENV['PGHOST']     = dbs[:host] if dbs[:host]
-#           ENV['PGPORT']     = dbs[:port].to_s if dbs[:port]
-#           ENV['PGPASSWORD'] = dbs[:password].to_s if dbs[:password]
-#           
-#           ActiveRecord::Base.clear_active_connections!
-#           drop_postgresql_db(env, dbs) if mode == :drop or mode == :drop_and_create
-#           create_postgresql_db(env, dbs) if mode == :create or mode == :drop_and_create
-#           
-#         when &quot;sqlite3&quot;
-#           ActiveRecord::Base.clear_active_connections!
-#           FileUtils.rm_rf(dbs[:database]) if mode == :drop or mode == :drop_and_create
-#       end
-#     end
-#     
-#     def self.load_structure(file, env = Mack.env)
-#       Mack::Database.establish_connection(env)
-#       dbs = db_settings(env)
-#       sql = File.read(file)
-#       case dbs[:adapter]
-#       when &quot;mysql&quot;
-#         sql.split(&quot;;&quot;).each do |s|
-#           s.strip! 
-#           ActiveRecord::Base.connection.execute(s) unless s.blank?
-#         end
-#       else
-#         ActiveRecord::Base.connection.execute(sql) unless sql.blank?
-#       end
-#     end
-#     
-#     def self.dump_structure(env = Mack.env)
-#       Mack::Database.establish_connection(env)
-#       dbs = db_settings(env)
-#       structure = &quot;&quot;
-#       output_file = File.join(Mack.root, &quot;db&quot;, &quot;#{env}_schema_structure.sql&quot;)
-#       case dbs[:adapter]
-#       when &quot;mysql&quot;
-#         File.open(output_file, &quot;w&quot;) {|f| f.puts ActiveRecord::Base.connection.structure_dump}
-#       when &quot;postgresql&quot;
-#         `pg_dump -i -U &quot;#{dbs[:username]}&quot; -s -x -O -n #{ENV[&quot;SCHEMA&quot;] ||= &quot;public&quot;} -f #{output_file} #{dbs[:database]}`
-#       when &quot;sqlite3&quot;
-#         `sqlite3 #{dbs[:database]} .schema &gt; #{output_file}`
-#       else
-#         raise &quot;Task not supported for '#{dbs[:adapter]}'&quot;
-#       end
-#     end
-#             
-#     private
-#     
-#     def self.drop_postgresql_db(env, dbs)
-#       begin
-#         puts &quot;Dropping (PostgreSQL): #{dbs[:database]}&quot;
-#         `dropdb -U &quot;#{dbs[:username]}&quot; #{dbs[:database]}`
-#       rescue Exception =&gt; e
-#         puts e
-#       end
-#     end
-#     
-#     def self.create_postgresql_db(env, dbs)
-#       begin
-#         enc_option = &quot;-E #{dbs[:encoding]}&quot; if dbs[:encoding]
-#         puts &quot;Creating (PostgreSQL): #{dbs[:database]}&quot;
-#         `createdb #{enc_option} -U &quot;#{dbs[:username]}&quot; #{dbs[:database]}`
-#       rescue Exception =&gt; e
-#         puts e
-#       end
-#     end
-#     
-#     def self.establish_mysql_connection
-#       # connect to mysql meta database
-#       ActiveRecord::Base.establish_connection(
-#         :adapter =&gt; &quot;mysql&quot;,
-#         :host =&gt; &quot;localhost&quot;,
-#         :database =&gt; &quot;mysql&quot;,
-#         :username =&gt; ENV[&quot;DB_USERNAME&quot;] || &quot;root&quot;,
-#         :password =&gt; ENV[&quot;DB_PASSWORD&quot;] || &quot;&quot;
-#       )
-#     end
-#     
-#     def self.create_mysql_db(env, dbs)
-#       if dbs[:collation]
-#         puts &quot;Dropping (MySQL): #{dbs[:database]}&quot;
-#         ActiveRecord::Base.connection.execute &quot;CREATE DATABASE `#{dbs[:database]}` DEFAULT CHARACTER SET `#{dbs[:charset] || 'utf8'}` COLLATE `#{dbs[:collation]}`&quot;
-#       else
-#         puts &quot;Creating (MySQL): #{dbs[:database]}&quot;
-#         ActiveRecord::Base.connection.execute &quot;CREATE DATABASE `#{dbs[:database]}` DEFAULT CHARACTER SET `#{dbs[:charset] || 'utf8'}`&quot;
-#       end
-#     end
-#     
-#     def self.drop_mysql_db(env, dbs)
-#       puts &quot;Dropping (MySQL): #{dbs[:database]}&quot;
-#       ActiveRecord::Base.connection.execute &quot;DROP DATABASE IF EXISTS `#{dbs[:database]}`&quot;
-#     end
-#   end
-# end
\ No newline at end of file
+end # Mack
\ No newline at end of file</diff>
      <filename>mack-active_record/lib/mack-active_record/database.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,12 @@ module Mack
   module Database
     module Migrations
       
+      # Migrates the database to the latest version
       def self.migrate
         ActiveRecord::Migrator.up(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;))
       end
       
+      # Rolls back the database by the specified number of steps. Default is 1
       def self.rollback(step = 1)
         cur_version = version.to_i
         target_version = cur_version - step 
@@ -13,10 +15,11 @@ module Mack
         ActiveRecord::Migrator.down(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;), target_version)
       end
       
+      # Not implemented
       def self.abort_if_pending_migrations
-        # not implemented
       end
       
+      # Returns the current version of the database
       def self.version
         ActiveRecord::Migrator.current_version
       end</diff>
      <filename>mack-active_record/lib/mack-active_record/database_migrations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,7 @@ module Mack
       drop_database(repis)
     end
     
+    # Loads the structure of the given file into the database
     def self.load_structure(file, env = Mack.env, repis = :default)
       Mack::Database.establish_connection(env)
       adapter = repository(repis).adapter
@@ -43,6 +44,7 @@ module Mack
       end
     end
     
+    # Dumps the structure of the database to a file.
     def self.dump_structure(env = Mack.env, repis = :default)
       Mack::Database.establish_connection(env)
       adapter = repository(repis).adapter</diff>
      <filename>mack-data_mapper/lib/mack-data_mapper/database.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ module Mack
   module Database
     module Migrations
       
+      # Migrates the database to the latest version
       def self.migrate
         Mack::Database.establish_connection
         DataMapper::MigrationRunner.reset!
@@ -11,6 +12,7 @@ module Mack
         DataMapper::MigrationRunner.migrate_up!
       end
       
+      # Rolls back the database by the specified number of steps. Default is 1
       def self.rollback(step = 1)
         DataMapper::MigrationRunner.reset!
         migration_files.each { |mig| load mig }</diff>
      <filename>mack-data_mapper/lib/mack-data_mapper/database_migrations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,32 +4,39 @@ module Mack
     # Sets up and establishes connections to the database based on the specified environment
     # and the settings in the database.yml file.
     def self.establish_connection(env = Mack.env)
-      # raise NoMethodError.new(:establish_connection)
-    end # establish_connection
+      raise NoMethodError.new(:establish_connection)
+    end
+    
+    # Clears connections to the database
+    def self.clear_connection(env = Mack.env)
+      raise NoMethodError.new(:clear_connection)
+    end
     
     # Creates a database, if it doesn't already exist for the specified environment
     def self.create(env = Mack.env, repis = :default)
-      # raise NoMethodError.new(:create)
+      raise NoMethodError.new(:create)
     end
     
     # Drops a database, if it exists for the specified environment
     def self.drop(env = Mack.env, repis = :default)
-      # raise NoMethodError.new(:drop)
+      raise NoMethodError.new(:drop)
     end
     
+    # Drops and then creates the database.
     def self.recreate(env = Mack.env, repis = :default)
       Mack::Database.drop(env, repis)
       Mack::Database.create(env, repis)
     end
     
+    # Loads the structure of the given file into the database
     def self.load_structure(file, env = Mack.env, repis = :default)
-      # raise NoMethodError.new(:load_structure)
+      raise NoMethodError.new(:load_structure)
     end
     
+    # Dumps the structure of the database to a file.
     def self.dump_structure(env = Mack.env, repis = :default)
-      # raise NoMethodError.new(:dump_structure)
+      raise NoMethodError.new(:dump_structure)
     end
     
   end # Database
-  
 end # Mack
\ No newline at end of file</diff>
      <filename>mack-orm/lib/mack-orm/database.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,18 +2,26 @@ module Mack
   module Database
     module Migrations
       
+      # Migrates the database to the latest version
       def self.migrate
-        # raise NoMethodError.new(:migrate)
+        raise NoMethodError.new(:migrate)
       end
       
-      def self.rollback(step)
-        # raise NoMethodError.new(:rollback)
+      # Rolls back the database by the specified number of steps. Default is 1
+      def self.rollback(step = 1)
+        raise NoMethodError.new(:rollback)
       end
       
       def self.abort_if_pending_migrations
-        # raise NoMethodError.new(:abort_if_pending_migrations)
+        raise NoMethodError.new(:abort_if_pending_migrations)
       end
       
+      # Returns the current version of the database
+      def self.version
+        raise NoMethodError.new(:version)
+      end
+      
+      # Returns a list of the all migration files.
       def self.migration_files
         Dir.glob(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;, &quot;*.rb&quot;))
       end</diff>
      <filename>mack-orm/lib/mack-orm/database_migrations.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c408f55dc9210e4f601f6e5579199fa71dac0cbe</id>
    </parent>
  </parents>
  <author>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </author>
  <url>http://github.com/markbates/mack-more/commit/467e2c7ae9ebd850463b7a2a7758a6215f6cd38d</url>
  <id>467e2c7ae9ebd850463b7a2a7758a6215f6cd38d</id>
  <committed-date>2008-08-12T12:42:04-07:00</committed-date>
  <authored-date>2008-08-12T12:42:04-07:00</authored-date>
  <message>Cleaned up a little bit. [#87]</message>
  <tree>3f7c7a17f5f0b152759c9160e423e156bd46ea86</tree>
  <committer>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </committer>
</commit>
