Änderung Datenbank

Infos, Planung, offene Fragen... alles zu BC v2.0! (Nicht vor 2018 verfügbar!)
Antworten
Benutzeravatar
shadowcat
Administrator
Beiträge: 3978
Registriert: Di 5. Feb 2013, 10:36
Kontaktdaten:

Änderung Datenbank

Beitrag von shadowcat » Fr 16. Nov 2018, 16:57

Aus der Tabelle `pages` wird die Spalte `template` gestrichen.

Neue Tabellen:

Code: Alles auswählen

CREATE TABLE `cat_pages_template` (
	`page_id` INT(11) UNSIGNED NOT NULL,
	`tpl_id` INT(11) UNSIGNED NOT NULL,
	`variant` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_bin',
	INDEX `FK_cat_pages_template_cat_pages` (`page_id`),
	INDEX `FK_cat_pages_template_cat_templates` (`tpl_id`),
	CONSTRAINT `FK_cat_pages_template_cat_pages` FOREIGN KEY (`page_id`) REFERENCES `cat_pages` (`page_id`) ON UPDATE CASCADE ON DELETE CASCADE,
	CONSTRAINT `FK_cat_pages_template_cat_templates` FOREIGN KEY (`tpl_id`) REFERENCES `cat_templates` (`tpl_id`) ON UPDATE CASCADE ON DELETE CASCADE
)
COMMENT='Maps pages to templates'
COLLATE='utf8mb4_bin'
ENGINE=InnoDB
;

Code: Alles auswählen

CREATE TABLE `cat_templates` (
	`tpl_id` INT(11) UNSIGNED NOT NULL,
	`option` VARCHAR(50) NOT NULL DEFAULT '0' COLLATE 'utf8mb4_bin',
	`value` TEXT NOT NULL DEFAULT '0' COLLATE 'utf8mb4_bin',
	UNIQUE INDEX `tpl_id_option` (`tpl_id`, `option`),
	CONSTRAINT `FK_cat_templates_cat_addons` FOREIGN KEY (`tpl_id`) REFERENCES `cat_addons` (`addon_id`)
)
COLLATE='utf8mb4_bin'
ENGINE=InnoDB
;

Code: Alles auswählen

CREATE TABLE `cat_template_settings` (
	`site_id` INT(11) UNSIGNED NOT NULL,
	`page_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
	`tpl` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_bin',
	`option` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_bin',
	`value` TEXT NOT NULL COLLATE 'utf8mb4_bin',
	INDEX `FK_cat_template_settings_cat_sites` (`site_id`),
	CONSTRAINT `FK_cat_template_settings_cat_sites` FOREIGN KEY (`site_id`) REFERENCES `cat_sites` (`site_id`) ON UPDATE CASCADE ON DELETE CASCADE
)
COLLATE='utf8mb4_bin'
ENGINE=InnoDB
;

My software never has bugs, it just develops random features.
BC1: PHP 5.5.11 (cli), mySQL 5.6.16 with 'strict' enabled, Apache 2.4.9
BC2: PHP 7.2.7, mariaDB 10.2.13, no Apache

Antworten