Revert my previous changes (rev 1722 reverted back to rev 1721)
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser / DBI / Oracle.pm
index e1a9e2c..c853a81 100644 (file)
@@ -1,9 +1,7 @@
 package SQL::Translator::Parser::DBI::Oracle;
 
 # -------------------------------------------------------------------
-# $Id: Oracle.pm,v 1.2 2006-03-09 20:18:05 cahille Exp $
-# -------------------------------------------------------------------
-# Copyright (C) 2006 SQLFairy Authors
+# Copyright (C) 2006-2009 SQLFairy Authors
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -42,7 +40,7 @@ use SQL::Translator::Schema::Table;
 use SQL::Translator::Schema::Field;
 use SQL::Translator::Schema::Constraint;
 
-our $VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/;
+our $VERSION = '1.59';
 
 # -------------------------------------------------------------------
 sub parse {
@@ -50,10 +48,10 @@ sub parse {
 
     my $schema = $tr->schema;
 
-    my $sth = $dbh->table_info();
+    my $db_user = uc $tr->parser_args()->{db_user};
+    my $sth = $dbh->table_info(undef, $db_user, '%', 'TABLE');
 
     while(my $table_info = $sth->fetchrow_hashref('NAME_uc')) {
-        next unless ($table_info->{TABLE_TYPE} eq 'TABLE');
         next if ($table_info->{TABLE_NAME} =~ /\$/);
 
         # create the table