<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/sequel/deprecated_migration.rb</filename>
    </added>
    <added>
      <filename>lib/sequel/extensions/migration.rb</filename>
    </added>
    <added>
      <filename>spec/extensions/migration_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 === HEAD
 
+* Deprecate Migration and Migrator, require 'sequel/extensions/migration' if you want them (jeremyevans)
+
 * Denamespace Sequel::Error decendants (e.g. use Sequel::Rollback instead of Sequel::Error::Rollback) (jeremyevans)
 
 * Deprecate Error::InvalidTransform, Error::NoExistingFilter, and Error::InvalidStatement (jeremyevans)</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -88,6 +88,7 @@ begin
   DB = Sequel.connect(*(db_config ? [db_config] : [db, db_opts]))
   DB.test_connection
   if migrate_dir
+    require 'sequel/extensions/migration'
     Sequel::Migrator.apply(DB, migrate_dir, migrate_ver)
     exit
   end</diff>
      <filename>bin/sequel</filename>
    </modified>
    <modified>
      <diff>@@ -196,7 +196,7 @@ module Sequel
 
   private_class_method :adapter_method, :def_adapter_method
   
-  require(%w&quot;metaprogramming sql core_sql connection_pool exceptions dataset migration database version deprecated&quot;)
+  require(%w&quot;metaprogramming sql core_sql connection_pool exceptions dataset database version deprecated&quot;)
   require(%w&quot;schema_generator schema_methods schema_sql&quot;, 'database')
   require(%w&quot;convenience graph prepared_statements sql&quot;, 'dataset')
 </diff>
      <filename>lib/sequel/core.rb</filename>
    </modified>
    <modified>
      <diff>@@ -36,6 +36,8 @@ module Sequel
     end
   end
 
+  require 'deprecated_migration'
+
   def self.open(*args, &amp;block)
     Deprecation.deprecate('Sequel.open', 'Use Sequel.connect')
     Database.connect(*args, &amp;block)</diff>
      <filename>lib/sequel/deprecated.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,16 +2,16 @@ require File.join(File.dirname(__FILE__), 'spec_helper')
 
 context &quot;Migration classes&quot; do
   setup do
-    Sequel::Migration.descendants.clear
+    deprec{Sequel::Migration.descendants.clear}
   end
 
-  specify &quot;should be registred in Migration.descendants&quot; do
+  deprec_specify &quot;should be registred in Migration.descendants&quot; do
     @class = Class.new(Sequel::Migration)
     
     Sequel::Migration.descendants.should == [@class]
   end
   
-  specify &quot;should be registered in the right order&quot; do
+  deprec_specify &quot;should be registered in the right order&quot; do
     @c1 = Class.new(Sequel::Migration)
     @c2 = Class.new(Sequel::Migration)
     @c3 = Class.new(Sequel::Migration)
@@ -28,21 +28,23 @@ context &quot;Migration#apply&quot; do
     end
     @db = @c.new
     
-    @migration = Class.new(Sequel::Migration) do
-      define_method(:up) {one(3333)}
-      define_method(:down) {two(4444)}
+    deprec do
+      @migration = Class.new(Sequel::Migration) do
+        define_method(:up) {one(3333)}
+        define_method(:down) {two(4444)}
+      end
     end
   end
   
-  specify &quot;should raise for an invalid direction&quot; do
+  deprec_specify &quot;should raise for an invalid direction&quot; do
     proc {@migration.apply(@db, :hahaha)}.should raise_error(ArgumentError)
   end
   
-  specify &quot;should apply the up direction correctly&quot; do
+  deprec_specify &quot;should apply the up direction correctly&quot; do
     @migration.apply(@db, :up).should == [1111, 3333]
   end
 
-  specify &quot;should apply the down direction correctly&quot; do
+  deprec_specify &quot;should apply the down direction correctly&quot; do
     @migration.apply(@db, :down).should == [2222, 4444]
   end
 end
@@ -152,7 +154,7 @@ context &quot;Sequel::Migrator&quot; do
     File.delete('005_create_attributes.rb')
   end
   
-  specify &quot;should return the list of files for a specified version range&quot; do
+  deprec_specify &quot;should return the list of files for a specified version range&quot; do
     Sequel::Migrator.migration_files('.', 1..1).should == \
       ['./001_create_sessions.rb']
 
@@ -165,31 +167,31 @@ context &quot;Sequel::Migrator&quot; do
     Sequel::Migrator.migration_files('.', 7..8).should == []
   end
   
-  specify &quot;should return the latest version available&quot; do
+  deprec_specify &quot;should return the latest version available&quot; do
     Sequel::Migrator.latest_migration_version('.').should == 5
   end
   
-  specify &quot;should load the migration classes for the specified range&quot; do
+  deprec_specify &quot;should load the migration classes for the specified range&quot; do
     Sequel::Migrator.migration_classes('.', 3, 0, :up).should == \
       [CreateSessions, CreateNodes, CreateUsers]
   end
   
-  specify &quot;should load the migration classes for the specified range&quot; do
+  deprec_specify &quot;should load the migration classes for the specified range&quot; do
     Sequel::Migrator.migration_classes('.', 0, 5, :down).should == \
       [CreateAttributes, CreateUsers, CreateNodes, CreateSessions]
   end
   
