Subject: | PK Scan Warns about sqlite_sequence Table |
When Schema::Loader scans SQLite tables for primary keys, it finds the
sqlite_sequence table, which is apparently an internal table to enable
autoincrement. Because this table has no primary key, the module warns
about it.
This patch cleans up the list of PKs.
I didn't see an obvious way to test this, so the test suite performs as
expected both with and without this patch.
I'm using DBD::SQLite 1.13.
Subject: | sqlite_sequence.patch |
--- lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm~ 2007-04-16 17:24:30.000000000 -0700
+++ lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm 2007-04-16 17:39:22.000000000 -0700
@@ -149,6 +149,12 @@
return $self->{_sqlite_parse_data}->{$table}->{rels};
}
+sub _table_pk_info {
+ my $self = shift;
+ my $info = $self->SUPER::_table_pk_info( @_ );
+ return [ grep { $_ ne 'sqlite_sequence' } @$info ];
+}
+
sub _table_uniq_info {
my ($self, $table) = @_;