use_namespaces is now default, still needs the upgrade code
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / Manual / UpgradingFromV4.pod
CommitLineData
9cc8e7e1 1=pod
2
3=head1 NAME
4
5DBIx::Class::Schema::Loader::Manual::UpgradingFromV4 - Important Information
6Related to Upgrading from Version 0.04006
7
8=head1 What Changed
9
10=over 4
11
12=item *
13
14add_column
15
16The new Loader detects much more information about columns and sets flags like
17C<is_auto_increment> that it didn't set before.
18
19=item *
20
21RelBuilder
22
a0e0a56a 23The new RelBuilder will give you nicer accessor names for relationships, so you
24will no longer have conflicts between a foreign key column and the relationship
25accessor itself (if the FK is named C<_id>.)
9cc8e7e1 26
27It will also more correctly infer the relationship type, e.g. some relationships
28that were previously detected as a C<has_many> will now be a C<might_have>
61b33506 29(when it detects a unique constraint on the foreign key column.)
9cc8e7e1 30
31=item *
32
33moniker_map
34
35Table names are now singularized when determining the C<Result> class names. So
36the table C<user_roles> would have become C<UserRoles> in C<0.04006> but now
37becomes C<UserRole> instead.
38
39=item *
40
f22644d7 41use_namespaces
42
43Now defaults to on. See L<DBIx::Class::Schema::Loader::Base/use_namespaces> and
44L<DBIx::Class::Schema/"load_namespaces">.
45
46=item *
47
9cc8e7e1 48Support for more databases
49
f22644d7 50We now support Microsoft SQL Server and Sybase, and there are also many
51improvements to the other backends.
9cc8e7e1 52
53=back
54
55=head1 Backward Compatibility
56
57In backward compatibility mode, the Loader will use the old relationship names
f22644d7 58and types, will not singularize monikers for tables, and C<use_namespaces> will
59be off.
9cc8e7e1 60
f22644d7 61To control this behavior see L<DBIx::Class::Schema::Loader::Base/naming> and
62L<DBIx::Class::Schema::Loader::Base/use_namespaces>.
9cc8e7e1 63
64=head2 Static Schemas
65
66When reading a C<Schema.pm> from a static schema generated with an C<0.04>
61b33506 67version of Loader, backward compatibility mode will default to on, unless
f22644d7 68overridden with the C<naming> and/or C<use_namespaces> attributes.
9cc8e7e1 69
70=head2 Dynamic Schemas
71
f22644d7 72Dynamic schemas will always by default use C<0.04006> mode and have
73C<use_namespaces> off.
9cc8e7e1 74
f22644d7 75To upgrade a dynamic schema, set the C<naming> and C<use_namespaces> attributes
76(which is proxied to the loader) in your C<Schema.pm>:
9cc8e7e1 77
78 __PACKAGE__->naming('current');
f22644d7 79 __PACKAGE__->use_namespaces(1);
9cc8e7e1 80
81=head1 AUTHOR
82
83See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
84
85=head1 LICENSE
86
87This library is free software; you can redistribute it and/or modify it under
88the same terms as Perl itself.
89
90=cut