From 47f4a6f2bfe370aa08f27c5160cfb563abbf90ff Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Feb 2018 14:28:31 -0300 Subject: [PATCH] Bug 20144: [sql_modes] Fix borrowers table structure surname, address and city can be NULL Signed-off-by: Josef Moravec Signed-off-by: Julian Maurice --- .../mysql/atomicupdate/bug_20144_update_borrowers_table.sql | 2 ++ installer/data/mysql/kohastructure.sql | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_20144_update_borrowers_table.sql diff --git a/installer/data/mysql/atomicupdate/bug_20144_update_borrowers_table.sql b/installer/data/mysql/atomicupdate/bug_20144_update_borrowers_table.sql new file mode 100644 index 0000000000..f1d5c46fc5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20144_update_borrowers_table.sql @@ -0,0 +1,2 @@ +ALTER TABLE borrowers MODIFY surname MEDIUMTEXT, MODIFY address MEDIUMTEXT, MODIFY city MEDIUMTEXT; +ALTER TABLE deletedborrowers MODIFY surname MEDIUMTEXT, MODIFY address MEDIUMTEXT, MODIFY city MEDIUMTEXT; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 36b8120139..f8fcf04c91 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -569,16 +569,16 @@ DROP TABLE IF EXISTS `deletedborrowers`; CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrowers you have deleted `borrowernumber` int(11) NOT NULL default 0, -- primary key, Koha assigned ID number for patrons/borrowers `cardnumber` varchar(32) default NULL, -- unique key, library assigned ID number for patrons/borrowers - `surname` mediumtext NOT NULL, -- patron/borrower's last name (surname) + `surname` mediumtext, -- patron/borrower's last name (surname) `firstname` text, -- patron/borrower's first name `title` mediumtext, -- patron/borrower's title, for example: Mr. or Mrs. `othernames` mediumtext, -- any other names associated with the patron/borrower `initials` text, -- initials for your patron/borrower `streetnumber` varchar(10) default NULL, -- the house number for your patron/borrower's primary address `streettype` varchar(50) default NULL, -- the street type (Rd., Blvd, etc) for your patron/borrower's primary address - `address` mediumtext NOT NULL, -- the first address line for your patron/borrower's primary address + `address` mediumtext, -- the first address line for your patron/borrower's primary address `address2` text, -- the second address line for your patron/borrower's primary address - `city` mediumtext NOT NULL, -- the city or town for your patron/borrower's primary address + `city` mediumtext, -- the city or town for your patron/borrower's primary address `state` text default NULL, -- the state or province for your patron/borrower's primary address `zipcode` varchar(25) default NULL, -- the zip or postal code for your patron/borrower's primary address `country` text, -- the country for your patron/borrower's primary address @@ -1594,16 +1594,16 @@ DROP TABLE IF EXISTS `borrowers`; CREATE TABLE `borrowers` ( -- this table includes information about your patrons/borrowers/members `borrowernumber` int(11) NOT NULL auto_increment, -- primary key, Koha assigned ID number for patrons/borrowers `cardnumber` varchar(32) default NULL, -- unique key, library assigned ID number for patrons/borrowers - `surname` mediumtext NOT NULL, -- patron/borrower's last name (surname) + `surname` mediumtext, -- patron/borrower's last name (surname) `firstname` text, -- patron/borrower's first name `title` mediumtext, -- patron/borrower's title, for example: Mr. or Mrs. `othernames` mediumtext, -- any other names associated with the patron/borrower `initials` text, -- initials for your patron/borrower `streetnumber` varchar(10) default NULL, -- the house number for your patron/borrower's primary address `streettype` varchar(50) default NULL, -- the street type (Rd., Blvd, etc) for your patron/borrower's primary address - `address` mediumtext NOT NULL, -- the first address line for your patron/borrower's primary address + `address` mediumtext, -- the first address line for your patron/borrower's primary address `address2` text, -- the second address line for your patron/borrower's primary address - `city` mediumtext NOT NULL, -- the city or town for your patron/borrower's primary address + `city` mediumtext, -- the city or town for your patron/borrower's primary address `state` text default NULL, -- the state or province for your patron/borrower's primary address `zipcode` varchar(25) default NULL, -- the zip or postal code for your patron/borrower's primary address `country` text, -- the country for your patron/borrower's primary address -- 2.14.2