| Path: | doc/release_notes/3.46.0.txt |
| Last Update: | Thu Jun 06 17:01:31 +0000 2013 |
alter_table(:tab){drop_foreign_key :col}
This relies on foreign_key_list working and including the name of the foreign key. Previously, you‘d have to drop the foreign key constraint before dropping the column in some cases.
create_table(:tab) do
primary_key :id, :primary_key_constraint_name=>:pk_name
foriegn_key :t_id, :t, :foreign_key_constraint_name=>:fk_name,
:unique=>true, :unique_constraint_name=>:uk_name
end
This makes it easier to name constraints, which has always been recommended as it makes it easier to drop such constraints in the future.
alter_table(:tab){drop_constraint :foo, :type=>:primary_key}
artist = Artist[1]
artist.has_albums # => false
album = Album.new(:artist=>artist)
def album.after_create
super
artist.update(:has_albums=>true)
end
album.save
artist.has_albums # => false
Such code should either refresh the artist after saving the album, or use album.artist.has_albums. You already had to do that if the dataset did not support insert_select; the impetus for this change was to make the behavior consistent.
dataset.get([Sequel.as('string', :some_alias)])