[Jifty-commit] jifty branch, master, updated. e59e393aa4ed258973b761caf636c8301d77d0ea

Jifty commits jifty-commit at lists.jifty.org
Thu May 20 01:04:37 EDT 2010


The branch, master has been updated
       via  e59e393aa4ed258973b761caf636c8301d77d0ea (commit)
       via  553370e2508c5ff62beffcd47bc0e73062ac7a83 (commit)
       via  7a2e68144d7407da9a1cf35c09952de99fbe6eca (commit)
       via  4b86f726535b3a2e4093ef1dace8616ac26c6d4d (commit)
       via  12b5ca1ac74642ec7aa69a7fe2992878412e1aff (commit)
      from  6c896e63b75ca2510e6320d74c5536bb92596e29 (commit)

Summary of changes:
 Makefile.PL                 |    2 +-
 lib/Jifty/Action/Record.pm  |    2 +-
 lib/Jifty/Manual/Models.pod |    3 ++-
 lib/Jifty/Script/Schema.pm  |    5 ++---
 4 files changed, 6 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 12b5ca1ac74642ec7aa69a7fe2992878412e1aff
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu May 20 14:04:11 2010 +0900

    Depend on Jifty::DBI 0.62

diff --git a/Makefile.PL b/Makefile.PL
index 643b0ca..534d964 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -55,7 +55,7 @@ requires('Hash::MultiValue', 0.05);
 requires('IO::Handle::Util');
 requires('IPC::PubSub' => '0.23' );
 requires('IPC::Run3');
-requires('Jifty::DBI' => '0.60' );            # Jifty::DBI::Collection Jifty::DBI::Handle Jifty::DBI::Record::Cachable Jifty::DBI::SchemaGenerator
+requires('Jifty::DBI' => '0.62' );            # Jifty::DBI::Collection Jifty::DBI::Handle Jifty::DBI::Record::Cachable Jifty::DBI::SchemaGenerator
 requires('JSON' => 2.17);
 requires('List::MoreUtils');
 requires('Locale::Maketext::Extract' => '0.35');

commit 4b86f726535b3a2e4093ef1dace8616ac26c6d4d
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed May 19 17:15:33 2010 +0900

    Do not add computed columns to the database during schema migration

diff --git a/lib/Jifty/Script/Schema.pm b/lib/Jifty/Script/Schema.pm
index ec59c69..787f423 100755
--- a/lib/Jifty/Script/Schema.pm
+++ b/lib/Jifty/Script/Schema.pm
@@ -601,13 +601,17 @@ 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
-                        $model->add_column_in_db( $col->name )
-                            unless
+                        return unless
                             defined $renamed->{ $model->table }->{'add'}
                             ->{ $col->name };
+
+                        $model->add_column_in_db( $col->name );
                     };
                 }
             }

commit 7a2e68144d7407da9a1cf35c09952de99fbe6eca
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed May 19 17:28:06 2010 +0900

    Do not include computed columns in Record actions

diff --git a/lib/Jifty/Action/Record.pm b/lib/Jifty/Action/Record.pm
index a72e2ae..e0cc3ba 100644
--- a/lib/Jifty/Action/Record.pm
+++ b/lib/Jifty/Action/Record.pm
@@ -540,7 +540,7 @@ sub possible_columns {
     my $self = shift;
     return grep {
         $_->container
-            or ( !$_->private and !$_->virtual and $_->type ne "serial" )
+            or ( !$_->private and !$_->virtual and !$_->computed and $_->type ne "serial" )
     } $self->record->columns;
 }
 

commit 553370e2508c5ff62beffcd47bc0e73062ac7a83
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 );
                     };
                 }
             }

commit e59e393aa4ed258973b761caf636c8301d77d0ea
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed May 19 17:31:53 2010 +0900

    minor, add computed to the schema BNF

diff --git a/lib/Jifty/Manual/Models.pod b/lib/Jifty/Manual/Models.pod
index 231b34b..0af4f65 100644
--- a/lib/Jifty/Manual/Models.pod
+++ b/lib/Jifty/Manual/Models.pod
@@ -100,6 +100,7 @@ non-terminals that are self-explanatory to perl-developers):
        | 'not_null'
        | 'distinct'
        | 'virtual'
+       | 'computed'
        | 'sort_order' 'is' number
        | 'input_filters' 'are' string_classname
        | 'output_filters' 'are' string_classname
@@ -111,7 +112,7 @@ non-terminals that are self-explanatory to perl-developers):
 
     * 'is', 'by', 'on', 'as' and 'are' are fill-words that may get omitted.
 
-For a full description of all parameter's meaning, look at
+For a full description of each parameter's meaning, look at
 L<Jifty::DBI::Schema>.
 
 =head3 Versioning

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


More information about the Jifty-commit mailing list