View | Details | Raw Unified | Return to bug 37511
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_37511.pl (+30 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
use Try::Tiny;
4
5
return {
6
    bug_number  => "37511",
7
    description => "Add a new column p_cs_precedes to the table currency",
8
    up          => sub {
9
        my ($args) = @_;
10
        my ( $dbh, $out ) = @$args{qw(dbh out)};
11
12
        if ( !column_exists( 'currency', 'p_cs_precedes' ) ) {
13
            try {
14
                $dbh->do(
15
                    q{
16
 ALTER TABLE `currency` ADD COLUMN `p_cs_precedes` tinyint(1) DEFAULT 1
17
                }
18
                );
19
                say_success( $out, "Added column p_cs_precedes" );
20
            } catch {
21
                say_failure(
22
                    $out,
23
                    "Adding column 'currency.p_cs_precedes' failed with errors: $_"
24
                );
25
            };
26
        } else {
27
            say_info( $out, "Column 'currency.p_cs_precedes' already exists!" );
28
        }
29
    },
30
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 2537-2542 CREATE TABLE `currency` ( Link Here
2537
  `active` tinyint(1) DEFAULT NULL,
2537
  `active` tinyint(1) DEFAULT NULL,
2538
  `archived` tinyint(1) DEFAULT 0,
2538
  `archived` tinyint(1) DEFAULT 0,
2539
  `p_sep_by_space` tinyint(1) DEFAULT 0,
2539
  `p_sep_by_space` tinyint(1) DEFAULT 0,
2540
  `p_cs_precedes` tinyint(1) DEFAULT 1,
2540
  PRIMARY KEY (`currency`)
2541
  PRIMARY KEY (`currency`)
2541
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2542
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2542
/*!40101 SET character_set_client = @saved_cs_client */;
2543
/*!40101 SET character_set_client = @saved_cs_client */;
2543
- 

Return to bug 37511