[Jifty-commit] jifty branch, jifty_client, updated. 57ac70465eb48b6c7410c3baf46840691d1b1228

Jifty commits jifty-commit at lists.jifty.org
Wed May 19 04:29:59 EDT 2010


The branch, jifty_client has been updated
       via  57ac70465eb48b6c7410c3baf46840691d1b1228 (commit)
      from  f685282e91f647f0a86e6ea1e9c4cb6d25b15ab3 (commit)

Summary of changes:
 lib/Jifty/Script/Schema.pm |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 57ac70465eb48b6c7410c3baf46840691d1b1228
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed May 19 17:30:16 2010 +0900

    Better computed-column exclusion

diff --git a/lib/Jifty/Script/Schema.pm b/lib/Jifty/Script/Schema.pm
index 787f423..063b3f6 100755
--- a/lib/Jifty/Script/Schema.pm
+++ b/lib/Jifty/Script/Schema.pm
@@ -592,7 +592,7 @@ sub upgrade_tables {
         } else {
 
             # Go through the currently-active columns
-            for my $col ( grep { not $_->virtual } $model->columns ) {
+            for my $col ( grep { not $_->virtual and not $_->computed } $model->columns ) {
 
                 # If they're new, add them
                 if (    $col->can('since')
@@ -601,17 +601,12 @@ sub upgrade_tables {
                     and $col->since > $dbv )
                 {
                     unshift @{ $UPGRADES{ $col->since } }, sub {
-                        # computed columns do not live in the database
-                        return if $col->computed;
-
                         my $renamed = $upgradeclass->just_renamed || {};
 
                         # skip it if this was added by a rename
-                        return unless
+                        $model->add_column_in_db( $col->name ) unless
                             defined $renamed->{ $model->table }->{'add'}
                             ->{ $col->name };
-
-                        $model->add_column_in_db( $col->name );
                     };
                 }
             }

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list