Bug 20772: DBRev 18.06.00.041

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomás Cohen Arazi 2018-10-13 07:47:12 -03:00
parent 64740898aa
commit 3516e9a9f8
6 changed files with 47 additions and 26 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 = "18.06.00.040";
$VERSION = "18.06.00.041";
sub version {
return $VERSION;

View file

@ -97,6 +97,12 @@ __PACKAGE__->table("illrequests");
is_nullable: 1
size: 20
=head2 price_paid
data_type: 'varchar'
is_nullable: 1
size: 20
=head2 notesopac
data_type: 'mediumtext'
@ -156,6 +162,8 @@ __PACKAGE__->add_columns(
{ data_type => "varchar", is_nullable => 1, size => 500 },
"cost",
{ data_type => "varchar", is_nullable => 1, size => 20 },
"price_paid",
{ data_type => "varchar", is_nullable => 1, size => 20 },
"notesopac",
{ data_type => "mediumtext", is_nullable => 1 },
"notesstaff",
@ -231,8 +239,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rh8DSs3xj3KRmyd7WNGDAg
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-01 02:46:41
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MMKr4JAAAsNnFcQn9SPTcw
# You can replace this text with custom code or comments, and it will be preserved on regeneration

View file

@ -41,6 +41,12 @@ __PACKAGE__->table("illrequestattributes");
data_type: 'mediumtext'
is_nullable: 0
=head2 readonly
data_type: 'tinyint'
default_value: 1
is_nullable: 0
=cut
__PACKAGE__->add_columns(
@ -55,6 +61,8 @@ __PACKAGE__->add_columns(
{ data_type => "varchar", is_nullable => 0, size => 200 },
"value",
{ data_type => "mediumtext", is_nullable => 0 },
"readonly",
{ data_type => "tinyint", default_value => 1, is_nullable => 0 },
);
=head1 PRIMARY KEY
@ -89,8 +97,8 @@ __PACKAGE__->belongs_to(
);
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:X9SxZP1PGXTwDJ6lUkx8Fg
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2018-05-17 09:17:53
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sFY1giVMz5AkXCPidhyGjw
# You can replace this text with custom code or comments, and it will be preserved on regeneration

View file

@ -1,10 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
if( !column_exists( 'illrequests', 'price_paid' ) ) {
$dbh->do( "ALTER TABLE illrequests ADD COLUMN price_paid varchar(20) DEFAULT NULL AFTER 'cost'" );
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 20772 - Add illrequest.price_paid column)\n";
}

View file

@ -1,11 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
if( !column_exists( 'illrequestattributes', 'readonly' ) ) {
$dbh->do( "ALTER TABLE illrequestattributes ADD COLUMN readonly tinyint(1) NOT NULL DEFAULT 1 AFTER 'value'" );
$dbh->do( "UPDATE illrequestattributes SET readonly = 1" );
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 20772 - Add illrequestattributes.readonly column)\n";
}

View file

@ -16644,6 +16644,32 @@ if( CheckVersion( $DBversion ) ) {
SetVersion( $DBversion );
}
$DBversion = '18.06.00.041';
if( CheckVersion( $DBversion ) ) {
if( !column_exists( 'illrequests', 'price_paid' ) ) {
$dbh->do(q{
ALTER TABLE illrequests
ADD COLUMN price_paid varchar(20) DEFAULT NULL
AFTER cost
});
}
if( !column_exists( 'illrequestattributes', 'readonly' ) ) {
$dbh->do(q{
ALTER TABLE illrequestattributes
ADD COLUMN readonly tinyint(1) NOT NULL DEFAULT 1
AFTER value
});
$dbh->do(q{
UPDATE illrequestattributes SET readonly = 1
});
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 20772 - Add illrequestattributes.readonly and illrequest.price_paid columns)\n";
}
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.