Movatterモバイル変換


[0]ホーム

URL:


 / 
Jifty-1.50430
River stage two • 33 direct dependents • 33 total dependents
/Jifty::Upgrade

NAME

Jifty::Upgrade - Superclass for schema/data upgrades to Jifty applications

SYNOPSIS

package MyApp::Upgrade;use base qw/ Jifty::Upgrade /;use Jifty::Upgrade qw/ since rename /;since '0.7.4' => sub {    # Rename a column    rename table => 'cthulus', name => 'description',                                  to => 'mind_numbingly_horrible_word_picture';};since '0.6.1' => sub {    my @sizes       = ('Huge', 'Gigantic', 'Monstrous', 'Really Big');    my @appearances = ('Horrible', 'Disgusting', 'Frightening', 'Evil');        # populate new columns with some random stuff    my $cthulus = MyApp::Model::CthuluCollection->new;    while (my $cthulu = $cthulus->next) {        $cthulu->set_size($sizes[ int(rand(@sizes)) ]);        $cthulu->set_appearance($appearances[ int(rand(@appearances)) ]);    }};

DESCRIPTION

Jifty::Upgrade is an abstract base class to use to customize schema and data upgrades that happen.

sinceVERSIONSUB

since is meant to be called by subclasses ofJifty::Upgrade. Calling it signifies thatSUB should be run when upgrading to versionVERSION, after tables and columns are added, but before tables and columns are removed. If multiple subroutines are given for the same version, they are run in order that they were set up.

versions

Returns the list of versions that have been registered; this is called by theJifty::Script::Schema tool to determine what to do while upgrading.

upgrade_toVERSION

Runs the subroutine that has been registered for the given version; if no subroutine was registered, returns a no-op subroutine.

rename table => CLASS, [column => COLUMN,] to => NAME

Used in upgrade subroutines, this executes the necessary SQL to rename the table, or column in the table, to a new name.

SEE ALSO

Jifty::Manual::Upgrading

Module Install Instructions

To install Jifty, copy and paste the appropriate command in to your terminal.

cpanm

cpanm Jifty

CPAN shell

perl -MCPAN -e shellinstall Jifty

For more information on module installation, please visitthe detailed CPAN module installation guide.

Keyboard Shortcuts

Global
sFocus search bar
?Bring up this help dialog
GitHub
gpGo to pull requests
gigo to github issues (only if github is preferred repository)
POD
gaGo to author
gcGo to changes
giGo to issues
gdGo to dist
grGo to repository/SCM
gsGo to source
gbGo to file browse
Search terms
module: (e.g.module:Plugin)
distribution: (e.g.distribution:Dancer auth)
author: (e.g.author:SONGMU Redis)
version: (e.g.version:1.00)

[8]ページ先頭

©2009-2025 Movatter.jp