Mercurial > pub > Impl
comparison Lib/IMPL/SQL/Schema/MySQL/Formatter.pm @ 272:47db27ed5b43
sync
| author | sergey |
|---|---|
| date | Mon, 28 Jan 2013 17:24:37 +0400 |
| parents | 56364d0c4b4f |
| children | 2f06250bab5f |
comparison
equal
deleted
inserted
replaced
| 271:56364d0c4b4f | 272:47db27ed5b43 |
|---|---|
| 434 'REFERENCES', $self->quote_names( $constraint->{foreignTable} ), '(', | 434 'REFERENCES', $self->quote_names( $constraint->{foreignTable} ), '(', |
| 435 join( ', ', | 435 join( ', ', |
| 436 $self->quote_names( @{ $constraint->{foreignColumns} || [] } ) ), | 436 $self->quote_names( @{ $constraint->{foreignColumns} || [] } ) ), |
| 437 ')'; | 437 ')'; |
| 438 | 438 |
| 439 if ( my $rule = uc( $constraint->{onDelete} ) ) { | 439 if ( my $rule = $constraint->{onDelete} ) { |
| 440 $rule = uc($rule); | |
| 440 grep $_ eq $rule, @fkRules | 441 grep $_ eq $rule, @fkRules |
| 441 or die Exception->new( "Invalid onDelete rule specified", | 442 or die Exception->new( "Invalid onDelete rule specified", |
| 442 $constraint->{name}, $rule ); | 443 $constraint->{name}, $rule ); |
| 443 | 444 |
| 444 push @parts, 'ON DELETE', $rule; | 445 push @parts, 'ON DELETE', $rule; |
| 445 } | 446 } |
| 446 | 447 |
| 447 if ( my $rule = uc( $constraint->{onUpdate} ) ) { | 448 if ( my $rule = $constraint->{onUpdate} ) { |
| 449 $rule = uc($rule); | |
| 448 grep $_ eq $rule, @fkRules | 450 grep $_ eq $rule, @fkRules |
| 449 or die Exception->new( "Invalid onUpdate rule specified", | 451 or die Exception->new( "Invalid onUpdate rule specified", |
| 450 $constraint->{name}, $rule ); | 452 $constraint->{name}, $rule ); |
| 451 | 453 |
| 452 push @parts, 'ON UPDATE', $rule; | 454 push @parts, 'ON UPDATE', $rule; |
