actual schema (not queries)

This commit is contained in:
Ulf Gebhardt 2019-08-25 20:17:16 +02:00
parent e4e013e647
commit 29d7b2b209
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,12 @@
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,
PRIMARY KEY (`person`, `badge`),
INDEX `person` (`person`),
CONSTRAINT `FK__persons` FOREIGN KEY (`person`) REFERENCES `persons` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
)
COLLATE='utf8mb4_unicode_ci'
ENGINE=InnoDB
;

View File

@ -0,0 +1,12 @@
CREATE TABLE `persons` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`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,
PRIMARY KEY (`id`),
INDEX `id` (`id`)
)
COLLATE='utf8mb4_unicode_ci'
ENGINE=InnoDB
;