Revision history for Perl extension DBIx::Class::Schema::Loader
+ - sequence is detected for Oracle
+ - fix for SQLite is_auto_increment detection when table is empty (hobbs)
- rescan now reloads all tables
- minor type info improvements for all DBs
- fix erroneous default_value for MySQL NOT NULL columns (RT#57225)
my $dbh = $self->schema->storage->dbh;
+ local $dbh->{LongReadLen} = 100000;
+ local $dbh->{LongTruncOk} = 1;
+
my $sth = $dbh->prepare_cached(q{
-SELECT atc.column_name
+SELECT atc.column_name, ut.trigger_body
FROM all_triggers ut
JOIN all_trigger_cols atc USING (trigger_name)
WHERE atc.table_name = ?
$sth->execute($self->_uc($table));
- while (my ($col_name) = $sth->fetchrow_array) {
- $result->{$self->_lc($col_name)}{is_auto_increment} = 1;
+ while (my ($col_name, $trigger_body) = $sth->fetchrow_array) {
+ $col_name = $self->_lc($col_name);
+
+ $result->{$col_name}{is_auto_increment} = 1;
+
+ if (my ($seq_name) = $trigger_body =~ /"?(\w+)"?\.nextval/i) {
+ $seq_name = $self->_lc($seq_name);
+
+ $result->{$col_name}{sequence} = $seq_name;
+ }
}
while (my ($col, $info) = each %$result) {
'urowid' => { data_type => 'urowid' },
'urowid(3333)' => { data_type => 'urowid', size => 3333 },
},
+ extra => {
+ count => 1,
+ run => sub {
+ my ($schema, $monikers, $classes) = @_;
+
+ SKIP: {
+ if (my $source = $monikers->{loader_test1s}) {
+ is $schema->source($source)->column_info('id')->{sequence},
+ 'loader_test1s_id_seq',
+ 'Oracle sequence detection';
+ }
+ else {
+ skip 1, 'not running common tests';
+ }
+ }
+ },
+ },
);
if( !$dsn || !$user ) {