+L<DBIx::DBSchema::Index>.
+
+=item indices CLASS DBI_DBH TABLE
+
+Given an active DBI database handle, return a hashref of all indices, both
+unique and non-unique. The keys of the hashref are index names, and the values
+are again hashrefs with the following keys:
+
+=over 8
+
+=item name - Index name (redundant)
+
+=item using - Optional index method
+
+=item unique - Boolean indicating whether or not this is a unique index
+
+=item columns - List reference of column names (or expressions)
+
+=back
+
+(See L<FS::DBIx::DBSchema::Index>)
+
+New drivers are advised to implement this method, and existing drivers are
+advised to (eventually) provide this method instead of B<index> and B<unique>.
+
+For backwards-compatibility with current drivers, the base DBIx::DBSchema::DBD
+class provides an B<indices> method which uses the old B<index> and B<unique>
+methods to provide this data.
+
+=cut
+
+sub indices {
+ #my($proto, $dbh, $table) = @_;
+ my($proto, @param) = @_;
+
+ my $unique_hr = $proto->unique( @param );
+ my $index_hr = $proto->index( @param );
+
+ my $gratuitous_hashref_to_force_scalar_context =
+ {
+
+ (
+ map {
+ $_ => { 'name' => $_,
+ 'unique' => 1,
+ 'columns' => $unique_hr->{$_},
+ },
+ }
+ keys %$unique_hr
+ ),
+
+ (
+ map {
+ $_ => { 'name' => $_,
+ 'unique' => 0,
+ 'columns' => $index_hr->{$_},
+ },
+ }
+ keys %$index_hr
+ ),
+
+ };
+
+}