Bug 17355: DB changes

This patch adds a new authorised_value_category.is_system boolean/tinyint(1)
DB field.

Name 'is_system' is coming from existing tables account_credit_types and
account_debit_types and should not be discussed here (if you disagree
fill a new bug report and deal with naming issue separately)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-04-28 11:01:19 +02:00 committed by Martin Renvoize
parent 0f3e7691a4
commit 0ebb62755e
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,13 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
unless ( column_exists( 'authorised_value_categories', 'is_system' ) ) {
$dbh->do(q|
ALTER TABLE authorised_value_categories
ADD COLUMN is_system TINYINT(1) DEFAULT 0 AFTER category_name
|);
}
# Always end with this (adjust the bug info)
NewVersion( $DBversion, 17355, "Description");
}

View file

@ -100,6 +100,7 @@ CREATE TABLE `auth_tag_structure` (
DROP TABLE IF EXISTS `authorised_value_categories`;
CREATE TABLE `authorised_value_categories` (
`category_name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`is_system` tinyint(1) default 0,
PRIMARY KEY (`category_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;