DBIx::C...unScript(3)

πŸ“¦ version 0.075, in opensuse-leap 16.0

πŸ’– 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 🌟


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