<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -27,6 +27,19 @@ module DataMapper
         self.class.type_map
       end
 
+      #
+      # Returns whether the storage_name exists in this adapter.
+      #
+      # ==== Parameters
+      # storage_name&lt;String&gt;:: A String defining the name of a storage, for example a table name.
+      #
+      # ==== Returns
+      # &lt;Boolean&gt;:: true if the storage exists.
+      #
+      def exists?(storage_name)
+        raise NotImplementedError
+      end
+
       # methods dealing with transactions
 
       #</diff>
      <filename>lib/data_mapper/adapters/abstract_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -241,7 +241,7 @@ module DataMapper
         close_connection(connection) if connection
       end
 
-      def table_exists?(table_name)
+      def exists?(table_name)
         raise NotImplementedError
       end
 
@@ -251,7 +251,7 @@ module DataMapper
 
       def upgrade_model_storage(repository, model)
         table_name = model.storage_name(name)
-        if table_exists?(model.storage_name(name))
+        if exists?(model.storage_name(name))
           rval = []
           begin
             connection = create_connection</diff>
      <filename>lib/data_mapper/adapters/data_objects_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,7 @@ module DataMapper
         query(&quot;SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? AND COLUMN_NAME = ?&quot;, db_name, table_name, column_name).size &gt; 0
       end
 
-      def table_exists?(table_name)
+      def exists?(table_name)
         query_table(table_name).size &gt; 0
       end
 </diff>
      <filename>lib/data_mapper/adapters/mysql_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ module DataMapper
         end
       end
 
-      def table_exists?(table_name)
+      def exists?(table_name)
         query_table(table_name).size &gt; 0
       end
 </diff>
      <filename>lib/data_mapper/adapters/postgres_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@ module DataMapper
         end
       end
 
-      def table_exists?(table_name)
+      def exists?(table_name)
         query_table(table_name).size &gt; 0
       end
 </diff>
      <filename>lib/data_mapper/adapters/sqlite3_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,13 +20,14 @@ if HAS_MYSQL
         @result = mock(&quot;result&quot;)
       end
       it &quot;#upgrade_model should work&quot; do
-        !!@adapter.table_exists?(&quot;sputniks&quot;).should == false
+        @adapter.destroy_model_storage(nil, Sputnik)
+        @adapter.exists?(&quot;sputniks&quot;).should == false
         Sputnik.auto_migrate!(:mysql)
-        !!@adapter.table_exists?(&quot;sputniks&quot;).should == true
-        !!@adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == false
+        @adapter.exists?(&quot;sputniks&quot;).should == true
+        @adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == false
         Sputnik.property :new_prop, Integer
         Sputnik.auto_upgrade!(:mysql)
-        !!@adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == true
+        @adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == true
       end
     end
 
@@ -41,16 +42,16 @@ if HAS_MYSQL
         
         Sputnik.auto_migrate!(:mysql)
       end
-      it &quot;#table_exists? should return true for tables that exist&quot; do
-        @adapter.table_exists?(&quot;sputniks&quot;).should == true
+      it &quot;#exists? should return true for tables that exist&quot; do
+        @adapter.exists?(&quot;sputniks&quot;).should == true
       end
-      it &quot;#table_exists? should return false for tables that don't exist&quot; do
-        @adapter.table_exists?(&quot;space turds&quot;).should == false
+      it &quot;#exists? should return false for tables that don't exist&quot; do
+        @adapter.exists?(&quot;space turds&quot;).should == false
       end
       it &quot;#column_exists? should return true for columns that exist&quot; do
         @adapter.column_exists?(&quot;sputniks&quot;, &quot;name&quot;).should == true
       end
-      it &quot;#table_exists? should return false for tables that don't exist&quot; do
+      it &quot;#exists? should return false for tables that don't exist&quot; do
         @adapter.column_exists?(&quot;sputniks&quot;, &quot;plur&quot;).should == false
       end
     end</diff>
      <filename>spec/integration/mysql_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,19 +20,20 @@ if HAS_POSTGRES
         @result = mock(&quot;result&quot;)
       end
       it &quot;#upgrade_model should work&quot; do
-        !!@adapter.table_exists?(&quot;sputniks&quot;).should == false
+        @adapter.destroy_model_storage(nil, Sputnik)
+        @adapter.exists?(&quot;sputniks&quot;).should == false
         Sputnik.auto_migrate!(:postgres)
-        !!@adapter.table_exists?(&quot;sputniks&quot;).should == true
-        !!@adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == false
+        @adapter.exists?(&quot;sputniks&quot;).should == true
+        @adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == false
         Sputnik.property :new_prop, Integer, :serial =&gt; true
         @adapter.drop_sequence_column(@adapter.create_connection, Sputnik, Sputnik.new_prop) rescue nil
         Sputnik.auto_upgrade!(:postgres)
