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

(-)a/installer/data/mysql/atomicupdate/bug_34587-fix_timestamps.pl (+33 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "34587",
6
    description => "Follow up to fix incorrect default values for timestamps",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        if ( TableExists('erm_counter_files') ) {
12
            if ( column_exists( 'erm_counter_files', 'date_uploaded' ) ) {
13
                $dbh->do(
14
                    q{
15
                    ALTER TABLE erm_counter_files CHANGE COLUMN date_uploaded date_uploaded timestamp DEFAULT current_timestamp() COMMENT 'counter file upload date'
16
                }
17
                );
18
                say_success( $out, "Successfully corrected incorrect default value for 'erm_counter_files.date_uploaded" );
19
            }
20
        }
21
22
        if ( TableExists('erm_counter_logs') ) {
23
            if ( column_exists( 'erm_counter_logs', 'importdate' ) ) {
24
                $dbh->do(
25
                    q{
26
                    ALTER TABLE erm_counter_logs CHANGE COLUMN importdate importdate timestamp DEFAULT current_timestamp() COMMENT 'counter file import date'
27
                }
28
                );
29
                say_success( $out, "Successfully corrected incorrect default value for 'erm_counter_logs.importdate" );
30
            }
31
        }
32
    },
33
};
(-)a/installer/data/mysql/db_revs/230600056.pl (-3 / +2 lines)
Lines 43-49 return { Link Here
43
                `type` varchar(80) DEFAULT NULL COMMENT 'type of counter file',
43
                `type` varchar(80) DEFAULT NULL COMMENT 'type of counter file',
44
                `filename` varchar(80) DEFAULT NULL COMMENT 'name of the counter file',
44
                `filename` varchar(80) DEFAULT NULL COMMENT 'name of the counter file',
45
                `file_content` longblob DEFAULT NULL COMMENT 'content of the counter file',
45
                `file_content` longblob DEFAULT NULL COMMENT 'content of the counter file',
46
                `date_uploaded` timestamp DEFAULT NULL DEFAULT current_timestamp() COMMENT 'counter file upload date',
46
                `date_uploaded` timestamp DEFAULT current_timestamp() COMMENT 'counter file upload date',
47
                PRIMARY KEY (`erm_counter_files_id`),
47
                PRIMARY KEY (`erm_counter_files_id`),
48
                CONSTRAINT `erm_counter_files_ibfk_1` FOREIGN KEY (`usage_data_provider_id`) REFERENCES `erm_usage_data_providers` (`erm_usage_data_provider_id`) ON DELETE CASCADE ON UPDATE CASCADE
48
                CONSTRAINT `erm_counter_files_ibfk_1` FOREIGN KEY (`usage_data_provider_id`) REFERENCES `erm_usage_data_providers` (`erm_usage_data_provider_id`) ON DELETE CASCADE ON UPDATE CASCADE
49
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
49
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Lines 61-67 return { Link Here
61
                `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key to borrowers',
61
                `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key to borrowers',
62
                `counter_files_id` int(11) DEFAULT NULL COMMENT 'foreign key to erm_counter_files',
62
                `counter_files_id` int(11) DEFAULT NULL COMMENT 'foreign key to erm_counter_files',
63
                `usage_data_provider_id` int(11) DEFAULT NULL COMMENT 'foreign key to erm_usage_data_providers',
63
                `usage_data_provider_id` int(11) DEFAULT NULL COMMENT 'foreign key to erm_usage_data_providers',
64
                `importdate` timestamp DEFAULT NULL DEFAULT current_timestamp() COMMENT 'counter file import date',
64
                `importdate` timestamp DEFAULT current_timestamp() COMMENT 'counter file import date',
65
                `filename` varchar(80) DEFAULT NULL COMMENT 'name of the counter file',
65
                `filename` varchar(80) DEFAULT NULL COMMENT 'name of the counter file',
66
                `logdetails` longtext DEFAULT NULL COMMENT 'details from the counter log',
66
                `logdetails` longtext DEFAULT NULL COMMENT 'details from the counter log',
67
                PRIMARY KEY (`erm_counter_log_id`),
67
                PRIMARY KEY (`erm_counter_log_id`),
68
- 

Return to bug 39075