Reduce $Id to its normal form
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser / DBI / MySQL.pm
index b69c4d5..f04a737 100644 (file)
@@ -1,9 +1,9 @@
 package SQL::Translator::Parser::DBI::MySQL;
 
 # -------------------------------------------------------------------
-# $Id: MySQL.pm,v 1.6 2006-02-22 22:52:51 kycl4rk Exp $
+# $Id$
 # -------------------------------------------------------------------
-# Copyright (C) 2002-4 SQLFairy Authors
+# Copyright (C) 2002-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
@@ -43,7 +43,7 @@ use SQL::Translator::Schema::Constants;
 use SQL::Translator::Parser::MySQL;
 
 use vars qw[ $DEBUG $VERSION @EXPORT_OK ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/;
+$VERSION = '1.99';
 $DEBUG   = 0 unless defined $DEBUG;
 
 # -------------------------------------------------------------------
@@ -51,11 +51,13 @@ sub parse {
     my ( $tr, $dbh ) = @_;
     my $schema       = $tr->schema;
     my @table_names  = @{ $dbh->selectcol_arrayref('show tables') };
+    my @skip_tables = defined $tr->parser_args->{skip}?split(/,/, $tr->parser_args->{skip}):();
 
     $dbh->{'FetchHashKeyName'} = 'NAME_lc';
 
     my $create;
     for my $table_name ( @table_names ) {
+        next if (grep /^$table_name$/, @skip_tables);
         my $sth = $dbh->prepare("show create table $table_name");
         $sth->execute;
         my $table = $sth->fetchrow_hashref;