Änderung Datenbank

Antworten
Benutzeravatar
shadowcat
Administrator
Beiträge: 5278
Registriert: Di 5. Feb 2013, 10:36
Kontaktdaten:

Änderung Datenbank

Beitrag von shadowcat »

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.
If it’s not broken, keep fixing it until it is
Antworten