NAME
DBIx::Class::Schema::Loader::Manual::UpgradingFromV4 - Important Information Related to Upgrading from Version 0.04006
What Changed
add_column
The new Loader detects much more information about columns and sets flags like
is_auto_incrementthat it didn't set before.RelBuilder
The new RelBuilder will give you nicer accessor names for relationships, so you will no longer have conflicts between a foreign key column and the relationship accessor itself (if the FK is named
_id.)It will also more correctly infer the relationship type, e.g. some relationships that were previously detected as a
has_manywill now be amight_have(when it detects a unique constraint on the foreign key column.)Also
cascade_deleteandcascade_copyare turned off for by default forhas_manyandmight_haverelationships, whilebelongs_torelationships are created withon_delete => 'CASCADE'andon_update => 'CASCADE'by default. This is overridable via relationship_attrs.moniker_map
Table names are now singularized when determining the
Resultclass names. So the tableuser_roleswould have becomeUserRolesin0.04006but now becomesUserRoleinstead.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.
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.