Mercurial > pub > Impl
comparison Lib/IMPL/SQL/Schema/Traits/Diff.pm @ 169:fd92830036c3
corrected IMPL::SQL::Schema::Diff
author | sourcer |
---|---|
date | Tue, 17 May 2011 00:04:28 +0400 |
parents | 6148f89bb7bf |
children | d1676be8afcc |
comparison
equal
deleted
inserted
replaced
168:6148f89bb7bf | 169:fd92830036c3 |
---|---|
63 new IMPL::SQL::Schema::Traits::AlterTableDropConstraint( $src->name, $cnSrcName ); | 63 new IMPL::SQL::Schema::Traits::AlterTableDropConstraint( $src->name, $cnSrcName ); |
64 push @createConstraints, | 64 push @createConstraints, |
65 new IMPL::SQL::Schema::Traits::AlterTableAddConstraint( $dst->name, _Constraint2Traits($cnDst) ); | 65 new IMPL::SQL::Schema::Traits::AlterTableAddConstraint( $dst->name, _Constraint2Traits($cnDst) ); |
66 } | 66 } |
67 } else { | 67 } else { |
68 push @dropConstraints,new IMPL::SQL::Schema::Traits::AlterTableDropConstrait( $src->name, $cnSrcName ); | 68 push @dropConstraints,new IMPL::SQL::Schema::Traits::AlterTableDropConstraint( $src->name, $cnSrcName ); |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 foreach my $cnDst (values %dstConstraints) { | 72 foreach my $cnDst (values %dstConstraints) { |
73 push @createConstraints, | 73 push @createConstraints, |
117 | 117 |
118 $op->position( $info->{index} ) unless $info->{prevIndex} == $info->{index}; | 118 $op->position( $info->{index} ) unless $info->{prevIndex} == $info->{index}; |
119 $op->isNullable( $info->{column}->isNullable ) unless equals($info->{column}->isNullable,$info->{prevColumn}->isNullable); | 119 $op->isNullable( $info->{column}->isNullable ) unless equals($info->{column}->isNullable,$info->{prevColumn}->isNullable); |
120 $op->defaultValue( $info->{column}->defaultValue ) unless equals($info->{column}->defaultValue, $info->{prevColumn}->defaultValue); | 120 $op->defaultValue( $info->{column}->defaultValue ) unless equals($info->{column}->defaultValue, $info->{prevColumn}->defaultValue); |
121 | 121 |
122 my %diff = hashDiff($info->{prevColumn},$info->{column}); | 122 my $diff = hashDiff($info->{prevColumn}->tag,$info->{column}->tag); |
123 $op->options(\%diff) if %diff; | 123 $op->options($diff) if %$diff; |
124 | 124 |
125 push @updateColumns, $op; | 125 push @updateColumns, $op; |
126 } | 126 } |
127 } | 127 } |
128 | 128 |