visible parameter for persons and badges

This commit is contained in:
Ulf Gebhardt 2019-08-26 12:19:24 +02:00
parent b5bf9246b2
commit ef1e69e773
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
4 changed files with 7 additions and 4 deletions

View File

@ -28,6 +28,6 @@ class SELECT_PERSONS extends \SYSTEM\DB\QQ {
* @return string Returns MYSQL Query String
*/
public static function mysql(){return
'SELECT * FROM `persons` ORDER BY `order`';
'SELECT * FROM `persons` WHERE `visible` = 1 ORDER BY `order`';
}
}

View File

@ -28,6 +28,6 @@ class SELECT_PERSON_BADGES extends \SYSTEM\DB\QQ {
* @return string Returns MYSQL Query String
*/
public static function mysql(){return
'SELECT * FROM `person_badges`';
'SELECT * FROM `person_badges` WHERE `visible` = 1 ORDER BY `order`';
}
}

View File

@ -2,7 +2,8 @@ CREATE TABLE `person_badges` (
`person` INT(10) UNSIGNED NOT NULL,
`badge` VARCHAR(20) NOT NULL COLLATE 'utf8mb4_unicode_ci',
`color` VARCHAR(20) NOT NULL DEFAULT 'badge-primary' COLLATE 'utf8mb4_unicode_ci',
`order` INT(10) UNSIGNED NULL DEFAULT NULL,
`order` INT(10) UNSIGNED NOT NULL,
`visible` INT(10) UNSIGNED NULL DEFAULT 1,
PRIMARY KEY (`person`, `badge`),
INDEX `person` (`person`),
CONSTRAINT `FK__persons` FOREIGN KEY (`person`) REFERENCES `persons` (`id`) ON UPDATE CASCADE ON DELETE CASCADE

View File

@ -3,10 +3,12 @@ CREATE TABLE `persons` (
`name` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_unicode_ci',
`img` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
`info` TEXT NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
`order` INT(10) UNSIGNED NULL DEFAULT NULL,
`order` INT(10) UNSIGNED NOT NULL,
`visible` INT(10) UNSIGNED NULL DEFAULT 1,
PRIMARY KEY (`id`),
INDEX `id` (`id`)
)
COLLATE='utf8mb4_unicode_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;