Browse Source

Bug 9021: DBrev 3.23.000.020

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
new_12478_elasticsearch
Kyle Hall 8 years ago
parent
commit
326b4c046e
  1. 8
      Koha/Schema/Result/Borrower.pm
  2. 11
      Koha/Schema/Result/Deletedborrower.pm
  3. 14
      installer/data/mysql/atomicupdate/bug_9021.sql
  4. 30
      installer/data/mysql/updatedatabase.pl

8
Koha/Schema/Result/Borrower.pm

@ -1053,8 +1053,8 @@ __PACKAGE__->belongs_to(
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "RESTRICT",
on_update => "RESTRICT",
on_delete => "SET NULL",
on_update => "CASCADE",
},
);
@ -1204,8 +1204,8 @@ Composing rels: L</aqorder_users> -> ordernumber
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-12-31 16:48:38
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dd1tdtsFTruFwsmCZU6ogQ
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-02-14 12:46:14
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bI6qJYw+ulTUwA7XMCkkRw
__PACKAGE__->belongs_to(
"guarantor",

11
Koha/Schema/Result/Deletedborrower.pm

@ -387,6 +387,11 @@ __PACKAGE__->table("deletedborrowers");
is_nullable: 1
size: 50
=head2 sms_provider_id
data_type: 'integer'
is_nullable: 1
=head2 privacy
data_type: 'integer'
@ -550,6 +555,8 @@ __PACKAGE__->add_columns(
{ data_type => "varchar", is_nullable => 1, size => 50 },
"smsalertnumber",
{ data_type => "varchar", is_nullable => 1, size => 50 },
"sms_provider_id",
{ data_type => "integer", is_nullable => 1 },
"privacy",
{ data_type => "integer", default_value => 1, is_nullable => 0 },
"privacy_guarantor_checkouts",
@ -557,8 +564,8 @@ __PACKAGE__->add_columns(
);
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-01-06 12:00:28
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aNmdXpOz+XN5abM67sl8uA
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-02-14 12:46:14
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UvGAnZ1qOwgtmLpbG8ukow
# You can replace this text with custom code or comments, and it will be preserved on regeneration

14
installer/data/mysql/atomicupdate/bug_9021.sql

@ -1,14 +0,0 @@
CREATE TABLE sms_providers (
id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
name VARCHAR( 255 ) NOT NULL ,
domain VARCHAR( 255 ) NOT NULL ,
UNIQUE (
name
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE borrowers ADD sms_provider_id INT( 11 ) NULL DEFAULT NULL AFTER smsalertnumber;
ALTER TABLE borrowers ADD FOREIGN KEY ( sms_provider_id ) REFERENCES sms_providers ( id ) ON UPDATE CASCADE ON DELETE SET NULL;
ALTER TABLE deletedborrowers ADD sms_provider_id INT( 11 ) NULL DEFAULT NULL AFTER smsalertnumber;
ALTER TABLE deletedborrowers ADD FOREIGN KEY ( sms_provider_id ) REFERENCES sms_providers ( id ) ON UPDATE CASCADE ON DELETE SET NULL;

30
installer/data/mysql/updatedatabase.pl

@ -11733,6 +11733,36 @@ if ( CheckVersion($DBversion) ) {
SetVersion($DBversion);
}
$DBversion = "3.23.00.020";
if ( CheckVersion($DBversion) ) {
$dbh->do(q{
CREATE TABLE sms_providers (
id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
name VARCHAR( 255 ) NOT NULL ,
domain VARCHAR( 255 ) NOT NULL ,
UNIQUE (
name
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
});
$dbh->do(q{
ALTER TABLE borrowers ADD sms_provider_id INT( 11 ) NULL DEFAULT NULL AFTER smsalertnumber;
});
$dbh->do(q{
ALTER TABLE borrowers ADD FOREIGN KEY ( sms_provider_id ) REFERENCES sms_providers ( id ) ON UPDATE CASCADE ON DELETE SET NULL;
});
$dbh->do(q{
ALTER TABLE deletedborrowers ADD sms_provider_id INT( 11 ) NULL DEFAULT NULL AFTER smsalertnumber;
});
$dbh->do(q{
ALTER TABLE deletedborrowers ADD FOREIGN KEY ( sms_provider_id ) REFERENCES sms_providers ( id ) ON UPDATE CASCADE ON DELETE SET NULL;
});
print "Upgrade to $DBversion done (Bug 9021 - Add SMS via email as an alternative to SMS services via SMS::Send drivers)\n";
SetVersion($DBversion);
}
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.

Loading…
Cancel
Save