-  specify &quot;should start from current + 1 for the up direction&quot; do
+  deprec_specify &quot;should start from current + 1 for the up direction&quot; do
     Sequel::Migrator.migration_classes('.', 3, 1, :up).should == \
       [CreateNodes, CreateUsers]
   end
   
-  specify &quot;should end on current + 1 for the down direction&quot; do
+  deprec_specify &quot;should end on current + 1 for the down direction&quot; do
     Sequel::Migrator.migration_classes('.', 2, 5, :down).should == \
       [CreateAttributes, CreateUsers]
   end
   
-  specify &quot;should automatically create the schema_info table&quot; do
+  deprec_specify &quot;should automatically create the schema_info table&quot; do
     @db.table_exists?(:schema_info).should be_false
     Sequel::Migrator.schema_info_dataset(@db)
     @db.table_exists?(:schema_info).should be_true
@@ -198,12 +200,12 @@ context &quot;Sequel::Migrator&quot; do
     proc {Sequel::Migrator.schema_info_dataset(@db)}.should_not raise_error
   end
   
-  specify &quot;should return a dataset for the schema_info table&quot; do
+  deprec_specify &quot;should return a dataset for the schema_info table&quot; do
     d = Sequel::Migrator.schema_info_dataset(@db)
     d.from.should == :schema_info
   end
   
-  specify &quot;should get the migration version stored in the database&quot; do
+  deprec_specify &quot;should get the migration version stored in the database&quot; do
     # default is 0
     Sequel::Migrator.get_current_migration_version(@db).should == 0
     
@@ -212,13 +214,13 @@ context &quot;Sequel::Migrator&quot; do
     Sequel::Migrator.get_current_migration_version(@db).should == 4321
   end
   
-  specify &quot;should set the migration version stored in the database&quot; do
+  deprec_specify &quot;should set the migration version stored in the database&quot; do
     Sequel::Migrator.get_current_migration_version(@db).should == 0
     Sequel::Migrator.set_current_migration_version(@db, 6666)
     Sequel::Migrator.get_current_migration_version(@db).should == 6666
   end
   
-  specify &quot;should apply migrations correctly in the up direction&quot; do
+  deprec_specify &quot;should apply migrations correctly in the up direction&quot; do
     Sequel::Migrator.apply(@db, '.', 3, 2)
     @db.creates.should == [3333]
     
@@ -230,28 +232,28 @@ context &quot;Sequel::Migrator&quot; do
     Sequel::Migrator.get_current_migration_version(@db).should == 5
   end
   
-  specify &quot;should apply migrations correctly in the down direction&quot; do
+  deprec_specify &quot;should apply migrations correctly in the down direction&quot; do
     Sequel::Migrator.apply(@db, '.', 1, 5)
     @db.drops.should == [5555, 3333, 2222]
 
     Sequel::Migrator.get_current_migration_version(@db).should == 1
   end
 
-  specify &quot;should apply migrations up to the latest version if no target is given&quot; do
+  deprec_specify &quot;should apply migrations up to the latest version if no target is given&quot; do
     Sequel::Migrator.apply(@db, '.')
     @db.creates.should == [1111, 2222, 3333, 5555]
 
     Sequel::Migrator.get_current_migration_version(@db).should == 5
   end
 
-  specify &quot;should apply migrations down to 0 version correctly&quot; do
+  deprec_specify &quot;should apply migrations down to 0 version correctly&quot; do
     Sequel::Migrator.apply(@db, '.', 0, 5)
     @db.drops.should == [5555, 3333, 2222, 1111]
 
     Sequel::Migrator.get_current_migration_version(@db).should == 0
   end
   
-  specify &quot;should return the target version&quot; do
+  deprec_specify &quot;should return the target version&quot; do
     Sequel::Migrator.apply(@db, '.', 3, 2).should == 3
 
     Sequel::Migrator.apply(@db, '.', 0).should == 0</diff>
      <filename>spec/core/migration_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ end
 
 Sequel.virtual_row_instance_eval = true
 
-extensions = %w'string_date_time inflector pagination query pretty_table blank'
+extensions = %w'string_date_time inflector pagination query pretty_table blank migration'
 plugins = {:hook_class_methods=&gt;[], :schema=&gt;[], :validation_class_methods=&gt;[]}
 
 extensions.each{|e| require &quot;sequel/extensions/#{e}&quot;}</diff>
      <filename>spec/extensions/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/sequel/migration.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>e60ea8a2b9f45b2e8c8f1a186f638084e136d640</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </author>
  <url>http://github.com/foca/sequel/commit/0d8d80d67f55efbd6f8fc8ad29284a3e108f7c54</url>
  <id>0d8d80d67f55efbd6f8fc8ad29284a3e108f7c54</id>
  <committed-date>2009-03-23T11:05:34-07:00</committed-date>
  <authored-date>2009-03-23T11:05:34-07:00</authored-date>
  <message>Deprecate Migration and Migrator, require 'sequel/extensions/migration' if you want them

Migrations and the Migrator are not generally needed in normal
operation.  The only part of Sequel that depends on them is the
sequel binary when called with the -m switch.  So it is easy to
move them into an extension.  Since migrations are only run rarely,
it doesn't make sense for Sequel to load the code for them by
default.</message>
  <tree>a20d37ead781d8918e7037ce152b629c127a3f98</tree>
  <committer>
    <name>Jeremy Evans</name>
    <email>code@jeremyevans.net</email>
  </committer>
</commit>
