Bump version number for dev release
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / Oracle.pm
index c819c9d..de4e4a1 100644 (file)
@@ -1,6 +1,4 @@
-package # hide from pause/cpan for now, as there's a permissions
-        # issue and it's screwing the rest of the package
-  DBIx::Class::Schema::Loader::DBI::Oracle;
+package DBIx::Class::Schema::Loader::DBI::Oracle;
 
 use strict;
 use warnings;
@@ -8,7 +6,7 @@ use base 'DBIx::Class::Schema::Loader::DBI';
 use Carp::Clan qw/^DBIx::Class/;
 use Class::C3;
 
-our $VERSION = '0.04999_01';
+our $VERSION = '0.04999_02';
 
 =head1 NAME
 
@@ -123,6 +121,31 @@ sub _columns_info_for {
     return $self->next::method(uc $table);
 }
 
+sub _extra_column_info {
+    my ($self, $info) = @_;
+    my %extra_info;
+
+    my ($table, $column) = @$info{qw/TABLE_NAME COLUMN_NAME/};
+
+    my $dbh = $self->schema->storage->dbh;
+    my $sth = $dbh->prepare_cached(
+        q{
+            SELECT COUNT(*)
+            FROM user_triggers ut JOIN user_trigger_cols utc USING (trigger_name)
+            WHERE utc.table_name = ? AND utc.column_name = ?
+            AND column_usage LIKE '%NEW%' AND column_usage LIKE '%OUT%'
+            AND trigger_type = 'BEFORE EACH ROW' AND triggering_event LIKE '%INSERT%'
+        },
+        {}, 1);
+
+    $sth->execute($table, $column);
+    if ($sth->fetchrow_array) {
+        $extra_info{is_auto_increment} = 1;
+    }
+
+    return \%extra_info;
+}
+
 =head1 SEE ALSO
 
 L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
@@ -132,6 +155,8 @@ L<DBIx::Class::Schema::Loader::DBI>
 
 TSUNODA Kazuya C<drk@drk7.jp>
 
+Dagfinn Ilmari MannsÃ¥ker C<ilmari@ilmari.org>
+
 =cut
 
 1;