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


Manual Reference Pages  -  DBIX::CLASS::MIGRATION::RUNSCRIPT (3)

.ds Aq ’

NAME

DBIx::Class::Migration::RunScript - Control your Perl Migration Run Scripts

CONTENTS

SYNOPSIS

Using the builder exported subroutine:



    use DBIx::Class::Migration::RunScript;

    builder {
      SchemaLoader,
      sub {
        shift->schema->resultset(Country)
          ->populate([
          [code],
          [bel],
          [deu],
          [fra],
        ]);
      };
    };



Alternatively, use the migrate exported subroutine for standard and external plugins:



    use DBIx::Class::Migration::RunScript;
    use DBIx::Class::Migration::RunScript::Trait::AuthenPassphrase;

    migrate {
      shift->schema
        ->resultset(Country)
        ->populate([
          [code],
          [bel],
          [deu],
          [fra],
        ]);
    };



DESCRIPTION

When using Perl based run files for your migrations, this class lets you manage that and offers a clean method to add in functionality.

See DBIx::Class::Migration::Tutorial for an extended discussion.

ATTRIBUTES

This class defines the follow attributes

    version_set

An arrayref of the from / to version you are attempting to migrate.

    dbh

The current database handle to the database you are trying to migrate.

EXPORTS

This class defines the following exports

    builder

Allows you to construct a migration script from a subroutine and also lets you specify plugins.

    migrate

Run a migration subref with default plugins (SchemaLoader, Populate, TargetDir Dump) and any additional plugins that you’ve used. For example:



    use DBIx::Class::Migration::RunScript;

    migrate {
      my $runscript = shift;
    }



In this case $runscript is an instance of DBIx::Class::Migration::RunScript and has the default traits applied (see DBIx::Class::Migration::RunScript::Trait::TargetPath, DBIx::Class::Migration::RunScript::Trait::Schema, DBIx::Class::Migration::RunScript::Trait::Populate, DBIx::Class::Migration::RunScript::Trait::Dump for more).

Second example:



    use DBIx::Class::Migration::RunScript;
    use DBIx::Class::Migration::RunScript::Trait::AuthenPassphrase;

    migrate {
      my $runscript = shift;
    }



In this case $runscript is an instance of DBIx::Class::Migration::RunScript with traits applied as above and in addition one more trait, DBIx::Class::Migration::RunScript::Trait::AuthenPassphrase which is available on CPAN (is external because it carries a dependency weight I don’t want to impose on people if they don’t need it).

UTILITY SUBROUTINES

The follow subroutines are available as package method, and not exported

    default_plugins

returns an array of the default plugins.

SEE ALSO

DBIx::Class::Migration.

AUTHOR

See DBIx::Class::Migration for author information

COPYRIGHT & LICENSE

See DBIx::Class::Migration for copyright and license information
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DBIX::CLASS::MIGRATION::RUNSCRIPT (3) 2015-03-24

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