OpusVL::AppKit::RolesFor::Schema::DataInitialisation
version 6
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;
OpusVL::AppKit::RolesFor::Schema::DataInitialisation - 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.
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.
Copyright 2012 OpusVL.
This software is licensed according to the "IP Assignment Schedule" provided with the development project.
Colin Newell <colin@opusvl.com>
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.
To install OpusVL::AppKit::Schema::AppKitAuthDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpusVL::AppKit::Schema::AppKitAuthDB
CPAN shell
perl -MCPAN -e shell install OpusVL::AppKit::Schema::AppKitAuthDB
For more information on module installation, please visit the detailed CPAN module installation guide.