X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FFilter%2FGlobals.pm;h=a3d3c4a0780f0cd9d3abb24833f44a933a34fd49;hb=ba506e52c480afe33dfec6b38a12759fad1e7fa2;hp=abf5a43024c94361ead3d7912db6780d4439a2da;hpb=7abd9a69ef8a7eb5c3bef4a703522b3b20d4faa4;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Filter/Globals.pm b/lib/SQL/Translator/Filter/Globals.pm index abf5a43..a3d3c4a 100644 --- a/lib/SQL/Translator/Filter/Globals.pm +++ b/lib/SQL/Translator/Filter/Globals.pm @@ -1,9 +1,7 @@ package SQL::Translator::Filter::Globals; # ------------------------------------------------------------------- -# $Id: Globals.pm,v 1.2 2006-03-10 15:04:12 grommit Exp $ -# ------------------------------------------------------------------- -# 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 @@ -58,7 +56,7 @@ SQL::Translator::Filter::Globals - Add global fields and indices to all tables. use strict; use vars qw/$VERSION/; -$VERSION=0.1; +$VERSION = '1.60'; sub filter { my $schema = shift; @@ -99,6 +97,7 @@ sub filter { type => $_->type, fields => [$_->fields], options => [$_->options], + extra => scalar($_->extra), }; } @@ -116,6 +115,7 @@ sub filter { reference_table => $_->reference_table, table => $_->table, type => $_->type, + extra => scalar($_->extra), }; } @@ -147,21 +147,22 @@ __END__ =head1 DESCRIPTION -Adds global fields, indices and constraints to all tables in the schema. -The globals to add can either be defined in the filter args or using a _GLOBAL_ -table (see below). +Adds global fields, indices and constraints to all tables in the +schema. The globals to add can either be defined in the filter args +or using a _GLOBAL_ table (see below). -If a table already contains a field with the same name as a global then it is -skipped for that table. +If a table already contains a field with the same name as a global +then it is skipped for that table. =head2 The _GLOBAL_ Table -An alternative to using the args is to add a table called C<_GLOBAL_> to the -schema and then just use the filter. Any fields and indices defined on this table -will be added to all the tables in the schema and the _GLOBAL_ table removed. +An alternative to using the args is to add a table called C<_GLOBAL_> +to the schema and then just use the filter. Any fields and indices +defined on this table will be added to all the tables in the schema +and the _GLOBAL_ table removed. -The name of the global can be changed using a C arg to the -filter. +The name of the global can be changed using a C arg to +the filter. =head1 SEE ALSO @@ -169,16 +170,16 @@ L, L =head1 BUGS -Will generate duplicate indices if an index already exists on a table the same -as one added globally. - -Will generate duplicate constraints if a constraint already exists on a table +Will generate duplicate indices if an index already exists on a table the same as one added globally. +Will generate duplicate constraints if a constraint already exists on +a table the same as one added globally. + =head1 TODO -Some extra data values that can be used to control the global addition. e.g. -'skip_global'. +Some extra data values that can be used to control the global +addition. e.g. 'skip_global'. =head1 AUTHOR