<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>mack-active_record/lib/mack-active_record/database_migrations.rb</filename>
    </added>
    <added>
      <filename>mack-active_record/spec/lib/db_create_drop_spec.rb</filename>
    </added>
    <added>
      <filename>mack-active_record/spec/lib/db_migrations_spec.rb</filename>
    </added>
    <added>
      <filename>mack-active_record/spec/lib/db_structure_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,74 +1,51 @@
-#
-# 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)
+    # 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)
       dbs = db_settings(env)
       ActiveRecord::Base.establish_connection(dbs)
+    end # establish_connection
+    
+    # Creates a database, if it doesn't already exist for the specified environment
+    def self.create(env = Mack.env, repis = :default)
+      dbs = db_settings(env)
+      case dbs[:adapter]
+      when &quot;mysql&quot;
+        establish_mysql_connection
+        create_mysql_db(env, dbs)
+      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!
+        create_postgresql_db(env, dbs)
+      when &quot;sqlite3&quot;
+        ActiveRecord::Base.clear_active_connections!
+      end
     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)
+    # Drops a database, if it exists for the specified environment
+    def self.drop(env = Mack.env, repis = :default)
       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
+      when &quot;mysql&quot;
+        establish_mysql_connection
+        drop_mysql_db(env, dbs)
+      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)
+      when &quot;sqlite3&quot;
+        ActiveRecord::Base.clear_active_connections!
+        FileUtils.rm_rf(dbs[:database])
       end
     end
     
-    def self.load_structure(file, env = Mack.env)
+    def self.load_structure(file, env = Mack.env, repis = :default)
       Mack::Database.establish_connection(env)
       dbs = db_settings(env)
       sql = File.read(file)
@@ -83,7 +60,7 @@ module Mack
       end
     end
     
-    def self.dump_structure(env = Mack.env)
+    def self.dump_structure(env = Mack.env, repis = :default)
       Mack::Database.establish_connection(env)
       dbs = db_settings(env)
       structure = &quot;&quot;
@@ -99,8 +76,14 @@ module Mack
         raise &quot;Task not supported for '#{dbs[:adapter]}'&quot;
       end
     end
-            
+    
     private
+    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.drop_postgresql_db(env, dbs)
       begin
@@ -146,5 +129,159 @@ module Mack
       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 # 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</diff>
      <filename>mack-active_record/lib/mack-active_record/database.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,52 +1,52 @@
