The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

OpusVL::AppKit::RolesFor::Schema::DataInitialisation

VERSION

version 6

DESCRIPTION

This role allows you to extend your DBIx::Class::Schema with a deploy_with_data method that can be used instead of deploy to deploy and populate your database with some initial data. This is typically used to put a basic user into an auth database and setting up any standard system parameters that are required.

    package My::Schema;
    use Moose;
    use namespace::autoclean;
    extends 'DBIx::Class::Schema';
    with 'OpusVL::AppKit::RolesFor::Schema::DataInitialisation';
    __PACKAGE__->load_namespaces;
    __PACKAGE__->meta->make_immutable;
    1;

NAME

OpusVL::AppKit::RolesFor::Schema::DataInitialisation - Deploy with data

METHODS

deploy_with_data

This method does a deploy and then checks your resultsets for initdb methods to call. If they are found they are called. This allows you to populate your newly deployed database with initial data.

clear_dataset

A method to call clear_dataset on all the resultsets that support the method. The idea is to allow a method for clearing a dataset of all transient data while retaining all essential configuration. This will vary by project and so is down to how you implement it.

LICENSE AND COPYRIGHT

Copyright 2012 OpusVL.

This software is licensed according to the "IP Assignment Schedule" provided with the development project.

AUTHOR

Colin Newell <colin@opusvl.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by OpusVL.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.