<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -11,6 +11,14 @@ At the root of your Rails project, type :
        script\plugin install svn://rubyforge.org/var/svn/georuby/SpatialAdapter/trunk/spatial_adapter
 You need to have SVN installed.
 	
+====== PostGIS SQL Scripts
+This is only for PostgreSQL databases:
+
+Place the following scripts in a folder named 'spatial' under the 'db' folder; For example:
+  RAILS_ROOT/db/spatial/lwpostgis.sql
+  RAILS_ROOT/db/spatial/spatial_ref_sys
+  
+These will be used when creating the Test database when running the Rake Test tasks.  These scripts should have been installed when the PostGIS libraries were installed.  Online reference: http://postgis.refractions.net/
 
 ===Operations
 Geometric columns in your ActiveRecord models now appear just like any other column of other basic data types. They can also be dumped in ruby schema mode and loaded in migrations the same way as columns of basic types.</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -85,6 +85,17 @@ ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do
 
   include SpatialAdapter
 
+  # SCHEMA STATEMENTS ========================================
+  
+  alias :original_recreate_database :recreate_database
+  def recreate_database(configuration, enc_option)
+    `dropdb -U &quot;#{configuration[&quot;test&quot;][&quot;username&quot;]}&quot; #{configuration[&quot;test&quot;][&quot;database&quot;]}`
+    `createdb #{enc_option} -U &quot;#{configuration[&quot;test&quot;][&quot;username&quot;]}&quot; #{configuration[&quot;test&quot;][&quot;database&quot;]}`
+    `createlang -U &quot;#{configuration[&quot;test&quot;][&quot;username&quot;]}&quot; plpgsql #{configuration[&quot;test&quot;][&quot;database&quot;]}`
+    `psql -d #{configuration[&quot;test&quot;][&quot;database&quot;]} -f db/spatial/lwpostgis.sql`
+    `psql -d #{configuration[&quot;test&quot;][&quot;database&quot;]} -f db/spatial/spatial_ref_sys.sql`
+  end
+  
   alias :original_native_database_types :native_database_types
   def native_database_types
     original_native_database_types.merge!(geometry_data_types)</diff>
      <filename>lib/post_gis_adapter.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c7faf9e84463788ee3d4ec3a5bfd065db5738e13</id>
    </parent>
  </parents>
  <author>
    <name>Mel Riffe</name>
    <email>mriffe@gmail.com</email>
  </author>
  <url>http://github.com/melriffe/spatial_adapter/commit/816b2637518191375b7dfbbc09506db68b7e5797</url>
  <id>816b2637518191375b7dfbbc09506db68b7e5797</id>
  <committed-date>2008-06-19T23:19:35-07:00</committed-date>
  <authored-date>2008-06-19T23:19:35-07:00</authored-date>
  <message>Adding support to create a Test PostGIS database (PostgreSQL only)</message>
  <tree>d899bd33fa7fe0959da2932892e8477361b5f3b9</tree>
  <committer>
    <name>Mel Riffe</name>
    <email>mriffe@gmail.com</email>
  </committer>
</commit>
