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

(-)a/api/v1/swagger/definitions/erm_user_role.yaml (+3 lines)
Lines 1-6 Link Here
1
---
1
---
2
type: object
2
type: object
3
properties:
3
properties:
4
  user_role_id:
5
    type: integer
6
    description: Internal user_role identifier
4
  agreement_id:
7
  agreement_id:
5
    type:
8
    type:
6
      - integer
9
      - integer
(-)a/installer/data/mysql/atomicupdate/erm.pl (+18 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "32030",
5
    description => "Add primary key to erm_user_roles",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        unless ( column_exists('erm_user_roles', 'user_role_id') ) {
11
            $dbh->do(q{
12
                ALTER TABLE `erm_user_roles`
13
                ADD COLUMN `user_role_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key' FIRST,
14
                ADD PRIMARY KEY(`user_role_id`);
15
            });
16
        }
17
    }
18
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +3 lines)
Lines 2880-2892 CREATE TABLE `erm_agreement_periods` ( Link Here
2880
2880
2881
DROP TABLE IF EXISTS `erm_user_roles`;
2881
DROP TABLE IF EXISTS `erm_user_roles`;
2882
CREATE TABLE `erm_user_roles` (
2882
CREATE TABLE `erm_user_roles` (
2883
    `user_role_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
2883
    `agreement_id` INT(11) NULL COMMENT 'link to the agreement',
2884
    `agreement_id` INT(11) NULL COMMENT 'link to the agreement',
2884
    `license_id` INT(11) NULL COMMENT 'link to the license',
2885
    `license_id` INT(11) NULL COMMENT 'link to the license',
2885
    `user_id` INT(11) NOT NULL COMMENT 'link to the user',
2886
    `user_id` INT(11) NOT NULL COMMENT 'link to the user',
2886
    `role` VARCHAR(80) NOT NULL COMMENT 'role of the user',
2887
    `role` VARCHAR(80) NOT NULL COMMENT 'role of the user',
2887
    CONSTRAINT `erm_user_roles_ibfk_1` FOREIGN KEY (`agreement_id`) REFERENCES `erm_agreements` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2888
    CONSTRAINT `erm_user_roles_ibfk_1` FOREIGN KEY (`agreement_id`) REFERENCES `erm_agreements` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2888
    CONSTRAINT `erm_user_roles_ibfk_2` FOREIGN KEY (`license_id`) REFERENCES `erm_licenses` (`license_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2889
    CONSTRAINT `erm_user_roles_ibfk_2` FOREIGN KEY (`license_id`) REFERENCES `erm_licenses` (`license_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2889
    CONSTRAINT `erm_user_roles_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2890
    CONSTRAINT `erm_user_roles_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2891
    PRIMARY KEY(`user_role_id`)
2890
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2892
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2891
2893
2892
--
2894
--
2893
- 

Return to bug 32154