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