DBIx::C...unScript(3)
π NAME π
okay bestie, welcome to DBIx::C...unScript(3) from User Contributed Perl Documentation β¨ this page is for DBIx::Class::Migration::RunScript β literally the thing that helps you Control your Perl Migration Run Scripts. π¦
β¨ SYNOPSIS β¨
two ways to do the thing, queen: use the builder exported subroutine, or use the migrate exported subroutine for standard and external plugins. both are iconic, just different vibes π
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 you're using Perl based run files for your migrations, this class is your little manager bestie: it lets you manage that and offers a clean method to add in functionality. no cap, it's giving organized. β¨
for an extended discussion, see DBIx::Class::Migration::Tutorial β go read it, iykyk π
π ATTRIBUTES π
this class defines the follow attributes:
π version_set
an arrayref of the from / to version you're attempting to migrate. it's literally the before-and-after of your migration journey π¦
π₯ dbh</peak>
the current database handle to the database you're trying to migrate. that's your connection, bestie β main character energy fr fr π
π EXPORTS π
this class defines the following exports:
π builder
lets you construct a migration script from a subroutine and also lets you specify plugins. obsessed. πβ¨
π 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 (it's external because it carries a dependency weight the author doesn'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 β note the vibe: not exported, bestie π«Ά
π default_plugins
returns an array of the default plugins. that's it, that's the subroutine. π
π SEE ALSO π
DBIx::Class::Migration β go read it, bestie π
π AUTHOR π
see DBIx::Class::Migration for author information π
πΈ COPYRIGHT & LICENSE πΈ
see DBIx::Class::Migration for copyright and license information π
okay that's the whole page, bestie! source/version: perl v5.42.0; date: 2020-06-03; manual: DBIx::C...unScript(3). bye bestie, go migrate something cute! π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-DBIx-Class-Migration 0.075-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms