Bug 18336: (follow-up) Shift TINYTEXT columns

This patch fixes two errors that slipped in the patchset.

To test:
- Create a dummy branch for testing:
  $ cd kohaclone
  $ git fetch
  $ git checkout v17.11.00 -b dummy
- Reset your working DB
  $ reset_all (y)
- Set your branch to current master
  $ git reset --hard origin/master
- Update the DB
  $ updatedatabase
- Update the schema files
  $ kshell
 k$ misc/devel/update_dbix_class_files.pl \
       --db_name koha_kohadev \
       --db_user koha_kohadev \
       --db_passwd password
 k$ exit
  $ git diff
=> FAIL: There are discrepancies on upgrades
- Reset to v17.11.00 revision and DB:
  $ git reset --hard v17.11.00
  $ reset_all (y)
- Set your branch to current master
  $ git reset --hard origin/master
- Apply this patch
- Update the DB
  $ updatedatabase
- Update the schema files
  $ kshell
 k$ misc/devel/update_dbix_class_files.pl \
       --db_name koha_kohadev \
       --db_user koha_kohadev \
       --db_passwd password
 k$ exit
  $ git diff
=> SUCCESS: No discrepancies!
- Reset to HEAD to get rid of the schema changes
  $ git reset --hard HEAD
- Regenerate the schema files on top of this patch
  $ dbic ; cd /home/vagrant/kohaclone
  $ git diff
=> SUCCESS: No discrepancies!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Tomás Cohen Arazi 2018-02-19 10:25:21 -03:00 committed by Jonathan Druart
parent b86a9ee984
commit af1a8c5a78
3 changed files with 15 additions and 13 deletions

View file

@ -79,7 +79,7 @@ __PACKAGE__->table("marc_subfield_structure");
data_type: 'varchar' data_type: 'varchar'
is_foreign_key: 1 is_foreign_key: 1
is_nullable: 1 is_nullable: 1
size: 20 size: 32
=head2 authtypecode =head2 authtypecode
@ -124,7 +124,7 @@ __PACKAGE__->table("marc_subfield_structure");
=head2 defaultvalue =head2 defaultvalue
data_type: 'text' data_type: 'mediumtext'
is_nullable: 1 is_nullable: 1
=head2 maxlength =head2 maxlength
@ -153,7 +153,7 @@ __PACKAGE__->add_columns(
"tab", "tab",
{ data_type => "tinyint", is_nullable => 1 }, { data_type => "tinyint", is_nullable => 1 },
"authorised_value", "authorised_value",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 20 }, { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 32 },
"authtypecode", "authtypecode",
{ data_type => "varchar", is_nullable => 1, size => 20 }, { data_type => "varchar", is_nullable => 1, size => 20 },
"value_builder", "value_builder",
@ -169,7 +169,7 @@ __PACKAGE__->add_columns(
"link", "link",
{ data_type => "varchar", is_nullable => 1, size => 80 }, { data_type => "varchar", is_nullable => 1, size => 80 },
"defaultvalue", "defaultvalue",
{ data_type => "text", is_nullable => 1 }, { data_type => "mediumtext", is_nullable => 1 },
"maxlength", "maxlength",
{ data_type => "integer", default_value => 9999, is_nullable => 0 }, { data_type => "integer", default_value => 9999, is_nullable => 0 },
); );
@ -213,8 +213,8 @@ __PACKAGE__->belongs_to(
); );
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-02 18:57:57
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:V++tjMyI92SwFjikQAAJFg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:18iBiNNiwTSYtKk28aoLJg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -3444,7 +3444,7 @@ CREATE TABLE uploaded_files (
dir MEDIUMTEXT NOT NULL, dir MEDIUMTEXT NOT NULL,
filesize int(11), filesize int(11),
dtcreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, dtcreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
uploadcategorycode tinytext, uploadcategorycode TEXT,
owner int(11), owner int(11),
public tinyint, public tinyint,
permanent tinyint, permanent tinyint,
@ -3967,7 +3967,7 @@ CREATE TABLE deletedbiblio_metadata (
CREATE TABLE IF NOT EXISTS club_templates ( CREATE TABLE IF NOT EXISTS club_templates (
id int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
`name` tinytext NOT NULL, `name` TEXT NOT NULL,
description MEDIUMTEXT, description MEDIUMTEXT,
is_enrollable_from_opac tinyint(1) NOT NULL DEFAULT '0', is_enrollable_from_opac tinyint(1) NOT NULL DEFAULT '0',
is_email_required tinyint(1) NOT NULL DEFAULT '0', is_email_required tinyint(1) NOT NULL DEFAULT '0',
@ -3987,7 +3987,7 @@ CREATE TABLE IF NOT EXISTS club_templates (
CREATE TABLE IF NOT EXISTS clubs ( CREATE TABLE IF NOT EXISTS clubs (
id int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
club_template_id int(11) NOT NULL, club_template_id int(11) NOT NULL,
`name` tinytext NOT NULL, `name` TEXT NOT NULL,
description MEDIUMTEXT, description MEDIUMTEXT,
date_start date DEFAULT NULL, date_start date DEFAULT NULL,
date_end date DEFAULT NULL, date_end date DEFAULT NULL,
@ -4030,7 +4030,7 @@ CREATE TABLE IF NOT EXISTS club_enrollments (
CREATE TABLE IF NOT EXISTS club_template_enrollment_fields ( CREATE TABLE IF NOT EXISTS club_template_enrollment_fields (
id int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
club_template_id int(11) NOT NULL, club_template_id int(11) NOT NULL,
`name` tinytext NOT NULL, `name` TEXT NOT NULL,
description MEDIUMTEXT, description MEDIUMTEXT,
authorised_value_category varchar(16) DEFAULT NULL, authorised_value_category varchar(16) DEFAULT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),
@ -4061,7 +4061,7 @@ CREATE TABLE IF NOT EXISTS club_enrollment_fields (
CREATE TABLE IF NOT EXISTS club_template_fields ( CREATE TABLE IF NOT EXISTS club_template_fields (
id int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
club_template_id int(11) NOT NULL, club_template_id int(11) NOT NULL,
`name` tinytext NOT NULL, `name` TEXT NOT NULL,
description MEDIUMTEXT, description MEDIUMTEXT,
authorised_value_category varchar(16) DEFAULT NULL, authorised_value_category varchar(16) DEFAULT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),

View file

@ -15468,7 +15468,7 @@ if( CheckVersion( $DBversion ) ) {
MODIFY COLUMN kohafield MODIFY COLUMN kohafield
VARCHAR(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL, VARCHAR(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN authorised_value MODIFY COLUMN authorised_value
VARCHAR(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, VARCHAR(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN authtypecode MODIFY COLUMN authtypecode
VARCHAR(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, VARCHAR(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN value_builder MODIFY COLUMN value_builder
@ -15478,7 +15478,9 @@ if( CheckVersion( $DBversion ) ) {
MODIFY COLUMN seealso MODIFY COLUMN seealso
VARCHAR(1100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, VARCHAR(1100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN link MODIFY COLUMN link
VARCHAR(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL VARCHAR(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN defaultvalue
MEDIUMTEXT COLLATE utf8mb4_unicode_ci default NULL
|); |);
$dbh->do(qq|ALTER TABLE $name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci|); $dbh->do(qq|ALTER TABLE $name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci|);
} }