Revision history for Perl extension DBIx::DBSchema.
-0.33 unreleased
+0.33 Thu Jun 28 18:46:15 PDT 2007
- Overhaul of index representation: indices (both normal and unique)
- are now named DBIx::DBSchema::Index objects
+ now have names and are DBIx::DBSchema::Index objects
- update_schema now handles indices!
- Bump version numbers in Table.pm, Column.pm and DBD.pm
- Pg reverse-engineering fix for column order in multi-column indices,
use DBIx::DBSchema::ColGroup::Unique;
use DBIx::DBSchema::ColGroup::Index;
-$VERSION = "0.33_01";
-$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
+$VERSION = "0.33";
+#$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
$DEBUG = 0;
: ();
}
+=item unique_singles
+
+Meet exciting and unique singles using this method!
+
+This method returns a list of column names that are indexed with their own,
+unique, non-compond (that's the "single" part) indices.
+
+=cut
+
+sub unique_singles {
+ my $self = shift;
+ my %indices = $self->indices;
+
+ map { ${ $indices{$_}->columns }[0] }
+ grep { $indices{$_}->unique && scalar(@{$indices{$_}->columns}) == 1 }
+ keys %indices;
+}
+
=item sql_create_table [ DATABASE_HANDLE | DATA_SOURCE [ USERNAME PASSWORD [ ATTR ] ] ]
Returns a list of SQL statments to create this table.