DBIx::Class::ColumnDefault - Automatically set column default values on insert
version 0.122200
package My::Schema::SomeTable; __PACKAGE__->load_components(qw/ColumnDefault Core/); __PACKAGE__->add_columns( str => { data_type => 'char', default_value => 'aaa', is_nullable => 1, size => 3 }, dt => { date_type => 'datetime', is_nullable => 1, default_value => \"(datetime('now'))", }, );
Automatically set fields with default values from schema definition during insert.
If the default_value is a reference to a scalar and matches one of the following, then the value will be the current datetime
default_value
now() current_timestamp (datetime('now'))
Graham Barr <gbarr@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Graham Barr.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install DBIx::Class::ColumnDefault, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::ColumnDefault
CPAN shell
perl -MCPAN -e shell install DBIx::Class::ColumnDefault
For more information on module installation, please visit the detailed CPAN module installation guide.