Bugzilla – Attachment 42504 Details for
Bug 11390
DBIx::Class schema deployment script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Latest work
Latest-work.patch (text/plain), 3.01 KB, created by
David Cook
on 2015-09-14 00:07:54 UTC
(
hide
)
Description:
Latest work
Filename:
MIME Type:
Creator:
David Cook
Created:
2015-09-14 00:07:54 UTC
Size:
3.01 KB
patch
obsolete
>From b185750f0e2cb96cfbdd851cf061e846ef288899 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 1 Dec 2014 10:45:07 +1100 >Subject: [PATCH] Latest work > >http://bugs.koha-community.org/show_bug.cgi?id=11390 >--- > Koha/Schema/Result/Accountline.pm | 3 +++ > installer/dbic_controller.pl | 1 - > misc/devel/update_dbix_class_files.pl | 28 +++++++++++++++++++++++++--- > 3 files changed, 28 insertions(+), 4 deletions(-) > mode change 100644 => 100755 Koha/Schema/Result/Accountline.pm > >diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm >old mode 100644 >new mode 100755 >index e83ef40..7011204 >--- a/Koha/Schema/Result/Accountline.pm >+++ b/Koha/Schema/Result/Accountline.pm >@@ -153,6 +153,9 @@ __PACKAGE__->add_columns( > datetime_undef_if_invalid => 1, > default_value => \"current_timestamp", > is_nullable => 0, >+ extra => { >+ "on update" => \"current_timestamp", >+ }, > }, > "notify_id", > { data_type => "integer", default_value => 0, is_nullable => 0 }, >diff --git a/installer/dbic_controller.pl b/installer/dbic_controller.pl >index d74dc70..9bd62c6 100644 >--- a/installer/dbic_controller.pl >+++ b/installer/dbic_controller.pl >@@ -5,7 +5,6 @@ use Data::Dumper; > my $schema = Koha::Database->new()->schema(); > > >- > $schema->deploy({quote_identifiers => 1, producer_args => {mysql_version => '5.5.33'}, }); > #my $statements = $schema->deployment_statements(undef,'2.0',undef,{quote_identifiers => 1, producer_args => {mysql_version => '5.5.33'},}); > #print Dumper($statements); >diff --git a/misc/devel/update_dbix_class_files.pl b/misc/devel/update_dbix_class_files.pl >index a291cef..b3fbf12 100755 >--- a/misc/devel/update_dbix_class_files.pl >+++ b/misc/devel/update_dbix_class_files.pl >@@ -24,6 +24,7 @@ use DBIx::Class::Schema::Loader qw/ make_schema_at /; > > use Getopt::Long; > use Pod::Usage; >+use Data::Dumper; > > my $path = "./"; > my $db_driver = 'mysql'; >@@ -53,11 +54,32 @@ if (! defined $db_name ) { > pod2usage(1); > } else { > >- make_schema_at( >+my $test = make_schema_at( > "Koha::Schema", >- { debug => 1, dump_directory => $path, preserve_case => 1 }, >+ { debug => 1, dump_directory => $path, preserve_case => 1, >+ skip_load_external => 1, >+ custom_column_info => sub { >+ my ($table, $column_name, $column_info) = @_; >+ >+ if ($table eq 'accountlines' && $column_name eq 'timestamp'){ >+ return { extra => { "on update" => \"CURRENT_TIMESTAMP" } }; >+ } >+ }, >+ >+ >+ filter_generated_code => sub { >+ my ($type, $class, $text) = @_; >+ $text =~ s/(\\"current_timestamp"|\scurrent_timestamp\s)/\U$1\E/g; >+ $text =~ s/"double precision"/"double"/g; >+ return $text; >+ } >+ >+ >+ }, > ["DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",$db_user, $db_passwd ] > ); >+ >+ > } > > 1; >@@ -111,4 +133,4 @@ path into which create the schema files. (defaults to './') > > prints this help text > >-=back >\ No newline at end of file >+=back >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11390
:
42503
| 42504