John Napiorkowski > DBIx-Class-Migration-0.035 > DBIx::Class::Migration::Population

Download:
DBIx-Class-Migration-0.035.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source   Latest Release: DBIx-Class-Migration-0.044

NAME ^

DBIx::Class::Migration::Population - Utility to populate fixture data

SYNOPSIS ^

  use DBIx::Class::Migration::Population;
  use MyApp::Schema;

  $schema = MyApp::Schema->connect(...);
  (my $population = DBIx::Class::Migration::Population->new(
    schema=>$schema))->populate('all_tables');

DESCRIPTION ^

Sometimes you just need to populate data for your scripts, such as during testing and you don't want to expose a full migrations interface and let someone accidently wipe your database with one command. This utility is designed to assist. It is basically a thin wrapper on DBIx::Class::Fixtures that is just aware of DBIx::Class::Migrations conventions.

You create an instance of this similarly to DBIx::Class::Migrations, except you can't pass any arguments related to DBIx::Class::DeploymentHandler since you don't have one :). You can create it from an existing schema, or build it from a schema_class and schema_args, and optional set a target directory (or just let it use the default distribution share directory). Afterwards we expose a populate method that takes a list of fixture set names.

You don't have any control over which version we are trying to populate, we always use the declared schema Version. We assume you have an existing deployed database that matches the current schema.

SEE ALSO ^

DBIx::Class::Migration, DBIx::Class::Manual::Example

AUTHOR ^

See DBIx::Class::Migration for author information

COPYRIGHT & LICENSE ^

See DBIx::Class::Migration for copyright and license information

syntax highlighting: