View | Details | Raw Unified | Return to bug 32030
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 => "BUG_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 2865-2877 CREATE TABLE `erm_agreement_periods` ( Link Here
2865
2865
2866
DROP TABLE IF EXISTS `erm_user_roles`;
2866
DROP TABLE IF EXISTS `erm_user_roles`;
2867
CREATE TABLE `erm_user_roles` (
2867
CREATE TABLE `erm_user_roles` (
2868
    `user_role_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
2868
    `agreement_id` INT(11) NULL COMMENT 'link to the agreement',
2869
    `agreement_id` INT(11) NULL COMMENT 'link to the agreement',
2869
    `license_id` INT(11) NULL COMMENT 'link to the license',
2870
    `license_id` INT(11) NULL COMMENT 'link to the license',
2870
    `user_id` INT(11) NOT NULL COMMENT 'link to the user',
2871
    `user_id` INT(11) NOT NULL COMMENT 'link to the user',
2871
    `role` VARCHAR(80) NOT NULL COMMENT 'role of the user',
2872
    `role` VARCHAR(80) NOT NULL COMMENT 'role of the user',
2872
    CONSTRAINT `erm_user_roles_ibfk_1` FOREIGN KEY (`agreement_id`) REFERENCES `erm_agreements` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2873
    CONSTRAINT `erm_user_roles_ibfk_1` FOREIGN KEY (`agreement_id`) REFERENCES `erm_agreements` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2873
    CONSTRAINT `erm_user_roles_ibfk_2` FOREIGN KEY (`license_id`) REFERENCES `erm_licenses` (`license_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2874
    CONSTRAINT `erm_user_roles_ibfk_2` FOREIGN KEY (`license_id`) REFERENCES `erm_licenses` (`license_id`) ON DELETE CASCADE ON UPDATE CASCADE,
2874
    CONSTRAINT `erm_user_roles_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
2875
    CONSTRAINT `erm_user_roles_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
2876
    PRIMARY KEY(`user_role_id`)
2875
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2877
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2876
2878
2877
--
2879
--
2878
- 

Return to bug 32030