From: Dagfinn Ilmari Mannsåker Date: Sun, 8 Jun 2008 13:25:19 +0000 (+0000) Subject: Fix Oracle constraint and auto-increment detection for non-owned schemas X-Git-Tag: 0.04999_06~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c7bf4194447f499ab28dd4c0b944faf874367968;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Fix Oracle constraint and auto-increment detection for non-owned schemas --- diff --git a/Changes b/Changes index 0467b2f..fd475e3 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,8 @@ Revision history for Perl extension DBIx::Class::Schema::Loader - Add "dbicdump" script for easy commandline dumping - Throw out the in-memory class generation, just dump to a temporary directory if the user didn't specify one + - Fix Oracle constraint and auto-increment detection for non-owned schemas + (RT #35732) 0.04999_05 Mon Apr 14, 2008 - Fix limiting table list to the specified schema for DB2 diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm index ce9d96b..52d5c4f 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm @@ -78,10 +78,10 @@ sub _table_uniq_info { my $sth = $dbh->prepare_cached( q{ - 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 + SELECT constraint_name, acc.column_name + FROM all_constraints JOIN all_cons_columns acc USING (constraint_name) + WHERE acc.table_name=? AND constraint_type='U' + ORDER BY acc.position }, {}, 1); @@ -131,8 +131,8 @@ sub _extra_column_info { 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 = ? + FROM all_triggers ut JOIN all_trigger_cols atc USING (trigger_name) + WHERE atc.table_name = ? AND atc.column_name = ? AND column_usage LIKE '%NEW%' AND column_usage LIKE '%OUT%' AND trigger_type = 'BEFORE EACH ROW' AND triggering_event LIKE '%INSERT%' },