GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Jifty::Upgrade(3) User Contributed Perl Documentation Jifty::Upgrade(3)

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

  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)) ]);
      }
  };

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

"since" is meant to be called by subclasses of "Jifty::Upgrade". Calling it signifies that SUB should be run when upgrading to version VERSION, 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.

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

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

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

Jifty::Manual::Upgrading
2013-01-29 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.