-        !!@adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == true
+        @adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == true
       end
       it &quot;#upgrade_model_storage should create sequences and then call super&quot; do
         @adapter.should_receive(:create_connection).at_least(1).times.and_return(@connection)
         @connection.should_receive(:close).at_least(1).times
-        @adapter.should_receive(:table_exists?).at_least(1).times.with(&quot;sputniks&quot;).and_return(true)
+        @adapter.should_receive(:exists?).at_least(1).times.with(&quot;sputniks&quot;).and_return(true)
         @adapter.should_receive(:column_exists?).at_least(1).times.with(&quot;sputniks&quot;, &quot;id&quot;).and_return(false)
         @adapter.should_receive(:column_exists?).at_least(1).times.with(&quot;sputniks&quot;, &quot;name&quot;).and_return(false)
         @adapter.should_receive(:create_sequence_column).at_least(1).times.with(@connection, Sputnik, Sputnik.properties(:default)[:id])
@@ -73,16 +74,16 @@ if HAS_POSTGRES
 
         Sputnik.auto_migrate!(:postgres)
       end
-      it &quot;#table_exists? should return true for tables that exist&quot; do
-        @adapter.table_exists?(&quot;sputniks&quot;).should == true
+      it &quot;#exists? should return true for tables that exist&quot; do
+        @adapter.exists?(&quot;sputniks&quot;).should == true
       end
-      it &quot;#table_exists? should return false for tables that don't exist&quot; do
-        @adapter.table_exists?(&quot;space turds&quot;).should == false
+      it &quot;#exists? should return false for tables that don't exist&quot; do
+        @adapter.exists?(&quot;space turds&quot;).should == false
       end
       it &quot;#column_exists? should return true for columns that exist&quot; do
         @adapter.column_exists?(&quot;sputniks&quot;, &quot;name&quot;).should == true
       end
-      it &quot;#table_exists? should return false for tables that don't exist&quot; do
+      it &quot;#exists? should return false for tables that don't exist&quot; do
         @adapter.column_exists?(&quot;sputniks&quot;, &quot;plur&quot;).should == false
       end
     end</diff>
      <filename>spec/integration/postgres_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,13 +27,14 @@ if HAS_SQLITE3
         @result = mock(&quot;result&quot;)
       end
       it &quot;#upgrade_model should work&quot; do
-        !!@adapter.table_exists?(&quot;sputniks&quot;).should == false
+        @adapter.destroy_model_storage(nil, Sputnik)
+        @adapter.exists?(&quot;sputniks&quot;).should == false
         Sputnik.auto_migrate!(:sqlite3_file)
-        !!@adapter.table_exists?(&quot;sputniks&quot;).should == true
-        !!@adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == false
+        @adapter.exists?(&quot;sputniks&quot;).should == true
+        @adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == false
         Sputnik.property :new_prop, Integer
         Sputnik.auto_upgrade!(:sqlite3_file)
-        !!@adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == true
+        @adapter.column_exists?(&quot;sputniks&quot;, &quot;new_prop&quot;).should == true
       end
     end
     describe &quot;querying metadata&quot; do
@@ -47,16 +48,16 @@ if HAS_SQLITE3
 
         Sputnik.auto_migrate!(:sqlite3_file)
       end
-      it &quot;#table_exists? should return true for tables that exist&quot; do
-        @adapter.table_exists?(&quot;sputniks&quot;).should == true
+      it &quot;#exists? should return true for tables that exist&quot; do
+        @adapter.exists?(&quot;sputniks&quot;).should == true
       end
-      it &quot;#table_exists? should return false for tables that don't exist&quot; do
-        @adapter.table_exists?(&quot;space turds&quot;).should == false
+      it &quot;#exists? should return false for tables that don't exist&quot; do
+        @adapter.exists?(&quot;space turds&quot;).should == false
       end
       it &quot;#column_exists? should return true for columns that exist&quot; do
         @adapter.column_exists?(&quot;sputniks&quot;, &quot;name&quot;).should == true
       end
-      it &quot;#table_exists? should return false for tables that don't exist&quot; do
+      it &quot;#exists? should return false for tables that don't exist&quot; do
         @adapter.column_exists?(&quot;sputniks&quot;, &quot;plur&quot;).should == false
       end
     end</diff>
      <filename>spec/integration/sqlite3_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -93,11 +93,15 @@ describe DataMapper::Adapters::AbstractAdapter do
   it &quot;should raise NotImplementedError when #delete_set is called&quot; do
     lambda { @adapter.delete_set(:repository, :query) }.should raise_error(NotImplementedError)
   end
-  
+   
   it &quot;should raise NotImplementedError when #upgrade_model_storage is called&quot; do
     lambda { @adapter.upgrade_model_storage(:repository, :resource) }.should raise_error(NotImplementedError)
   end
 
