DBIx::C...eatures(3)
π NAME π
DBIx::Class::Migration::Features(3) β yes bestie, this is the user-contributed Perl documentation page for the features of DBIx::Class::Migration. It's giving developer value and whole-ecosystem energy, and we're gonna walk through it together. π
π DESCRIPTION π
This doc is basically a summary of the features and developer value of DBIx::Class::Migration and its associated ecosystem. That's the whole assignment. Periodt. β¨
π οΈ Standard Workflows π οΈ
Okay so standard workflows for creating database versions, updates, and downgrades between versions are all here. Management of seed data? Yup. Testing and development fixtures? Also yup. π«Ά
You can start prototyping with an easy Sqlite database and move up to Mysql or Postgresql with a single switch. No cap. π¦
πΎ Database Installation πΎ
Picture this: your app's database has evolved over many versions. You can install a database to any version in the history, and you can also install development and fixture data for that version. Iconic. π
dbic-migration install
dbic-migration install --to_version 5
dbic-migration populate --fixture_set testing_data
π Upgrade / Downgrade Management π
There's a system to move a database from any one version to any other version. It also lets you migrate data between versions, and it even offers the possibility to migrate between different types of databases. The range! π
dbic-migration prepare
dbic-migration upgrade
dbic-migration downgrade
π± Seed, Developer and Test Data π±
Create and manage data in your database. Make sets for testing, development, and for managing system or 'seed' data β y'know, the data a database needs to properly function, like a Country list. π
dbic-migration dump_named_sets -fixture_set countries
Data can be properly converted between database versions. Slay. β¨
π§ͺ Testing π§ͺ
It integrates with testing tools like Test::DBIx::Class, so testing your database logic is simple. And the test code is right here, looking all cute and correct:
#!/usr/bin/env perl
use Test::Most;
use Test::DBIx::Class
-schema_class=>'MyApp::Schema',
-fixture_class => '::Population',
qw(Artist Country);
fixtures_ok ['all_tables'];
is Country->count, 3, 'Correct Number of Countries';
ok Artist->first->has_country, 'Artist has a country';
done_testing;
ποΈ Easy Creation of Developer level Database sandboxes ποΈ
It automatically creates a developer controlled, local database for rapid prototyping and easy administration. Sandboxes support Sqlite, MySQL and Postgresql. Very main character. πΈ
π§© Framework Integration π§©
Plays nice with popular web app dev frameworks like Catalyst. Look at this integration:
package MyApp::Web::Model::Schema;
use Moose;
extends 'Catalyst::Model::DBIC::Schema';
__PACKAGE__->meta->make_immutable;
__PACKAGE__->config(
traits => ['FromMigration'],
schema_class => 'MyApp::Schema',
extra_migration_args => {
db_sandbox_class => 'DBIx::Class::Migration::MySQLSandbox'},
install_if_needed => {
on_install => sub {
my ($schema, $migration) = @_;
$migration->populate('all_tables')}},
);
π§ Straightforward subclassing π§
Core code is designed to be easily subclassed for local customizations. But plot twist: subclassing is often unneeded for some customizations, since you can control and configure many aspects of the code using init arguments. Lowkey flexible. π
π Tutorial and Documentation π
It's extensively documented and ships with an end-to-end tutorial covering everything from creating your first migration, through testing, and integration with Catalyst. Obsessed. π
DBIx::Class::Migration::Tutorial
π SEE ALSO π
DBIx::Class::MigrationDBIx::Class::Migration::Tutorial
βοΈ AUTHOR βοΈ
Author info lives in DBIx::Class::Migration.
Β©οΈ COPYRIGHT & LICENSE Β©οΈ
Copyright and license info also lives in DBIx::Class::Migration.
And that's the tea, bestie: this page is the user-contributed Perl doc for DBIx::C...eatures(3), shipped with perl v5.42.0 and dated 2020-06-03. Mwah πβ¨
π¦ 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