+=== HEAD
+
+* Make create_table with :foreign option reversible on PostgreSQL (jeremyevans)
+
+* Make drop_table with :foreign option on PostgreSQL drop a foreign table (johnnyt) (#892)
+
=== 4.15.0 (2014-10-01)
* Make AssociationReflection#reciprocal not raise error if associated class contains association with invalid associated class (jeremyevans)
@actions << [:drop_join_table, *args]
end
- def create_table(*args)
- @actions << [:drop_table, args.first]
+ def create_table(name, opts=OPTS)
+ @actions << [:drop_table, name, opts]
end
- def create_view(name, _, options={})
- @actions << [:drop_view, name, options]
+ def create_view(name, _, opts=OPTS)
+ @actions << [:drop_view, name, opts]
end
def rename_column(table, name, new_name)
# These only test the SQL created, because a true test using file_fdw or postgres_fdw
# requires superuser permissions, and you should not be running the tests as a superuser.
- specify "should support creating foreign tables" do
- DB.send(:create_table_sql, :t, DB.send(:create_table_generator){Integer :a}, :foreign=>:f, :options=>{:o=>1}).should == 'CREATE FOREIGN TABLE "t" ("a" integer) SERVER "f" OPTIONS (o \'1\')'
- end
-
- specify "should support dropping foreign tables" do
+ specify "should support creating and dropping foreign tables" do
+ DB.send(:create_table_sql, :t, DB.create_table_generator{Integer :a}, :foreign=>:f, :options=>{:o=>1}).should == 'CREATE FOREIGN TABLE "t" ("a" integer) SERVER "f" OPTIONS (o \'1\')'
DB.send(:drop_table_sql, :t, :foreign=>true).should == 'DROP FOREIGN TABLE "t"'
end
end
end
@db = @c.new
@p = Proc.new do
- create_table(:a){Integer :a}
+ create_table(:a, :foo=>:bar){Integer :a}
add_column :a, :b, String
add_index :a, :b
rename_column :a, :b, :c
specify "should apply up with normal actions in normal order" do
p = @p
Sequel.migration{change(&p)}.apply(@db, :up)
- @db.actions.should == [[:create_table, :a],
+ @db.actions.should == [[:create_table, :a, {:foo=>:bar}],
[:add_column, :a, :b, String],
[:add_index, :a, :b],
[:rename_column, :a, :b, :c],
[:rename_column, :a, :c, :b],
[:drop_index, :a, :b],
[:drop_column, :a, :b],
- [:drop_table, :a]]
+ [:drop_table, :a, {:foo=>:bar}]]
end
specify "should raise in the down direction if migration uses unsupported method" do