+  it &quot;should raise NotImplementedError when #exists? is called&quot; do
+    lambda { @adapter.exists?(&quot;hehu&quot;) }.should raise_error(NotImplementedError)
+  end
+
   it &quot;should raise NotImplementedError when #create_model_storage is called&quot; do
     lambda { @adapter.create_model_storage(:repository, :resource) }.should raise_error(NotImplementedError)
   end</diff>
      <filename>spec/unit/adapters/abstract_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -290,15 +290,15 @@ describe DataMapper::Adapters::DataObjectsAdapter::SQL, &quot;creating, reading, upda
   end
 
   describe &quot;when upgrading tables&quot; do
-    it &quot;should raise NotImplementedError when #table_exists? is called&quot; do
-      lambda { @adapter.table_exists?(&quot;cheeses&quot;) }.should raise_error(NotImplementedError)
+    it &quot;should raise NotImplementedError when #exists? is called&quot; do
+      lambda { @adapter.exists?(&quot;cheeses&quot;) }.should raise_error(NotImplementedError)
     end
     it &quot;should raise NotImplementedError when #columns_exists? is called&quot; do
       lambda { @adapter.column_exists?(&quot;cheeses&quot;, &quot;name&quot;) }.should raise_error(NotImplementedError)
     end
     describe &quot;#upgrade_model_storage&quot; do
       it &quot;should call #create_model_storage unless the model storage alread exists&quot; do
-        @adapter.should_receive(:table_exists?).once.with(&quot;cheeses&quot;).and_return(false)
+        @adapter.should_receive(:exists?).once.with(&quot;cheeses&quot;).and_return(false)
         @adapter.should_receive(:create_model_storage).once.with(nil, Cheese).and_return(true)
         @adapter.upgrade_model_storage(nil, Cheese).should == Cheese
       end
@@ -307,7 +307,7 @@ describe DataMapper::Adapters::DataObjectsAdapter::SQL, &quot;creating, reading, upda
         @adapter.should_receive(:column_exists?).once.with(&quot;cheeses&quot;, &quot;name&quot;).and_return(true)
         @adapter.should_receive(:column_exists?).once.with(&quot;cheeses&quot;, &quot;color&quot;).and_return(true)
         @adapter.should_receive(:column_exists?).once.with(&quot;cheeses&quot;, &quot;notes&quot;).and_return(true)
-        @adapter.should_receive(:table_exists?).once.with(&quot;cheeses&quot;).and_return(true)
+        @adapter.should_receive(:exists?).once.with(&quot;cheeses&quot;).and_return(true)
         connection = mock(&quot;connection&quot;)
         connection.should_receive(:close).once
         @adapter.should_receive(:create_connection).once.and_return(connection)
@@ -318,7 +318,7 @@ describe DataMapper::Adapters::DataObjectsAdapter::SQL, &quot;creating, reading, upda
         @adapter.should_receive(:column_exists?).once.with(&quot;cheeses&quot;, &quot;name&quot;).and_return(true)
         @adapter.should_receive(:column_exists?).once.with(&quot;cheeses&quot;, &quot;color&quot;).and_return(true)
         @adapter.should_receive(:column_exists?).once.with(&quot;cheeses&quot;, &quot;notes&quot;).and_return(false)
-        @adapter.should_receive(:table_exists?).once.with(&quot;cheeses&quot;).and_return(true)
+        @adapter.should_receive(:exists?).once.with(&quot;cheeses&quot;).and_return(true)
         connection = mock(&quot;connection&quot;)
         connection.should_receive(:close).once
         @adapter.should_receive(:create_connection).once.and_return(connection)</diff>
      <filename>spec/unit/adapters/data_objects_adapter_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>75dc92e1d6012ff5378154b68abe449c0a95f8d9</id>
    </parent>
  </parents>
  <author>
    <name>Martin Kihlgren</name>
    <email>zond@cthulhu.rlyeh</email>
  </author>
  <url>http://github.com/sam/dm-core/commit/0f57b64a8a8b0d036dd9cee602ceb448ac6a4e88</url>
  <id>0f57b64a8a8b0d036dd9cee602ceb448ac6a4e88</id>
  <committed-date>2008-05-13T09:53:27-07:00</committed-date>
  <authored-date>2008-05-13T09:53:27-07:00</authored-date>
  <message>Renamed #table_exists? back to #exists? (to fix the breakage I caused
in dm-migrations) and added it to AbstractAdapter.</message>
  <tree>e89be5da09b417b6548ee3960e5507b59a8aa45f</tree>
  <committer>
    <name>Martin Kihlgren</name>
    <email>zond@cthulhu.rlyeh</email>
  </committer>
</commit>
