DBIx::C...gFromV4(3)

okay bestie, buckle up πŸŽ€ this is the page for DBIx::C...gFromV4(3) from the User Contributed Perl Documentation shelf, and it’s literally the glow-up guide for upgrading from Loader version 0.04006. no cap, every detail is staying.

NAME πŸ’–

DBIx::Class::Schema::Loader::Manual::UpgradingFromV4 β€” Important Information Related to Upgrading from Version 0.04006

What Changed ✨

so here’s the tea β˜• the new Loader is different in some very slay ways:

  • add_column β€” the new Loader detects much more information about columns and sets flags like is_auto_increment that it didn’t set before. lowkey more observant now πŸ‘€
  • RelBuilder β€” the new RelBuilder gives you nicer accessor names for relationships, so you no longer get conflicts between a foreign key column and the relationship accessor itself when the FK is named _id. it also infers relationship type more correctly, bestie: some relationships that were previously detected as a has_many will now be a might_have when it detects a unique constraint on the foreign key column. also cascade_delete and cascade_copy are turned off by default for has_many and might_have relationships, while belongs_to relationships are created with on_delete => 'CASCADE' and on_update => 'CASCADE' by default. this is overridable via relationship_attrs.
  • moniker_map β€” table names are now singularized when determining the Result class names. so the table user_roles would have become UserRoles in 0.04006 but now becomes UserRole instead. singularize it, periodt πŸ’…
  • use_namespaces β€” now defaults to on. see "use_namespaces" in DBIx::Class::Schema::Loader::Base and "load_namespaces" in DBIx::Class::Schema.
  • Support for more databases β€” we now support Microsoft SQL Server and Sybase, and there are also many improvements to the other backends. more databases, more main character energy 🌈

Backward Compatibility πŸ”„

in backward compatibility mode, the Loader will use the old relationship names and types, will not singularize monikers for tables, and use_namespaces will be off.

to control this behavior see "naming" in DBIx::Class::Schema::Loader::Base and "use_namespaces" in DBIx::Class::Schema::Loader::Base.

Static Schemas 🧚

when reading a Schema.pm from a static schema generated with an 0.04 version of Loader, backward compatibility mode will default to on, unless overridden with the naming and/or use_namespaces attributes.

Dynamic Schemas πŸ¦‹

dynamic schemas will always by default use 0.04006 mode and have use_namespaces off.

to upgrade a dynamic schema, set the naming and use_namespaces attributes (which is proxied to the loader) in your Schema.pm:

__PACKAGE__->naming('current');
__PACKAGE__->use_namespaces(1);

AUTHORS 🫢

see "AUTHORS" in DBIx::Class::Schema::Loader.

LICENSE πŸ“œ

this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


mwah πŸ’‹ this iconic little page came from perl v5.42.0, dated 2025-07-25 β€” go upgrade those schemas, bestie 🫢✨

πŸ“¦ where this page comes from