Revision history for Perl extension DBIx::Class::Schema::Loader
+0.04999_02 Not yet released
+ - Add is_auto_increment detection for Oracle
+
0.04999_01 Tue Feb 5, 2008
- Mark foreign key columns with is_foreign_key => 1
- Add support for vendor-specific extra column attributes.
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;