From aa261fe9a2058537868dd269e00f6dd5d006022e Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jul 2001 07:38:43 +0000 Subject: [PATCH] delcolumn, version bump for dependencies --- DBSchema.pm | 2 +- DBSchema/Table.pm | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/DBSchema.pm b/DBSchema.pm index 7149d6d..418fadf 100644 --- a/DBSchema.pm +++ b/DBSchema.pm @@ -14,7 +14,7 @@ use DBIx::DBSchema::ColGroup::Index; #@ISA = qw(Exporter); @ISA = (); -$VERSION = "0.17"; +$VERSION = "0.18"; =head1 NAME diff --git a/DBSchema/Table.pm b/DBSchema/Table.pm index 50700b6..e4bc2dd 100644 --- a/DBSchema/Table.pm +++ b/DBSchema/Table.pm @@ -230,6 +230,20 @@ sub addcolumn { push @{$self->{'column_order'}}, $column->name; } +=item delcolumn COLUMN_NAME + +Deletes this column. Returns false if no column of this name was found to +remove, true otherwise. + +=cut + +sub delcolumn { + my($self,$column) = @_; + return 0 unless exists $self->{'columns'}{$column}; + delete $self->{'columns'}{$column}; + @{$self->{'column_order'}}= grep { $_ ne $column } @{$self->{'column_order'}}; 1; +} + =item name [ TABLE_NAME ] Returns or sets the table name. -- 2.11.0