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
DBIx::Class::Migration::Population(3) User Contributed Perl Documentation DBIx::Class::Migration::Population(3)

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

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

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

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::Migration conventions.

You create an instance of this similarly to DBIx::Class::Migration, 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.

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

See DBIx::Class::Migration for author information

See DBIx::Class::Migration for copyright and license information
2020-06-02 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.