Browse Source

Bug 20144: [sql_modes] Fix borrowers table structure

surname, address and city can be NULL

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
18.05.x
Jonathan Druart 6 years ago
parent
commit
1e2c353b1a
  1. 2
      installer/data/mysql/atomicupdate/bug_20144_update_borrowers_table.sql
  2. 12
      installer/data/mysql/kohastructure.sql

2
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;

12
installer/data/mysql/kohastructure.sql

@ -539,16 +539,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
@ -1564,16 +1564,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

Loading…
Cancel
Save