-require 'rake'
-namespace :db do
-    
-  task :drop =&gt; :environment do
-    Mack::Database.drop_or_create_database(Mack.env, :drop)    
-  end
-  
-  namespace :drop do 
-    desc &quot;Drop databases for both development and test environemnt&quot;
-    task :all =&gt; :environment do
-      Mack::Database.drop_or_create_database(&quot;development&quot;, :drop)
-      Mack::Database.drop_or_create_database(&quot;test&quot;, :drop)
-    end
-  end
-  
-  task :create do
-    puts Mack.env
-    Mack::Database.drop_or_create_database(Mack.env, :create)
-  end
-  
-  task :recreate do
-    puts Mack.env
-    Mack::Database.drop_or_create_database(Mack.env, :drop_and_create)
-  end
-  
-  namespace :create do
-    desc &quot;Creates your Full environment. Does NOT create your production database!&quot;
-    task :all =&gt; :environment do
-      abcs = YAML::load(ERB.new(IO.read(File.join(Mack.root, &quot;config&quot;, &quot;database.yml&quot;))).result)
-      db_settings = abcs[Mack.env]
-      
-      Mack::Database.drop_or_create_database(&quot;development&quot;, :create)
-      Mack::Database.drop_or_create_database(&quot;test&quot;, :create)
-      ActiveRecord::Base.establish_connection(db_settings)
-      Rake::Task[&quot;db:migrate&quot;].invoke
-    end
-  end
-  
-  namespace :recreate do
-    desc &quot;Creates your Full environment. Does NOT create your production database!&quot;
-    task :all =&gt; :environment do
-      abcs = YAML::load(ERB.new(IO.read(File.join(Mack.root, &quot;config&quot;, &quot;database.yml&quot;))).result)
-      db_settings = abcs[Mack.env]
-      
-      Mack::Database.drop_or_create_database(&quot;development&quot;)
-      Mack::Database.drop_or_create_database(&quot;test&quot;)
-      ActiveRecord::Base.establish_connection(db_settings)
-      Rake::Task[&quot;db:migrate&quot;].invoke
-    end
-  end
-    
-end
+# require 'rake'
+# namespace :db do
+#     
+#   task :drop =&gt; :environment do
+#     Mack::Database.drop_or_create_database(Mack.env, :drop)    
+#   end
+#   
+#   namespace :drop do 
+#     desc &quot;Drop databases for both development and test environemnt&quot;
+#     task :all =&gt; :environment do
+#       Mack::Database.drop_or_create_database(&quot;development&quot;, :drop)
+#       Mack::Database.drop_or_create_database(&quot;test&quot;, :drop)
+#     end
+#   end
+#   
+#   task :create do
+#     puts Mack.env
+#     Mack::Database.drop_or_create_database(Mack.env, :create)
+#   end
+#   
+#   task :recreate do
+#     puts Mack.env
+#     Mack::Database.drop_or_create_database(Mack.env, :drop_and_create)
+#   end
+#   
+#   namespace :create do
+#     desc &quot;Creates your Full environment. Does NOT create your production database!&quot;
+#     task :all =&gt; :environment do
+#       abcs = YAML::load(ERB.new(IO.read(File.join(Mack.root, &quot;config&quot;, &quot;database.yml&quot;))).result)
+#       db_settings = abcs[Mack.env]
+#       
+#       Mack::Database.drop_or_create_database(&quot;development&quot;, :create)
+#       Mack::Database.drop_or_create_database(&quot;test&quot;, :create)
+#       ActiveRecord::Base.establish_connection(db_settings)
+#       Rake::Task[&quot;db:migrate&quot;].invoke
+#     end
+#   end
+#   
+#   namespace :recreate do
+#     desc &quot;Creates your Full environment. Does NOT create your production database!&quot;
+#     task :all =&gt; :environment do
+#       abcs = YAML::load(ERB.new(IO.read(File.join(Mack.root, &quot;config&quot;, &quot;database.yml&quot;))).result)
+#       db_settings = abcs[Mack.env]
+#       
+#       Mack::Database.drop_or_create_database(&quot;development&quot;)
+#       Mack::Database.drop_or_create_database(&quot;test&quot;)
+#       ActiveRecord::Base.establish_connection(db_settings)
+#       Rake::Task[&quot;db:migrate&quot;].invoke
+#     end
+#   end
+#     
+# end</diff>
      <filename>mack-active_record/lib/mack-active_record/tasks/db_create_drop_tasks.rake</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,21 @@
-require 'rake'
-namespace :db do
-  
-  desc &quot;Migrate the database through scripts in db/migrations&quot;
-  task :migrate =&gt; &quot;mack:environment&quot; do
-    #ActiveRecord::Migrator.up(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;))
-    Mack::Database::Migrator.migrate
-  end # migrate
-  
-  desc &quot;Rolls the schema back to the previous version. Specify the number of steps with STEP=n&quot;
-  task :rollback =&gt; [&quot;mack:environment&quot;] do
-    Mack::Database::Migrator.rollback
-    #ActiveRecord::Migrator.rollback(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;), (ENV[&quot;STEP&quot;] || 1).to_i)
-  end # rollback
-
-  desc &quot;Displays the current schema version of your database&quot;
-  task :version =&gt; &quot;mack:environment&quot; do
-    puts &quot;\nYour database is currently at version: #{Mack::Database::Migrator.version}\n&quot;
-  end
-  
-end # db
\ No newline at end of file
+# require 'rake'
+# namespace :db do
+#   
+#   desc &quot;Migrate the database through scripts in db/migrations&quot;
+#   task :migrate =&gt; &quot;mack:environment&quot; do
+#     #ActiveRecord::Migrator.up(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;))
+#     Mack::Database::Migrator.migrate
+#   end # migrate
+#   
+#   desc &quot;Rolls the schema back to the previous version. Specify the number of steps with STEP=n&quot;
+#   task :rollback =&gt; [&quot;mack:environment&quot;] do
+#     Mack::Database::Migrator.rollback
+#     #ActiveRecord::Migrator.rollback(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;), (ENV[&quot;STEP&quot;] || 1).to_i)
+#   end # rollback
+# 
+#   desc &quot;Displays the current schema version of your database&quot;
+#   task :version =&gt; &quot;mack:environment&quot; do
+#     puts &quot;\nYour database is currently at version: #{Mack::Database::Migrator.version}\n&quot;
+#   end
+#   
+# end # db
\ No newline at end of file</diff>
      <filename>mack-active_record/lib/mack-active_record/tasks/db_migration_tasks.rake</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,18 @@
