SQL::Translator::Filter::Globals man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

SQL::Translator::FilteUserlContributed PerlSQL::Translator::Filter::Globals(3)

NAME
       SQL::Translator::Filter::Globals - Add global fields and indices to all
       tables.

SYNOPSIS
	 # e.g. Add timestamp field to all tables.
	 use SQL::Translator;

	 my $sqlt = SQL::Translator->new(
	     from => 'MySQL',
	     to	  => 'MySQL',
	     filters => [
	       Globals => {
		   fields => [
		       {
			   name => 'modified'
			   data_type => 'TIMESTAMP'
		       }
		   ],
		   indices => [
		       {
			   fields => 'modifed',
		       },
		   ]
		   constraints => [
		       {
		       }
		   ]
	       },
	     ],
	 ) || die "SQLFairy error : ".SQL::Translator->error;
	 my $sql = $sqlt->translate || die "SQLFairy error : ".$sqlt->error;

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).

       If a table already contains a field with the same name as a global then
       it is skipped for that table.

   The _GLOBAL_ Table
       An alternative to using the args is to add a table called "_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 "global_table" arg to the
       filter.

SEE ALSO
       perl(1), SQL::Translator

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 the same as one added globally.

TODO
       Some extra data values that can be used to control the global addition.
       e.g.  'skip_global'.

AUTHOR
       Mark Addison <grommit@users.sourceforge.net>

perl v5.14.2			  2011-05-0SQL::Translator::Filter::Globals(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net