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

(-)a/installer/data/mysql/atomicupdate/bug_33538.pl (+32 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  => "33538",
6
    description => "Add sync_on_creation and sync_on_update to identity_provider_mappings",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        unless ( column_exists( 'identity_providers_mappings', 'sync_on_creation' ) ) {
12
            $dbh->do(
13
                q{
14
                ALTER TABLE identity_provider_mappings
15
                   ADD COLUMN sync_on_creation TINYINT(1) NOT NULL DEFAULT 1 AFTER default_content
16
                }
17
            );
18
            say_success( $out, "Added sync_on_creation to identity_provider_mappings table" );
19
        }
20
21
        unless ( column_exists( 'identity_providers_mappings', 'sync_on_update' ) ) {
22
            $dbh->do(
23
                q{
24
                ALTER TABLE identity_provider_mappings
25
                    ADD COLUMN sync_on_update TINYINT(1) NOT NULL DEFAULT 1 AFTER sync_on_creation
26
                }
27
            );
28
            say_success( $out, "Added sync_on_update columns to identity_provider_mappings table" );
29
        }
30
31
    },
32
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 3724-3729 CREATE TABLE `identity_provider_mappings` ( Link Here
3724
  `provider_field` varchar(255) DEFAULT NULL COMMENT 'Attribute name from the identity provider',
3724
  `provider_field` varchar(255) DEFAULT NULL COMMENT 'Attribute name from the identity provider',
3725
  `koha_field` varchar(255) NOT NULL COMMENT 'Corresponding field in Koha borrowers table',
3725
  `koha_field` varchar(255) NOT NULL COMMENT 'Corresponding field in Koha borrowers table',
3726
  `default_content` varchar(255) DEFAULT NULL COMMENT 'Default value if provider does not supply this field',
3726
  `default_content` varchar(255) DEFAULT NULL COMMENT 'Default value if provider does not supply this field',
3727
  `sync_on_creation` TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'Whether to sync this field on user creation',
3728
  `sync_on_update` TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'Whether to sync this field on user update',
3727
  PRIMARY KEY (`mapping_id`),
3729
  PRIMARY KEY (`mapping_id`),
3728
  UNIQUE KEY `provider_koha_field` (`identity_provider_id`,`koha_field`),
3730
  UNIQUE KEY `provider_koha_field` (`identity_provider_id`,`koha_field`),
3729
  KEY `provider_field_idx` (`provider_field`),
3731
  KEY `provider_field_idx` (`provider_field`),
3730
- 

Return to bug 33538