-namespace :test do
-  
-  task :setup do
-    ENV[&quot;MACK_ENV&quot;] = &quot;test&quot;
-    Mack.reset_logger!
-    Rake::Task[&quot;db:recreate&quot;].invoke
-    Mack::Database.dump_structure(&quot;development&quot;)
-    Mack::Database.load_structure(File.join(Mack.root, &quot;db&quot;, &quot;development_schema_structure.sql&quot;))
-    
-    # auto require factories:
-    Dir.glob(File.join(Mack.root, &quot;test&quot;, &quot;factories&quot;, &quot;**/*.rb&quot;)).each do |f|
-      require f
-    end
-    
-    run_factories(:init) if respond_to?(:run_factories)
-  end
-  
-end
\ No newline at end of file
+# namespace :test do
+#   
+#   task :setup do
+#     ENV[&quot;MACK_ENV&quot;] = &quot;test&quot;
+#     Mack.reset_logger!
+#     Rake::Task[&quot;db:recreate&quot;].invoke
+#     Mack::Database.dump_structure(&quot;development&quot;)
+#     Mack::Database.load_structure(File.join(Mack.root, &quot;db&quot;, &quot;development_schema_structure.sql&quot;))
+#     
+#     # auto require factories:
+#     Dir.glob(File.join(Mack.root, &quot;test&quot;, &quot;factories&quot;, &quot;**/*.rb&quot;)).each do |f|
+#       require f
+#     end
+#     
+#     run_factories(:init) if respond_to?(:run_factories)
+#   end
+#   
+# end
\ No newline at end of file</diff>
      <filename>mack-active_record/lib/mack-active_record/tasks/test_tasks.rake</filename>
    </modified>
    <modified>
      <diff>@@ -33,9 +33,11 @@ module Spec
             # if exists delete the db created by this task
             config_db(adapter) do
               if db_exists?(&quot;foo_development&quot;)
-                rake_task(&quot;db:drop&quot;)
+                # rake_task(&quot;db:drop&quot;)
+                Mack::Database.drop
               elsif db_exists?(&quot;foo_test&quot;)
