Changes

Jump to navigation Jump to search
Line 220: Line 220:  
* Migrate fragments must be safe to run multiple times. They should migrate the value when required and do nothing in other cases.
 
* Migrate fragments must be safe to run multiple times. They should migrate the value when required and do nothing in other cases.
 
* Migrate fragments should never call croak or die. This will cause the database migration to stop. If an error is detected, call carp or warn to note the error in the logs.
 
* Migrate fragments should never call croak or die. This will cause the database migration to stop. If an error is detected, call carp or warn to note the error in the logs.
 +
* Migrate fragments should call good termination with return(0) rather than exit(0).
 
* Migrate fragments should be owned by the package requiring the migration so that the migration only occurs when that package is installed.
 
* Migrate fragments should be owned by the package requiring the migration so that the migration only occurs when that package is installed.
 
* Migrate fragments should be self-contained and ideally perform only one migration per fragment.
 
* Migrate fragments should be self-contained and ideally perform only one migration per fragment.
* It is also possible to initialize and migrate database values in action scripts, but creation of migrate fragments is <span class="emphasis">''strongly''</span> preferred. Creating defaults is a simple matter of creating text files and migrate fragments require far less code than action scripts.
+
* It is also possible to initialize and migrate database values in action scripts, but creation of migrate fragments is '''strongly''' preferred. Creating defaults is a simple matter of creating text files and migrate fragments require far less code than action scripts.
    
</div><div class="SECT3">
 
</div><div class="SECT3">

Navigation menu