Bugzilla – Attachment 71421 Details for
Bug 20144
Test suite is failing with new default SQL modes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20144: [sql_modes] Add default values for export_format columns
Bug-20144-sqlmodes-Add-default-values-for-exportfo.patch (text/plain), 3.17 KB, created by
Julian Maurice
on 2018-02-12 10:08:56 UTC
(
hide
)
Description:
Bug 20144: [sql_modes] Add default values for export_format columns
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2018-02-12 10:08:56 UTC
Size:
3.17 KB
patch
obsolete
>From 04706fdab06339dbb34a8fb1364f2173051d9600 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 5 Feb 2018 16:09:31 -0300 >Subject: [PATCH] Bug 20144: [sql_modes] Add default values for export_format > columns > >Fix for: >Field 'field_separator' doesn't have a default value >Field 'encoding' doesn't have a default value > >field_separator and subfield_separator are only used for MARC csv >profiles, no need to specify a default value > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > .../data/mysql/atomicupdate/bug_xxxxx_export_format_default.sql | 3 +++ > installer/data/mysql/kohastructure.sql | 8 ++++---- > t/db_dependent/Koha/CsvProfiles.t | 6 ++++-- > 3 files changed, 11 insertions(+), 6 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_xxxxx_export_format_default.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx_export_format_default.sql b/installer/data/mysql/atomicupdate/bug_xxxxx_export_format_default.sql >new file mode 100644 >index 0000000000..059958de3a >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_xxxxx_export_format_default.sql >@@ -0,0 +1,3 @@ >+ALTER TABLE export_format MODIFY csv_separator VARCHAR(2) NOT NULL DEFAULT ',', MODIFY field_separator VARCHAR(2), MODIFY subfield_separator VARCHAR(2); >+ALTER TABLE export_format MODIFY encoding VARCHAR(255) DEFAULT 'utf8'; >+ >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 74d1a01c64..bce6b94144 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -717,10 +717,10 @@ CREATE TABLE `export_format` ( > `profile` varchar(255) NOT NULL, > `description` mediumtext NOT NULL, > `content` mediumtext NOT NULL, >- `csv_separator` varchar(2) NOT NULL, >- `field_separator` varchar(2) NOT NULL, >- `subfield_separator` varchar(2) NOT NULL, >- `encoding` varchar(255) NOT NULL, >+ `csv_separator` varchar(2) NOT NULL DEFAULT ',', >+ `field_separator` varchar(2), >+ `subfield_separator` varchar(2), >+ `encoding` varchar(255) NOT NULL DEFAULT 'utf8', > `type` varchar(255) DEFAULT 'marc', > `used_for` varchar(255) DEFAULT 'export_records', > PRIMARY KEY (`export_format_id`) >diff --git a/t/db_dependent/Koha/CsvProfiles.t b/t/db_dependent/Koha/CsvProfiles.t >index e5d02b2151..d823f40404 100644 >--- a/t/db_dependent/Koha/CsvProfiles.t >+++ b/t/db_dependent/Koha/CsvProfiles.t >@@ -36,12 +36,14 @@ my $new_csv_profile_1 = Koha::CsvProfile->new({ > profile => 'my_csv_profile_name_for_test_1', > description => 'my_csv_profile_description_for_test_1', > type => 'sql', >- used_for => 'late_issues' >+ used_for => 'late_issues', >+ content => 'a content', > })->store; > my $new_csv_profile_2 = Koha::CsvProfile->new({ > profile => 'my_csv_profile_name_for_test_2', > description => 'my_csv_profile_description_for_test_2', >- type => 'marc' >+ type => 'marc', >+ content => 'another content', > })->store; > > like( $new_csv_profile_1->export_format_id, qr|^\d+$|, 'Adding a new csv_profile should have set the export_format_id'); >-- >2.14.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20144
:
71410
|
71411
|
71412
|
71413
|
71414
|
71415
|
71416
|
71417
|
71418
|
71419
|
71420
| 71421 |
71422
|
71423
|
71424
|
71425
|
71427
|
71428
|
71429
|
71430
|
71431
|
71432
|
71434
|
71435
|
71436
|
71437
|
71438
|
71440
|
71441
|
71442
|
71443
|
71444
|
71445
|
71446
|
71447
|
71448
|
71449
|
71450
|
71451
|
71452
|
71453
|
71454
|
71455
|
71456
|
71457
|
71458
|
71459
|
71460
|
71461
|
71462
|
71463
|
71467
|
71564