Add an add_index method on ResultSource (and proxy classes)
[dbsrgits/DBIx-Class.git] / lib / SQL / Translator / Parser / DBIx / Class.pm
index 1f09482..a0f37b6 100644 (file)
@@ -5,6 +5,8 @@ package # hide from PAUSE
 
 # Some mistakes the fault of Matt S Trout
 
+# Others the fault of Ash Berlin
+
 use strict;
 use warnings;
 use vars qw($DEBUG $VERSION @EXPORT_OK);
@@ -107,6 +109,11 @@ sub parse {
             }
         }
 
+        foreach my $idx ( $source->indices ) {
+            my $ret = $table->add_index(%$idx)
+              or die $table->error;
+        }
+
         my @rels = $source->relationships();
 
         my %created_FK_rels;