Bug 37893: (QA follow-up): Insert defaults to database for delimiter and terminator
Not considering here encoding here as I'm uncertain from the code if it should utf8 or ascii Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
a15bfabf37
commit
cf11f3863d
|
|
@ -112,6 +112,7 @@ Foreign key to sip_institutions.sip_institution_id
|
|||
=head2 delimiter
|
||||
|
||||
data_type: 'varchar'
|
||||
default_value: '|'
|
||||
is_nullable: 1
|
||||
size: 10
|
||||
|
||||
|
|
@ -241,8 +242,9 @@ Foreign key to cash_registers.id
|
|||
=head2 terminator
|
||||
|
||||
data_type: 'enum'
|
||||
default_value: 'CRLF'
|
||||
extra: {list => ["CR","CRLF"]}
|
||||
is_nullable: 1
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -278,7 +280,7 @@ __PACKAGE__->add_columns(
|
|||
"da_field_template",
|
||||
{ data_type => "varchar", is_nullable => 1, size => 255 },
|
||||
"delimiter",
|
||||
{ data_type => "varchar", is_nullable => 1, size => 10 },
|
||||
{ data_type => "varchar", default_value => "|", is_nullable => 1, size => 10 },
|
||||
"disallow_overpayment",
|
||||
{ data_type => "tinyint", is_nullable => 1 },
|
||||
"encoding",
|
||||
|
|
@ -324,8 +326,9 @@ __PACKAGE__->add_columns(
|
|||
"terminator",
|
||||
{
|
||||
data_type => "enum",
|
||||
default_value => "CRLF",
|
||||
extra => { list => ["CR", "CRLF"] },
|
||||
is_nullable => 1,
|
||||
is_nullable => 0,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -498,8 +501,8 @@ __PACKAGE__->belongs_to(
|
|||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-10-24 14:53:53
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:unjLCC8L7SMwMe6xIcBgNA
|
||||
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-11-04 15:47:11
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N8uHee0eMqOcg0I1obuEWA
|
||||
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ return {
|
|||
`cv_send_00_on_success` tinyint(1) NULL,
|
||||
`cv_triggers_alert` tinyint(1) NULL,
|
||||
`da_field_template` varchar(255) NULL,
|
||||
`delimiter` varchar(10) NULL,
|
||||
`delimiter` varchar(10) NULL DEFAULT '|',
|
||||
`disallow_overpayment` tinyint(1) NULL,
|
||||
`encoding` varchar(10) NULL,
|
||||
`error_detect` tinyint(1) NULL,
|
||||
|
|
@ -75,7 +75,7 @@ return {
|
|||
`send_patron_home_library_in_af` tinyint(1) NULL,
|
||||
`show_checkin_message` tinyint(1) NULL,
|
||||
`show_outstanding_amount` tinyint(1) NULL,
|
||||
`terminator` enum( 'CR', 'CRLF' ) NULL,
|
||||
`terminator` enum('CR','CRLF') NOT NULL DEFAULT 'CRLF',
|
||||
PRIMARY KEY(`sip_account_id`),
|
||||
UNIQUE KEY `account_login_id` (`login_id`),
|
||||
KEY `sip_accounts_ibfk_1` (`sip_institution_id`),
|
||||
|
|
@ -308,7 +308,7 @@ return {
|
|||
my $cv_send_00_on_success = $SIPconfig->{accounts}->{$account_key}->{cv_send_00_on_success};
|
||||
my $cv_triggers_alert = $SIPconfig->{accounts}->{$account_key}->{cv_triggers_alert};
|
||||
my $da_field_template = $SIPconfig->{accounts}->{$account_key}->{da_field_template};
|
||||
my $delimiter = $SIPconfig->{accounts}->{$account_key}->{delimiter} || undef;
|
||||
my $delimiter = $SIPconfig->{accounts}->{$account_key}->{delimiter} || '|';
|
||||
my $disallow_overpayment = $SIPconfig->{accounts}->{$account_key}->{disallow_overpayment};
|
||||
my $encoding = $SIPconfig->{accounts}->{$account_key}->{encoding};
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ return {
|
|||
$SIPconfig->{accounts}->{$account_key}->{send_patron_home_library_in_af};
|
||||
my $show_checkin_message = $SIPconfig->{accounts}->{$account_key}->{show_checkin_message};
|
||||
my $show_outstanding_amount = $SIPconfig->{accounts}->{$account_key}->{show_outstanding_amount};
|
||||
my $terminator = $SIPconfig->{accounts}->{$account_key}->{terminator};
|
||||
my $terminator = $SIPconfig->{accounts}->{$account_key}->{terminator} || 'CRLF';
|
||||
|
||||
$insert_accounts->execute(
|
||||
$sip_institution_id,
|
||||
|
|
|
|||
|
|
@ -6097,7 +6097,7 @@ CREATE TABLE `sip_accounts` (
|
|||
`cv_send_00_on_success` tinyint(1) NULL,
|
||||
`cv_triggers_alert` tinyint(1) NULL,
|
||||
`da_field_template` varchar(255) NULL,
|
||||
`delimiter` varchar(10) NULL,
|
||||
`delimiter` varchar(10) NULL DEFAULT '|',
|
||||
`disallow_overpayment` tinyint(1) NULL,
|
||||
`encoding` varchar(10) NULL,
|
||||
`error_detect` tinyint(1) NULL,
|
||||
|
|
@ -6119,7 +6119,7 @@ CREATE TABLE `sip_accounts` (
|
|||
`send_patron_home_library_in_af` tinyint(1) NULL,
|
||||
`show_checkin_message` tinyint(1) NULL,
|
||||
`show_outstanding_amount` tinyint(1) NULL,
|
||||
`terminator` enum('CR','CRLF') NULL,
|
||||
`terminator` enum('CR','CRLF') NOT NULL DEFAULT 'CRLF',
|
||||
PRIMARY KEY (`sip_account_id`),
|
||||
UNIQUE KEY `account_login_id` (`login_id`),
|
||||
KEY `sip_accounts_ibfk_1` (`sip_institution_id`),
|
||||
|
|
|
|||
|
|
@ -59,14 +59,25 @@ subtest 'Config from XML matches config from database' => sub {
|
|||
delete $fileSIPconfig->{institutions}->{$key}{'parms'};
|
||||
}
|
||||
|
||||
# Remove 'register_id' out of each account if it's empty. This can no longer be returned as an empty string as is now an FK constraint
|
||||
foreach my $key ( keys %{ $fileSIPconfig->{accounts} } ) {
|
||||
|
||||
# Remove 'register_id' out of each account if it's empty. This can no longer be returned as an empty string as is now an FK constraint
|
||||
if ( defined $fileSIPconfig->{accounts}->{$key}{'register_id'}
|
||||
&& $fileSIPconfig->{accounts}->{$key}{'register_id'} eq "" )
|
||||
{
|
||||
delete $fileSIPconfig->{accounts}->{$key}{'register_id'};
|
||||
}
|
||||
|
||||
# Remove terminator from file check as it's no longer nullable and defaults to 'CRLF'
|
||||
if ( !$fileSIPconfig->{accounts}->{$key}{'terminator'} ) {
|
||||
$fileSIPconfig->{accounts}->{$key}{'terminator'} = 'CRLF';
|
||||
}
|
||||
|
||||
# Remove delimiter from file check as it now defaults to '|'
|
||||
if ( !$fileSIPconfig->{accounts}->{$key}{'delimiter'} ) {
|
||||
$fileSIPconfig->{accounts}->{$key}{'delimiter'} = '|';
|
||||
}
|
||||
|
||||
# Remove 'password' from file config as it's no longer migrated (security improvement)
|
||||
# Passwords are now validated against the borrowers table using bcrypt hashes
|
||||
delete $fileSIPconfig->{accounts}->{$key}{'password'};
|
||||
|
|
|
|||
Loading…
Reference in New Issue