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::TRAIT::DUMP (3)

.ds Aq ’

NAME

DBIx::Class::Migration::RunScript::Trait::Dump - Dump fixtures

CONTENTS

SYNOPSIS



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

    builder {
      SchemaLoader,
      Dump,
      sub {
        shift->dump(countries);
      };
    };



DESCRIPTION

This is a Moose::Role that adds a dump method to your run script. This will let you dump fixtures from your runscripts, based on previously defined fixture configurations.

This might be useful to you if you are building fixtures if they don’t already exist (see DBIx::Class::Migration::RunScript::Trait::Populate) and then want to dump them as part of building up your database. For example:



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

    migrate {
      my $self = shift;
      if($self->set_has_fixtures(all_tables)) {
        $self->populate(all_tables);
      } else {
        $self->schema
          ->resultset(Country)
          ->populate([
            [code],
            [bel],
            [deu],
            [fra],
          ]);

        $self->dump(all_tables);
      }
    };



In the above example if the fixture set exists and has previously been dumped we will populate the database with it. Else, we will create some data manually and then dump it so that next time it is available.

This trait requires a schema previously defined, such as provided by DBIx::Class::Migration::RunScript::Trait::SchemaLoader.

This trait is one of the defaults for the exported method migrate in DBIx::Class::Migration::RunScript.

methods

This class defines the follow methods.

    dump

Requires $arg || @args

Given a fixture set (or list of sets), use DBIx::Class::Fixtures to dump them from the current database.

When naming sets, you skip the ’.json’ extension.

SEE ALSO

DBIx::Class::Migration, DBIx::Class::Migration::RunScript

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::TRAIT::DUMP (3) 2015-03-24

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