Bug 10459: Update DB rev (3.22.08.001)

This commit is contained in:
Julian Maurice 2016-07-01 08:19:50 +02:00
parent 341343a860
commit 64d2995789
5 changed files with 51 additions and 13 deletions

View File

@ -29,7 +29,7 @@ use vars qw{ $VERSION };
# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
$VERSION = "3.22.08.000";
$VERSION = "3.22.08.001";
sub version {
return $VERSION;

View File

@ -395,6 +395,13 @@ __PACKAGE__->table("borrowers");
default_value: 1
is_nullable: 0
=head2 updated_on
data_type: 'timestamp'
datetime_undef_if_invalid: 1
default_value: current_timestamp
is_nullable: 1
=cut
__PACKAGE__->add_columns(
@ -560,6 +567,13 @@ __PACKAGE__->add_columns(
{ data_type => "varchar", is_nullable => 1, size => 50 },
"privacy",
{ data_type => "integer", default_value => 1, is_nullable => 0 },
"updated_on",
{
data_type => "timestamp",
datetime_undef_if_invalid => 1,
default_value => \"current_timestamp",
is_nullable => 1,
},
);
=head1 PRIMARY KEY
@ -1153,8 +1167,8 @@ Composing rels: L</aqorder_users> -> ordernumber
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-21 19:50:05
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QafovaRBnm36nyoyQTGIgQ
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-07-01 08:14:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MhjMGmwPebVT85zsQtgKmg
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -393,6 +393,13 @@ __PACKAGE__->table("deletedborrowers");
default_value: 1
is_nullable: 0
=head2 updated_on
data_type: 'timestamp'
datetime_undef_if_invalid: 1
default_value: current_timestamp
is_nullable: 1
=cut
__PACKAGE__->add_columns(
@ -546,11 +553,18 @@ __PACKAGE__->add_columns(
{ data_type => "varchar", is_nullable => 1, size => 50 },
"privacy",
{ data_type => "integer", default_value => 1, is_nullable => 0 },
"updated_on",
{
data_type => "timestamp",
datetime_undef_if_invalid => 1,
default_value => \"current_timestamp",
is_nullable => 1,
},
);
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-02-26 14:46:00
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EDI8cewAT21LU7zuKc6LqA
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-07-01 08:14:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XFvL47Af2HNisQA37/DIcA
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -1,8 +0,0 @@
ALTER TABLE borrowers
ADD COLUMN updated_on timestamp NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP
AFTER privacy;
ALTER TABLE deletedborrowers
ADD COLUMN updated_on timestamp NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP
AFTER privacy;

View File

@ -11649,6 +11649,24 @@ if ( CheckVersion($DBversion) ) {
SetVersion($DBversion);
}
$DBversion = "3.22.08.001";
if ( CheckVersion($DBversion) ) {
$dbh->do(q{
ALTER TABLE borrowers
ADD COLUMN updated_on timestamp NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP
AFTER privacy;
});
$dbh->do(q{
ALTER TABLE deletedborrowers
ADD COLUMN updated_on timestamp NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP
AFTER privacy;
});
print "Upgrade to $DBversion done (Bug 10459 - borrowers should have a timestamp)\n";
SetVersion($DBversion);
}
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
# SEE bug 13068