-                rake_task(&quot;db:drop&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
+                Mack::Database.create(&quot;test&quot;)
+                # rake_task(&quot;db:drop&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
               end
             end
           rescue Exception =&gt; ex</diff>
      <filename>mack-active_record/spec/create_and_drop_task_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,164 +1,164 @@
-require 'pathname'
-require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
-
-describe &quot;rake&quot; do
-
-  describe &quot;db&quot; do
-
-    describe &quot;create&quot; do
-
-      describe &quot;MySQL&quot; do
-        include Spec::CreateAndDropTask::Helper::MySQL
-        
-        before(:each) do
-          ENV[&quot;MACK_ENV&quot;] = &quot;development&quot;
-          clear_connection
-        end
-        
-        after(:all) do 
-          cleanup_db
-        end
-        
-        it &quot;should create a MySQL db for the current environment&quot; do
-          config_db(:mysql) do
-            rake_task(&quot;db:recreate&quot;)
-            db_exists?(&quot;foo_development&quot;).should == true
-          end
-        end
-        
-        it &quot;should drop/create a MySQL db if it already exists for the current environment&quot; do
-          config_db(:mysql) do
-            rake_task(&quot;db:recreate&quot;)
-            db_exists?(&quot;foo_development&quot;).should == true
-            rake_task(&quot;db:drop&quot;)
-            db_exists?(&quot;foo_development&quot;).should == false
-          end
-        end
-        
-        it &quot;should create a MySQL db for the specified environment&quot; do
-          config_db(:mysql) do
-            rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
-            db_exists?(&quot;foo_test&quot;).should == true
-          end
-        end
-        
-        it &quot;should drop/create a MySQL db if it already exists for the specified environment&quot; do
-          config_db(:mysql) do
-            rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
-            db_exists?(&quot;foo_test&quot;).should == true
-            rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
-            db_exists?(&quot;foo_test&quot;).should == true
-          end
-        end
-      end
-
-      describe &quot;PostgreSQL&quot; do
-        include Spec::CreateAndDropTask::Helper::PostgreSQL
-        
-        before(:each) do 
-          clear_connection
-        end
-      
-        after(:each) do
-          cleanup_db
-        end
-      
-        it &quot;should create a PostgreSQL db for the current environment&quot; do
-          config_db(:postgresql) do
-            rake_task(&quot;db:recreate&quot;)
-            db_exists?(&quot;foo_development&quot;).should == true
-          end
-        end
-        
-        it &quot;should drop a PostgreSQL db for the current environment&quot; do
-          config_db(:postgresql) do
-            rake_task(&quot;db:recreate&quot;)
-            db_exists?(&quot;foo_development&quot;).should == true
-            rake_task(&quot;db:drop&quot;)
-            db_exists?(&quot;foo_development&quot;).should == false
-          end
-        end
-      
-        it &quot;should create a PostgreSQL db for the specified environment&quot; do
-          config_db(:postgresql) do
-            rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
-            db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
-          end
-        end
-        
-        it &quot;should drop a PostgreSQL db for the specified environment&quot; do
-          config_db(:postgresql) do
-            rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
-            db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
-            rake_task(&quot;db:drop&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
-            db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == false
-          end
-        end
-      end
-
-    end
-
-    describe &quot;create:all&quot; do
-    
-      describe &quot;MySQL&quot; do
-        include Spec::CreateAndDropTask::Helper::MySQL
-        
-        before(:all) do
-          clear_connection
-        end
-        
-        after(:all) do
-          cleanup_db
-        end
-        
-        it &quot;should create a MySQL db for all environments&quot; do
-          config_db(:mysql) do
-            rake_task(&quot;db:recreate:all&quot;)
-            db_exists?(&quot;foo_development&quot;).should == true
-            db_exists?(&quot;foo_test&quot;).should == true
-          end
-        end
-        
-      end
-    
-      describe &quot;PostgreSQL&quot; do
-        include Spec::CreateAndDropTask::Helper::PostgreSQL
-        
-        before(:each) do
-          clear_connection
-        end
-        
-        after(:each) do
-          cleanup_db
-        end
-        
-        it &quot;should create a PostgreSQL db for all environments&quot; do
-          config_db(:postgresql) do
-            rake_task(&quot;db:recreate:all&quot;)
-            db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
-            db_exists?(&quot;foo_development&quot;).should == true
-            
-            # running db:recreate again should be successful
-            rake_task(&quot;db:recreate:all&quot;)
-            db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
-            db_exists?(&quot;foo_development&quot;).should == true
-          end
-        end
-        
-        it &quot;should drop a PostgreSQL db for all environments&quot; do
-          config_db(:postgresql) do
-            rake_task(&quot;db:recreate:all&quot;)
-            db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
-            db_exists?(&quot;foo_development&quot;).should == true
-            rake_task(&quot;db:drop:all&quot;)
-            db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == false
-            db_exists?(&quot;foo_development&quot;).should == false
-          end
-        end
-        
-      end
-    end
-
-  end
-
-end
\ No newline at end of file
+# require 'pathname'
+# require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
+# 
+# describe &quot;rake&quot; do
+# 
+#   describe &quot;db&quot; do
+# 
+#     describe &quot;create&quot; do
+# 
+#       describe &quot;MySQL&quot; do
+#         include Spec::CreateAndDropTask::Helper::MySQL
+#         
+#         before(:each) do
+#           ENV[&quot;MACK_ENV&quot;] = &quot;development&quot;
+#           clear_connection
+#         end
+#         
+#         after(:all) do 
+#           cleanup_db
+#         end
+#         
+#         it &quot;should create a MySQL db for the current environment&quot; do
+#           config_db(:mysql) do
+#             rake_task(&quot;db:recreate&quot;)
+#             db_exists?(&quot;foo_development&quot;).should == true
+#           end
+#         end
+#         
+#         it &quot;should drop/create a MySQL db if it already exists for the current environment&quot; do
+#           config_db(:mysql) do
+#             rake_task(&quot;db:recreate&quot;)
+#             db_exists?(&quot;foo_development&quot;).should == true
+#             rake_task(&quot;db:drop&quot;)
+#             db_exists?(&quot;foo_development&quot;).should == false
+#           end
+#         end
+#         
+#         it &quot;should create a MySQL db for the specified environment&quot; do
+#           config_db(:mysql) do
+#             rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
+#             db_exists?(&quot;foo_test&quot;).should == true
+#           end
+#         end
+#         
+#         it &quot;should drop/create a MySQL db if it already exists for the specified environment&quot; do
+#           config_db(:mysql) do
+#             rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
+#             db_exists?(&quot;foo_test&quot;).should == true
+#             rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
+#             db_exists?(&quot;foo_test&quot;).should == true
+#           end
+#         end
+#       end
+# 
+#       describe &quot;PostgreSQL&quot; do
+#         include Spec::CreateAndDropTask::Helper::PostgreSQL
+#         
+#         before(:each) do 
+#           clear_connection
+#         end
+#       
+#         after(:each) do
+#           cleanup_db
+#         end
+#       
+#         it &quot;should create a PostgreSQL db for the current environment&quot; do
+#           config_db(:postgresql) do
+#             rake_task(&quot;db:recreate&quot;)
+#             db_exists?(&quot;foo_development&quot;).should == true
+#           end
+#         end
+#         
+#         it &quot;should drop a PostgreSQL db for the current environment&quot; do
+#           config_db(:postgresql) do
+#             rake_task(&quot;db:recreate&quot;)
+#             db_exists?(&quot;foo_development&quot;).should == true
+#             rake_task(&quot;db:drop&quot;)
+#             db_exists?(&quot;foo_development&quot;).should == false
+#           end
+#         end
+#       
+#         it &quot;should create a PostgreSQL db for the specified environment&quot; do
+#           config_db(:postgresql) do
+#             rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
+#             db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
+#           end
+#         end
+#         
+#         it &quot;should drop a PostgreSQL db for the specified environment&quot; do
+#           config_db(:postgresql) do
+#             rake_task(&quot;db:recreate&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
+#             db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
+#             rake_task(&quot;db:drop&quot;, {&quot;MACK_ENV&quot; =&gt; &quot;test&quot;})
+#             db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == false
+#           end
+#         end
+#       end
+# 
+#     end
+# 
+#     describe &quot;create:all&quot; do
+#     
+#       describe &quot;MySQL&quot; do
+#         include Spec::CreateAndDropTask::Helper::MySQL
+#         
+#         before(:all) do
+#           clear_connection
+#         end
+#         
+#         after(:all) do
+#           cleanup_db
+#         end
+#         
+#         it &quot;should create a MySQL db for all environments&quot; do
+#           config_db(:mysql) do
+#             rake_task(&quot;db:recreate:all&quot;)
+#             db_exists?(&quot;foo_development&quot;).should == true
+#             db_exists?(&quot;foo_test&quot;).should == true
+#           end
+#         end
+#         
+#       end
+#     
+#       describe &quot;PostgreSQL&quot; do
+#         include Spec::CreateAndDropTask::Helper::PostgreSQL
+#         
+#         before(:each) do
+#           clear_connection
+#         end
+#         
+#         after(:each) do
+#           cleanup_db
+#         end
+#         
+#         it &quot;should create a PostgreSQL db for all environments&quot; do
+#           config_db(:postgresql) do
+#             rake_task(&quot;db:recreate:all&quot;)
+#             db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
+#             db_exists?(&quot;foo_development&quot;).should == true
+#             
+#             # running db:recreate again should be successful
+#             rake_task(&quot;db:recreate:all&quot;)
+#             db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
+#             db_exists?(&quot;foo_development&quot;).should == true
+#           end
+#         end
+#         
+#         it &quot;should drop a PostgreSQL db for all environments&quot; do
+#           config_db(:postgresql) do
+#             rake_task(&quot;db:recreate:all&quot;)
+#             db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == true
+#             db_exists?(&quot;foo_development&quot;).should == true
+#             rake_task(&quot;db:drop:all&quot;)
+#             db_exists?(&quot;foo_test&quot;, &quot;test&quot;).should == false
+#             db_exists?(&quot;foo_development&quot;).should == false
+#           end
+#         end
+#         
+#       end
+#     end
+# 
+#   end
+# 
+# end
\ No newline at end of file</diff>
      <filename>mack-active_record/spec/lib/tasks/db_create_drop_tasks_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,132 +1,132 @@
-require 'pathname'
-require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
-
-describe &quot;rake&quot; do
-
-  describe &quot;db&quot; do
-  
-    describe &quot;migrate&quot; do
-      include Spec::CreateAndDropTask::Helper::MySQL
-      
-      after(:all) do
-        cleanup_db
-      end
-      
-      it &quot;should migrate the database with the migrations in the db/migrations folder&quot; do
-        config_db(:mysql) do
-          db_exists?(&quot;foo_development&quot;).should_not == true
-          rake_task(&quot;db:recreate&quot;)
-          db_exists?(&quot;foo_development&quot;).should == true
-          table_exists?(&quot;zoos&quot;).should_not == true
-          
-          # now write one migration file, and see if we can get the table created
-          data = fixture(&quot;002_create_zoos&quot;)
-          mig_file = File.join(migrations_directory, &quot;002_create_zoos.rb&quot;)
-          
-          File.open(mig_file, &quot;w&quot;) { |f| f.write(data) }
-          rake_task(&quot;db:migrate&quot;)
-          table_exists?(&quot;zoos&quot;).should == true
-          
-          FileUtils.rm_rf(mig_file)
-        end
-      end
-    
-    end
-  
-    describe &quot;rollback&quot; do
-      include Spec::CreateAndDropTask::Helper::MySQL
-      
-      after(:each) do
-        cleanup_db
-      end
-      
-      it &quot;should rollback the database by a default of 1 step&quot; do
-        config_db(:mysql) do
-          db_exists?(&quot;foo_development&quot;).should_not == true
-          rake_task(&quot;db:recreate&quot;)
-          db_exists?(&quot;foo_development&quot;).should == true
-          table_exists?(&quot;zoos&quot;).should_not == true
-          table_exists?(&quot;animals&quot;).should_not == true
-        
-          mig_file1 = File.join(migrations_directory, &quot;002_create_zoos.rb&quot;)
-          mig_file2 = File.join(migrations_directory, &quot;003_create_animals.rb&quot;)
-        
-          # now write one migration file, and see if we can get the table created
-          data = fixture(&quot;002_create_zoos&quot;)
-          File.open(mig_file1, &quot;w&quot;) { |f| f.write(data) }
-          rake_task(&quot;db:migrate&quot;)
-          table_exists?(&quot;zoos&quot;).should == true
-        
-          # now write the second migration file, and see if we can see that table
-          data = fixture(&quot;003_create_animals&quot;)
-          File.open(mig_file2, &quot;w&quot;) { |f| f.write(data) }
-          rake_task(&quot;db:migrate&quot;)
-          table_exists?(&quot;animals&quot;).should == true
-        
-          # now rollback 1 step, and we shouldn't see &quot;animals&quot; table anymore
-          rake_task(&quot;db:rollback&quot;)
-          table_exists?(&quot;animals&quot;).should_not == true
-
-          FileUtils.rm_rf(mig_file1)
-          FileUtils.rm_rf(mig_file2)
-        end
-      end
-    
-      it &quot;should rollback the database by n steps if ENV['STEP'] is set&quot; do
-        config_db(:mysql) do
-          db_exists?(&quot;foo_development&quot;).should_not == true
-          rake_task(&quot;db:recreate&quot;)
-          db_exists?(&quot;foo_development&quot;).should == true
-          table_exists?(&quot;zoos&quot;).should_not == true
-          table_exists?(&quot;animals&quot;).should_not == true
-          
-          mig_file1 = File.join(migrations_directory, &quot;002_create_zoos.rb&quot;)
-          mig_file2 = File.join(migrations_directory, &quot;003_create_animals.rb&quot;)
-                    
-          # now write 2 migration files, and we should see the 2 new tables
-          data = fixture(&quot;002_create_zoos&quot;)
-          File.open(mig_file1, &quot;w&quot;) { |f| f.write(data) }
-          
-          data = fixture(&quot;003_create_animals&quot;)
-          File.open(mig_file2, &quot;w&quot;) { |f| f.write(data) }
-          
-          rake_task(&quot;db:migrate&quot;)
-          table_exists?(&quot;zoos&quot;).should == true
-          table_exists?(&quot;animals&quot;).should == true
-
-          # now set ENV['STEP'] to 2, and we should see those 2 tables go away
-          ENV['STEP'] = &quot;2&quot;
-          rake_task(&quot;db:rollback&quot;)
-          table_exists?(&quot;animals&quot;).should_not == true
-          table_exists?(&quot;zoos&quot;).should_not == true
-
-          FileUtils.rm_rf(mig_file1)
-          FileUtils.rm_rf(mig_file2)
-        end
-      end
-    
-    end
-  
-    describe &quot;version&quot; do
-      include Spec::CreateAndDropTask::Helper::MySQL
-            
-      after(:all) do
-        cleanup_db
-      end
-    
-      it &quot;should return the current version number of the database&quot; do
-        config_db(:mysql) do
-          db_exists?(&quot;foo_development&quot;).should_not == true
-          rake_task(&quot;db:recreate&quot;)
-          db_exists?(&quot;foo_development&quot;).should == true
-          
-          rake_task(&quot;db:migrate&quot;)
-          Mack::Database::Migrator.version.to_s.should_not == &quot;&quot;
-        end
-      end
-    
-    end
-  
-  end
-  
-end
\ No newline at end of file
+# require 'pathname'
+# require Pathname(__FILE__).dirname.expand_path.parent.parent + 'spec_helper'
+# 
+# describe &quot;rake&quot; do
+# 
+#   describe &quot;db&quot; do
+#   
+#     describe &quot;migrate&quot; do
+#       include Spec::CreateAndDropTask::Helper::MySQL
+#       
+#       after(:all) do
+#         cleanup_db
+#       end
+#       
+#       it &quot;should migrate the database with the migrations in the db/migrations folder&quot; do
+#         config_db(:mysql) do
+#           db_exists?(&quot;foo_development&quot;).should_not == true
+#           rake_task(&quot;db:recreate&quot;)
+#           db_exists?(&quot;foo_development&quot;).should == true
+#           table_exists?(&quot;zoos&quot;).should_not == true
+#           
+#           # now write one migration file, and see if we can get the table created
+#           data = fixture(&quot;002_create_zoos&quot;)
+#           mig_file = File.join(migrations_directory, &quot;002_create_zoos.rb&quot;)
+#           
+#           File.open(mig_file, &quot;w&quot;) { |f| f.write(data) }
+#           rake_task(&quot;db:migrate&quot;)
+#           table_exists?(&quot;zoos&quot;).should == true
+#           
+#           FileUtils.rm_rf(mig_file)
+#         end
+#       end
+#     
+#     end
+#   
+#     describe &quot;rollback&quot; do
+#       include Spec::CreateAndDropTask::Helper::MySQL
+#       
+#       after(:each) do
+#         cleanup_db
+#       end
+#       
+#       it &quot;should rollback the database by a default of 1 step&quot; do
+#         config_db(:mysql) do
+#           db_exists?(&quot;foo_development&quot;).should_not == true
+#           rake_task(&quot;db:recreate&quot;)
+#           db_exists?(&quot;foo_development&quot;).should == true
+#           table_exists?(&quot;zoos&quot;).should_not == true
+#           table_exists?(&quot;animals&quot;).should_not == true
+#         
+#           mig_file1 = File.join(migrations_directory, &quot;002_create_zoos.rb&quot;)
+#           mig_file2 = File.join(migrations_directory, &quot;003_create_animals.rb&quot;)
+#         
+#           # now write one migration file, and see if we can get the table created
+#           data = fixture(&quot;002_create_zoos&quot;)
+#           File.open(mig_file1, &quot;w&quot;) { |f| f.write(data) }
+#           rake_task(&quot;db:migrate&quot;)
+#           table_exists?(&quot;zoos&quot;).should == true
+#         
+#           # now write the second migration file, and see if we can see that table
+#           data = fixture(&quot;003_create_animals&quot;)
+#           File.open(mig_file2, &quot;w&quot;) { |f| f.write(data) }
+#           rake_task(&quot;db:migrate&quot;)
+#           table_exists?(&quot;animals&quot;).should == true
+#         
+#           # now rollback 1 step, and we shouldn't see &quot;animals&quot; table anymore
+#           rake_task(&quot;db:rollback&quot;)
+#           table_exists?(&quot;animals&quot;).should_not == true
+# 
+#           FileUtils.rm_rf(mig_file1)
+#           FileUtils.rm_rf(mig_file2)
+#         end
+#       end
+#     
+#       it &quot;should rollback the database by n steps if ENV['STEP'] is set&quot; do
+#         config_db(:mysql) do
+#           db_exists?(&quot;foo_development&quot;).should_not == true
+#           rake_task(&quot;db:recreate&quot;)
+#           db_exists?(&quot;foo_development&quot;).should == true
+#           table_exists?(&quot;zoos&quot;).should_not == true
+#           table_exists?(&quot;animals&quot;).should_not == true
+#           
+#           mig_file1 = File.join(migrations_directory, &quot;002_create_zoos.rb&quot;)
+#           mig_file2 = File.join(migrations_directory, &quot;003_create_animals.rb&quot;)
+#                     
+#           # now write 2 migration files, and we should see the 2 new tables
+#           data = fixture(&quot;002_create_zoos&quot;)
+#           File.open(mig_file1, &quot;w&quot;) { |f| f.write(data) }
+#           
+#           data = fixture(&quot;003_create_animals&quot;)
+#           File.open(mig_file2, &quot;w&quot;) { |f| f.write(data) }
+#           
+#           rake_task(&quot;db:migrate&quot;)
+#           table_exists?(&quot;zoos&quot;).should == true
+#           table_exists?(&quot;animals&quot;).should == true
+# 
+#           # now set ENV['STEP'] to 2, and we should see those 2 tables go away
+#           ENV['STEP'] = &quot;2&quot;
+#           rake_task(&quot;db:rollback&quot;)
+#           table_exists?(&quot;animals&quot;).should_not == true
+#           table_exists?(&quot;zoos&quot;).should_not == true
+# 
+#           FileUtils.rm_rf(mig_file1)
+#           FileUtils.rm_rf(mig_file2)
+#         end
+#       end
+#     
+#     end
+#   
+#     describe &quot;version&quot; do
+#       include Spec::CreateAndDropTask::Helper::MySQL
+#             
+#       after(:all) do
+#         cleanup_db
+#       end
+#     
+#       it &quot;should return the current version number of the database&quot; do
+#         config_db(:mysql) do
+#           db_exists?(&quot;foo_development&quot;).should_not == true
+#           rake_task(&quot;db:recreate&quot;)
+#           db_exists?(&quot;foo_development&quot;).should == true
+#           
+#           rake_task(&quot;db:migrate&quot;)
+#           Mack::Database::Migrator.version.to_s.should_not == &quot;&quot;
+#         end
+#       end
+#     
+#     end
+#   
+#   end
+#   
+# end
\ No newline at end of file</diff>
      <filename>mack-active_record/spec/lib/tasks/db_migration_tasks_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,12 +27,7 @@ module Mack
         end
         DataMapper::MigrationRunner.migrations.clear
       end
-      
-      private
-      def self.migration_files
-        Dir.glob(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;, &quot;*.rb&quot;))
-      end
-      
+            
     end # Migrations
   end # Database
 end # Mack
\ No newline at end of file</diff>
      <filename>mack-data_mapper/lib/mack-data_mapper/database_migrations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,6 +14,10 @@ module Mack
         # raise NoMethodError.new(:abort_if_pending_migrations)
       end
       
+      def self.migration_files
+        Dir.glob(File.join(Mack.root, &quot;db&quot;, &quot;migrations&quot;, &quot;*.rb&quot;))
+      end
+      
     end # Migrations
   end # Database
 end # Mack
\ No newline at end of file</diff>
      <filename>mack-orm/lib/mack-orm/database_migrations.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>mack-active_record/spec/lib/database_spec.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>80324859b13764c03c7525a6811affbec0667381</id>
    </parent>
  </parents>
  <author>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </author>
  <url>http://github.com/markbates/mack-more/commit/60733564ab430ecea42a65dc386954ed9edec09f</url>
  <id>60733564ab430ecea42a65dc386954ed9edec09f</id>
  <committed-date>2008-08-12T12:14:38-07:00</committed-date>
  <authored-date>2008-08-12T12:14:38-07:00</authored-date>
  <message>Working on refactoring out active_record to mack-orm [#87]</message>
  <tree>8188f50ab70fcddb7f34ca4e355674700070d301</tree>
  <committer>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </committer>
</commit>
