Permalink
Browse files

Rename set_column_accept_null to set_column_allow_null and update CHA…

…NGELOG
  • Loading branch information...
1 parent ec2db8a commit 256e3d9eee68dd6c9880b3bba0cad50e23e55330 @jeremyevans committed Sep 14, 2008
Showing with 6 additions and 4 deletions.
  1. +2 −0 CHANGELOG
  2. +2 −2 lib/sequel_core/schema/generator.rb
  3. +2 −2 spec/sequel_core/schema_spec.rb
View
@@ -1,5 +1,7 @@
=== HEAD
+* AlterTableGenerator#set_column_allow_null was added to SET/DROP NOT NULL for columns (divoxx)
+
* Database#tables now works for MySQL databases using the JDBC adapter (jeremyevans)
* Database#drop_view can now take multiple arguments to drop multiple views at once (jeremyevans)
@@ -262,8 +262,8 @@ def set_column_type(name, type)
end
# Modify a column's NOT NULL constraint.
- def set_column_accept_null(name, accept_null)
- @operations << {:op => :set_column_null, :name => name, :null => accept_null}
+ def set_column_allow_null(name, allow_null)
+ @operations << {:op => :set_column_null, :name => name, :null => allow_null}
end
private
@@ -462,14 +462,14 @@
specify "should allow adding not null constraint" do
@db.alter_table(:cats) do
- set_column_accept_null :score, false
+ set_column_allow_null :score, false
end
@db.sqls.should == ["ALTER TABLE cats ALTER COLUMN score SET NOT NULL"]
end
specify "should allow droping not null constraint" do
@db.alter_table(:cats) do
- set_column_accept_null :score, true
+ set_column_allow_null :score, true
end
@db.sqls.should == ["ALTER TABLE cats ALTER COLUMN score DROP NOT NULL"]
end

0 comments on commit 256e3d9

Please sign in to comment.