-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;
use Carp::Clan qw/^DBIx::Class/;
use Class::C3;
-our $VERSION = '0.04004';
+our $VERSION = '0.04999_05';
=head1 NAME
SELECT constraint_name, ucc.column_name
FROM user_constraints JOIN user_cons_columns ucc USING (constraint_name)
WHERE ucc.table_name=? AND constraint_type='U'
+ ORDER BY ucc.position
},
{}, 1);
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>,
TSUNODA Kazuya C<drk@drk7.jp>
+Dagfinn Ilmari Mannsåker C<ilmari@ilmari.org>
+
=cut
1;