1 package SQL::Translator::Parser::MySQL;
3 # -------------------------------------------------------------------
4 # $Id: MySQL.pm,v 1.58 2007-03-19 17:15:24 duality72 Exp $
5 # -------------------------------------------------------------------
6 # Copyright (C) 2002-4 SQLFairy Authors
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; version 2.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 # -------------------------------------------------------------------
25 SQL::Translator::Parser::MySQL - parser for MySQL
30 use SQL::Translator::Parser::MySQL;
32 my $translator = SQL::Translator->new;
33 $translator->parser("SQL::Translator::Parser::MySQL");
37 The grammar is influenced heavily by Tim Bunce's "mysql2ora" grammar.
39 Here's the word from the MySQL site
40 (http://www.mysql.com/doc/en/CREATE_TABLE.html):
42 CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)]
43 [table_options] [select_statement]
47 CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name LIKE old_table_name;
50 col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT]
51 [PRIMARY KEY] [reference_definition]
52 or PRIMARY KEY (index_col_name,...)
53 or KEY [index_name] (index_col_name,...)
54 or INDEX [index_name] (index_col_name,...)
55 or UNIQUE [INDEX] [index_name] (index_col_name,...)
56 or FULLTEXT [INDEX] [index_name] (index_col_name,...)
57 or [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...)
58 [reference_definition]
62 TINYINT[(length)] [UNSIGNED] [ZEROFILL]
63 or SMALLINT[(length)] [UNSIGNED] [ZEROFILL]
64 or MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]
65 or INT[(length)] [UNSIGNED] [ZEROFILL]
66 or INTEGER[(length)] [UNSIGNED] [ZEROFILL]
67 or BIGINT[(length)] [UNSIGNED] [ZEROFILL]
68 or REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]
69 or DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]
70 or FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]
71 or DECIMAL(length,decimals) [UNSIGNED] [ZEROFILL]
72 or NUMERIC(length,decimals) [UNSIGNED] [ZEROFILL]
73 or CHAR(length) [BINARY]
74 or VARCHAR(length) [BINARY]
87 or ENUM(value1,value2,value3,...)
88 or SET(value1,value2,value3,...)
94 REFERENCES tbl_name [(index_col_name,...)]
95 [MATCH FULL | MATCH PARTIAL]
96 [ON DELETE reference_option]
97 [ON UPDATE reference_option]
100 RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT
103 TYPE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM }
104 or AUTO_INCREMENT = #
105 or AVG_ROW_LENGTH = #
106 or CHECKSUM = {0 | 1}
107 or COMMENT = "string"
110 or PACK_KEYS = {0 | 1 | DEFAULT}
111 or PASSWORD = "string"
112 or DELAY_KEY_WRITE = {0 | 1}
113 or ROW_FORMAT= { default | dynamic | fixed | compressed }
114 or RAID_TYPE= {1 | STRIPED | RAID0 } RAID_CHUNKS=# RAID_CHUNKSIZE=#
115 or UNION = (table_name,[table_name...])
116 or INSERT_METHOD= {NO | FIRST | LAST }
117 or DATA DIRECTORY="absolute path to directory"
118 or INDEX DIRECTORY="absolute path to directory"
120 A subset of the ALTER TABLE syntax that allows addition of foreign keys:
122 ALTER [IGNORE] TABLE tbl_name alter_specification [, alter_specification] ...
125 ADD [CONSTRAINT [symbol]]
126 FOREIGN KEY [index_name] (index_col_name,...)
127 [reference_definition]
129 A subset of INSERT that we ignore:
136 use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ];
137 $VERSION = sprintf "%d.%02d", q$Revision: 1.58 $ =~ /(\d+)\.(\d+)/;
138 $DEBUG = 0 unless defined $DEBUG;
141 use Parse::RecDescent;
143 use Storable qw(dclone);
144 use DBI qw(:sql_types);
145 use base qw(Exporter);
147 our %type_mapping = (
149 integer => SQL_INTEGER,
151 tinyint => SQL_TINYINT,
152 smallint => SQL_SMALLINT,
156 float => SQL_FLOAT, # Precision 0..23
157 double => SQL_DOUBLE, # Precision 24..53
158 "double precision" => SQL_DOUBLE,
161 # all these are the same.
162 decimal => SQL_DECIMAL,
163 numeric => SQL_NUMERIC,
165 # fixed: does this exist
170 datetime => SQL_DATETIME,
171 timestamp => SQL_TIMESTAMP,
177 varchar => SQL_VARCHAR,
178 binary => SQL_BINARY,
179 varbinary => SQL_VARBINARY,
180 tinyblob => SQL_BLOB,
183 text => SQL_LONGVARCHAR
184 mediumblob => SQL_BLOB,
185 mediumtext => SQL_LONGVARCHAR
187 longtext => SQL_LONGVARCHAR
193 @EXPORT_OK = qw(parse);
195 # Enable warnings within the Parse::RecDescent module.
196 $::RD_ERRORS = 1; # Make sure the parser dies when it encounters an error
197 $::RD_WARN = 1; # Enable warnings. This will warn on unused rules &c.
198 $::RD_HINT = 1; # Give out hints to help fix problems.
200 use constant DEFAULT_PARSER_VERSION => 30000;
202 $GRAMMAR = << 'END_OF_GRAMMAR';
205 my ( $database_name, %tables, $table_order, @table_comments, %views, $view_order, %procedures, $proc_order );
210 # The "eofile" rule makes the parser fail if any "statement" rule
211 # fails. Otherwise, the first successful match by a "statement"
212 # won't cause the failure needed to know that the parse, as a whole,
215 startrule : statement(s) eofile {
216 { tables => \%tables, database_name => $database_name, views => \%views, procedures =>\%procedures }
232 use : /use/i WORD "$delimiter"
234 $database_name = $item[2];
235 @table_comments = ();
238 set : /set/i /[^;]+/ "$delimiter"
239 { @table_comments = () }
241 drop : /drop/i TABLE /[^;]+/ "$delimiter"
243 drop : /drop/i WORD(s) "$delimiter"
244 { @table_comments = () }
247 # MySQL strings, unlike common SQL strings, can be double-quoted or
248 # single-quoted, and you can escape the delmiters by doubling (but only the
249 # delimiter) or by backslashing.
251 /'(\\.|''|[^\\\'])*'/ |
252 /"(\\.|""|[^\\\"])*"/
253 # For reference, std sql str: /(?:(?:\')(?:[^\']*(?:(?:\'\')[^\']*)*)(?:\'))//
255 nonstring : /[^;\'"]+/
257 statement_body : (string | nonstring)(s?)
259 insert : /insert/i statement_body "$delimiter"
261 delimiter : /delimiter/i /[\S]+/
262 { $delimiter = $item[2] }
264 empty_statement : "$delimiter"
266 alter : ALTER TABLE table_name alter_specification(s /,/) "$delimiter"
268 my $table_name = $item{'table_name'};
269 die "Cannot ALTER table '$table_name'; it does not exist"
270 unless $tables{ $table_name };
271 for my $definition ( @{ $item[4] } ) {
272 $definition->{'extra'}->{'alter'} = 1;
273 push @{ $tables{ $table_name }{'constraints'} }, $definition;
277 alter_specification : ADD foreign_key_def
278 { $return = $item[2] }
280 create : CREATE /database/i WORD "$delimiter"
281 { @table_comments = () }
283 create : CREATE TEMPORARY(?) TABLE opt_if_not_exists(?) table_name '(' create_definition(s /,/) /(,\s*)?\)/ table_option(s?) "$delimiter"
285 my $table_name = $item{'table_name'};
286 $tables{ $table_name }{'order'} = ++$table_order;
287 $tables{ $table_name }{'table_name'} = $table_name;
289 if ( @table_comments ) {
290 $tables{ $table_name }{'comments'} = [ @table_comments ];
291 @table_comments = ();
295 for my $definition ( @{ $item[7] } ) {
296 if ( $definition->{'supertype'} eq 'field' ) {
297 my $field_name = $definition->{'name'};
298 $tables{ $table_name }{'fields'}{ $field_name } =
299 { %$definition, order => $i };
302 if ( $definition->{'is_primary_key'} ) {
303 push @{ $tables{ $table_name }{'constraints'} },
305 type => 'primary_key',
306 fields => [ $field_name ],
311 elsif ( $definition->{'supertype'} eq 'constraint' ) {
312 push @{ $tables{ $table_name }{'constraints'} }, $definition;
314 elsif ( $definition->{'supertype'} eq 'index' ) {
315 push @{ $tables{ $table_name }{'indices'} }, $definition;
319 if ( my @options = @{ $item{'table_option(s?)'} } ) {
320 for my $option ( @options ) {
321 my ( $key, $value ) = each %$option;
322 if ( $key eq 'comment' ) {
323 push @{ $tables{ $table_name }{'comments'} }, $value;
326 push @{ $tables{ $table_name }{'table_options'} }, $option;
334 opt_if_not_exists : /if not exists/i
336 create : CREATE UNIQUE(?) /(index|key)/i index_name /on/i table_name '(' field_name(s /,/) ')' "$delimiter"
338 @table_comments = ();
339 push @{ $tables{ $item{'table_name'} }{'indices'} },
342 type => $item[2] ? 'unique' : 'normal',
348 create : CREATE /trigger/i NAME not_delimiter "$delimiter"
350 @table_comments = ();
353 create : CREATE PROCEDURE NAME not_delimiter "$delimiter"
355 @table_comments = ();
356 my $func_name = $item[3];
358 my $sql = "$item[1] $item[2] $item[3] $item[4]";
360 $procedures{ $func_name }{'order'} = ++$proc_order;
361 $procedures{ $func_name }{'name'} = $func_name;
362 $procedures{ $func_name }{'owner'} = $owner;
363 $procedures{ $func_name }{'sql'} = $sql;
366 PROCEDURE : /procedure/i
369 create : CREATE algorithm /view/i NAME not_delimiter "$delimiter"
371 @table_comments = ();
372 my $view_name = $item[4];
373 my $sql = "$item[1] $item[2] $item[3] $item[4] $item[5]";
375 # Hack to strip database from function calls in SQL
376 $sql =~ s#`\w+`\.(`\w+`\()##g;
378 $views{ $view_name }{'order'} = ++$view_order;
379 $views{ $view_name }{'name'} = $view_name;
380 $views{ $view_name }{'sql'} = $sql;
383 algorithm : /algorithm/i /=/ WORD
385 $return = "$item[1]=$item[3]";
388 not_delimiter : /.*?(?=$delimiter)/is
390 create_definition : constraint
396 comment : /^\s*(?:#|-{2}).*\n/
398 my $comment = $item[1];
399 $comment =~ s/^\s*(#|--)\s*//;
400 $comment =~ s/\s*$//;
404 comment : /\/\*/ /.*?\*\//s
406 my $comment = $item[2];
407 $comment = substr($comment, 0, -2);
408 $comment =~ s/^\s*|\s*$//g;
412 field_comment : /^\s*(?:#|-{2}).*\n/
414 my $comment = $item[1];
415 $comment =~ s/^\s*(#|--)\s*//;
416 $comment =~ s/\s*$//;
421 field_comment2 : /comment/i /'.*?'/
423 my $comment = $item[2];
431 field : field_comment(s?) field_name data_type field_qualifier(s?) field_comment2(?) reference_definition(?) on_update(?) field_comment(s?)
433 my %qualifiers = map { %$_ } @{ $item{'field_qualifier(s?)'} || [] };
434 if ( my @type_quals = @{ $item{'data_type'}{'qualifiers'} || [] } ) {
435 $qualifiers{ $_ } = 1 for @type_quals;
438 my $null = defined $qualifiers{'not_null'}
439 ? $qualifiers{'not_null'} : 1;
440 delete $qualifiers{'not_null'};
442 my @comments = ( @{ $item[1] }, @{ $item[5] }, @{ $item[8] } );
445 supertype => 'field',
446 name => $item{'field_name'},
447 data_type => $item{'data_type'}{'type'},
448 size => $item{'data_type'}{'size'},
449 list => $item{'data_type'}{'list'},
451 constraints => $item{'reference_definition(?)'},
452 comments => [ @comments ],
458 field_qualifier : not_null
461 null => $item{'not_null'},
465 field_qualifier : default_val
468 default => $item{'default_val'},
472 field_qualifier : auto_inc
475 is_auto_inc => $item{'auto_inc'},
479 field_qualifier : primary_key
482 is_primary_key => $item{'primary_key'},
486 field_qualifier : unsigned
489 is_unsigned => $item{'unsigned'},
493 field_qualifier : /character set/i WORD
496 'CHARACTER SET' => $item[2],
500 field_qualifier : /collate/i WORD
507 field_qualifier : /on update/i CURRENT_TIMESTAMP
510 'ON UPDATE' => $item[2],
514 field_qualifier : /unique/i KEY(?)
521 field_qualifier : KEY
528 reference_definition : /references/i table_name parens_field_list(?) match_type(?) on_delete(?) on_update(?)
531 type => 'foreign_key',
532 reference_table => $item[2],
533 reference_fields => $item[3][0],
534 match_type => $item[4][0],
535 on_delete => $item[5][0],
536 on_update => $item[6][0],
540 match_type : /match full/i { 'full' }
542 /match partial/i { 'partial' }
544 on_delete : /on delete/i reference_option
548 /on update/i 'CURRENT_TIMESTAMP'
551 /on update/i reference_option
554 reference_option: /restrict/i |
571 data_type : WORD parens_value_list(s?) type_qualifier(s?)
574 my $size; # field size, applicable only to non-set fields
575 my $list; # set list, applicable only to sets (duh)
577 if ( uc($type) =~ /^(SET|ENUM)$/ ) {
591 qualifiers => $item[3],
595 parens_field_list : '(' field_name(s /,/) ')'
598 parens_value_list : '(' VALUE(s /,/) ')'
601 type_qualifier : /(BINARY|UNSIGNED|ZEROFILL)/i
606 create_index : /create/i /index/i
608 not_null : /not/i /null/i
614 unsigned : /unsigned/i { $return = 0 }
616 #default_val : /default/i /(?:')?[\s\w\d:.-]*(?:')?/
618 # $item[2] =~ s/'//g;
619 # $return = $item[2];
623 /default/i 'CURRENT_TIMESTAMP'
628 /default/i /'(?:.*?\\')*.*?'|(?:')?[\w\d:.-]*(?:')?/
630 $item[2] =~ s/^\s*'|'\s*$//g;
634 auto_inc : /auto_increment/i { 1 }
636 primary_key : /primary/i /key/i { 1 }
638 constraint : primary_key_def
643 foreign_key_def : foreign_key_def_begin parens_field_list reference_definition
646 supertype => 'constraint',
647 type => 'foreign_key',
650 %{ $item{'reference_definition'} },
654 foreign_key_def_begin : /constraint/i /foreign key/i WORD
655 { $return = $item[3] }
657 /constraint/i NAME /foreign key/i
658 { $return = $item[2] }
660 /constraint/i /foreign key/i
664 { $return = $item[2] }
669 primary_key_def : primary_key index_name(?) '(' name_with_opt_paren(s /,/) ')'
672 supertype => 'constraint',
673 name => $item{'index_name(?)'}[0],
674 type => 'primary_key',
679 unique_key_def : UNIQUE KEY(?) index_name(?) '(' name_with_opt_paren(s /,/) ')'
682 supertype => 'constraint',
683 name => $item{'index_name(?)'}[0],
689 normal_index : KEY index_name(?) '(' name_with_opt_paren(s /,/) ')'
692 supertype => 'index',
694 name => $item{'index_name(?)'}[0],
699 fulltext_index : /fulltext/i KEY(?) index_name(?) '(' name_with_opt_paren(s /,/) ')'
702 supertype => 'index',
704 name => $item{'index_name(?)'}[0],
709 name_with_opt_paren : NAME parens_value_list(s?)
710 { $item[2][0] ? "$item[1]($item[2][0][0])" : $item[1] }
712 UNIQUE : /unique/i { 1 }
714 KEY : /key/i | /index/i
716 table_option : /comment/i /=/ /'.*?'/
718 my $comment = $item[3];
721 $return = { comment => $comment };
723 | /(default )?(charset|character set)/i /\s*=\s*/ WORD
725 $return = { 'CHARACTER SET' => $item[3] };
727 | WORD /\s*=\s*/ WORD
729 $return = { $item[1] => $item[3] };
740 TEMPORARY : /temporary/i
755 VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/
759 # remove leading/trailing quotes
761 $val =~ s/^['"]|['"]$//g;
767 CURRENT_TIMESTAMP : /current_timestamp(\(\))?/i
769 { 'CURRENT_TIMESTAMP' }
773 # -------------------------------------------------------------------
775 my ( $translator, $data ) = @_;
776 my $parser = Parse::RecDescent->new($GRAMMAR);
778 local $::RD_TRACE = $translator->trace ? 1 : undef;
779 local $DEBUG = $translator->debug;
781 unless (defined $parser) {
782 return $translator->error("Error instantiating Parse::RecDescent ".
783 "instance: Bad grammer");
786 # Preprocess for MySQL-specific and not-before-version comments from mysqldump
787 my $parser_version = $translator->parser_args->{mysql_parser_version} || DEFAULT_PARSER_VERSION;
788 while ( $data =~ s#/\*!(\d{5})?(.*?)\*/#($1 && $1 > $parser_version ? '' : $2)#es ) {}
790 my $result = $parser->startrule($data);
791 return $translator->error( "Parse failed." ) unless defined $result;
792 warn "Parse result:".Dumper( $result ) if $DEBUG;
794 my $schema = $translator->schema;
795 $schema->name($result->{'database_name'}) if $result->{'database_name'};
798 $result->{'tables'}{ $a }{'order'}
800 $result->{'tables'}{ $b }{'order'}
801 } keys %{ $result->{'tables'} };
803 for my $table_name ( @tables ) {
804 my $tdata = $result->{tables}{ $table_name };
805 my $table = $schema->add_table(
806 name => $tdata->{'table_name'},
807 ) or die $schema->error;
809 $table->comments( $tdata->{'comments'} );
812 $tdata->{'fields'}->{$a}->{'order'}
814 $tdata->{'fields'}->{$b}->{'order'}
815 } keys %{ $tdata->{'fields'} };
817 for my $fname ( @fields ) {
818 my $fdata = $tdata->{'fields'}{ $fname };
819 my $field = $table->add_field(
820 name => $fdata->{'name'},
821 data_type => $fdata->{'data_type'},
822 size => $fdata->{'size'},
823 default_value => $fdata->{'default'},
824 is_auto_increment => $fdata->{'is_auto_inc'},
825 is_nullable => $fdata->{'null'},
826 comments => $fdata->{'comments'},
827 ) or die $table->error;
829 $table->primary_key( $field->name ) if $fdata->{'is_primary_key'};
831 for my $qual ( qw[ binary unsigned zerofill list collate ],
832 'character set', 'on update' ) {
833 if ( my $val = $fdata->{ $qual } || $fdata->{ uc $qual } ) {
834 next if ref $val eq 'ARRAY' && !@$val;
835 $field->extra( $qual, $val );
839 if ( $fdata->{'has_index'} ) {
843 fields => $fdata->{'name'},
844 ) or die $table->error;
847 if ( $fdata->{'is_unique'} ) {
848 $table->add_constraint(
851 fields => $fdata->{'name'},
852 ) or die $table->error;
855 if ( $field->data_type =~ /(set|enum)/i && !$field->size ) {
856 my %extra = $field->extra;
858 for my $len ( map { length } @{ $extra{'list'} || [] } ) {
859 $longest = $len if $len > $longest;
861 $field->size( $longest ) if $longest;
864 for my $cdata ( @{ $fdata->{'constraints'} } ) {
865 next unless $cdata->{'type'} eq 'foreign_key';
866 $cdata->{'fields'} ||= [ $field->name ];
867 push @{ $tdata->{'constraints'} }, $cdata;
872 for my $idata ( @{ $tdata->{'indices'} || [] } ) {
873 my $index = $table->add_index(
874 name => $idata->{'name'},
875 type => uc $idata->{'type'},
876 fields => $idata->{'fields'},
877 ) or die $table->error;
880 if ( my @options = @{ $tdata->{'table_options'} || [] } ) {
881 $table->options( \@options ) or die $table->error;
884 for my $cdata ( @{ $tdata->{'constraints'} || [] } ) {
885 my $constraint = $table->add_constraint(
886 name => $cdata->{'name'},
887 type => $cdata->{'type'},
888 fields => $cdata->{'fields'},
889 reference_table => $cdata->{'reference_table'},
890 reference_fields => $cdata->{'reference_fields'},
891 match_type => $cdata->{'match_type'} || '',
892 on_delete => $cdata->{'on_delete'} || $cdata->{'on_delete_do'},
893 on_update => $cdata->{'on_update'} || $cdata->{'on_update_do'},
894 ) or die $table->error;
897 # After the constrains and PK/idxs have been created, we normalize fields
898 normalize_field($_) for $table->get_fields;
901 my @procedures = sort {
902 $result->{procedures}->{ $a }->{'order'} <=> $result->{procedures}->{ $b }->{'order'}
903 } keys %{ $result->{procedures} };
904 foreach my $proc_name (@procedures) {
905 $schema->add_procedure(
907 owner => $result->{procedures}->{$proc_name}->{owner},
908 sql => $result->{procedures}->{$proc_name}->{sql},
913 $result->{views}->{ $a }->{'order'} <=> $result->{views}->{ $b }->{'order'}
914 } keys %{ $result->{views} };
915 foreach my $view_name (keys %{ $result->{views} }) {
918 sql => $result->{views}->{$view_name}->{sql},
925 # Takes a field, and returns
926 sub normalize_field {
928 my ($size, $type, $list, $changed) = @_;
930 $size = $field->size;
931 $type = $field->data_type;
932 $list = $field->extra->{list} || [];
934 if ( !ref $size && $size eq 0 ) {
935 if ( lc $type eq 'tinyint' ) {
936 $changed = $size != 4;
939 elsif ( lc $type eq 'smallint' ) {
940 $changed = $size != 6;
943 elsif ( lc $type eq 'mediumint' ) {
944 $changed = $size != 9;
947 elsif ( $type =~ /^int(eger)?$/i ) {
948 $changed = $size != 11 || $type ne 'int';
952 elsif ( lc $type eq 'bigint' ) {
953 $changed = $size != 20;
956 elsif ( lc $type =~ /(float|double|decimal|numeric|real|fixed|dec)/ ) {
957 my $old_size = (ref $size || '') eq 'ARRAY' ? $size : [];
958 $changed = @$old_size != 2 && $old_size->[0] != 8 && $old_size->[1] != 2;
963 if ( $type =~ /^tiny(text|blob)$/i ) {
964 $changed = $size != 255;
967 elsif ( $type =~ /^(blob|text)$/i ) {
968 $changed = $size != 65_535;
971 elsif ( $type =~ /^medium(blob|text)$/i ) {
972 $changed = $size != 16_777_215;
975 elsif ( $type =~ /^long(blob|text)$/i ) {
976 $changed = $size != 4_294_967_295;
977 $size = 4_294_967_295;
979 $DB::single = 1 if $field->name eq 'employee_id';
981 # We only want to clone the field, not *everything*
982 { local $field->{table} = undef;
983 $field->parsed_field(dclone($field));
984 $field->parsed_field->{table} = $field->table;
987 $field->data_type($type);
988 $field->sql_data_type( $type_mapping{lc $type} || SQL_UNKNOWN_TYPE );
989 $field->extra->{list} = $list if @$list;
996 # -------------------------------------------------------------------
997 # Where man is not nature is barren.
999 # -------------------------------------------------------------------
1005 Ken Youens-Clark E<lt>kclark@cpan.orgE<gt>,
1006 Chris Mungall E<lt>cjm@fruitfly.orgE<gt>.
1010 Parse::RecDescent, SQL::Translator::Schema.