<?php
$db_update['indizies'][5]['content_levels'] = "
ALTER TABLE `content_levels` ADD UNIQUE(`language`, `url`);";

$db_update['data'][6]['content_templates'] = "
ALTER TABLE `content_templates` CHANGE `title` `label` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL;";


$db_update['structure'][10]['content_links'] = "
CREATE TABLE `content_links` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_module` int(11) DEFAULT NULL,
  `sortorder` int(11) DEFAULT NULL,
  `link` varchar(255) DEFAULT NULL,
  `linktext` text DEFAULT NULL,
  PRIMARY KEY (`id`), KEY `id_module` (`id_module`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;";



$db_update['data'][10]['content_options'] = "INSERT IGNORE INTO `content_options` (`c_public`, `title`, `value`) VALUES ('1', 'c_links', '1');";

$db_update['data'][10]['content_labels'] = "INSERT IGNORE INTO `content_labels` (`c_active`, `language`, `label`, `text`) VALUES ('1', 'de', 'LABEL_LINKS', 'Links');";
$db_update['data'][12]['content_labels'] = "DELETE FROM `content_labels` WHERE label = 'LABEL_LINKS';";

$db_update['data'][14]['content_levels'] = "
ALTER TABLE `content_levels` ADD `meta_title` VARCHAR(255) NULL DEFAULT NULL AFTER `linktext`, 
ADD `meta_description` TEXT NULL DEFAULT NULL AFTER `meta_title`;";


$db_update['data'][17]['content_images'] = "
ALTER TABLE `content_images` ADD `title` VARCHAR(255) NULL DEFAULT NULL AFTER `sortorder`, ADD `alt` VARCHAR(255) NULL DEFAULT NULL AFTER `title`, 
ADD `photographer` VARCHAR(255) NULL DEFAULT NULL AFTER `alt`;";

$db_update['data'][19]['content_options'] = "UPDATE `content_options` SET `value` = '1' WHERE `title` = 'c_modules';";

$db_update['data'][20]['content_options'] = "ALTER TABLE `content_options` ADD UNIQUE(`title`);";


$db_update['data']['1.0.3']['content'] = "ALTER TABLE `content` ADD `class` VARCHAR(255) NULL DEFAULT NULL AFTER `linktext`;";
$db_update['data']['1.0.3']['content_levels'] = "ALTER TABLE `content_levels` ADD `class` VARCHAR(255) NULL DEFAULT NULL AFTER `linktext`;";


$db_update['data']['1.0.4']['content_options'] = "
INSERT IGNORE INTO`content_options` (`c_public`, `title`, `value`) VALUES
('1', 'c_period', '0');";


$db_update['data']['1.0.5']['content_images'] = "
ALTER TABLE `content_images` ADD `link` VARCHAR(255) NULL DEFAULT NULL AFTER `copyright`, ADD `linktext` TEXT NULL DEFAULT NULL AFTER `link`;";


$db_update['data']['1.0.10']['content_templates'] = "
ALTER TABLE `content_templates` ADD `path` VARCHAR(255) NULL DEFAULT NULL AFTER `label`;";

$db_update['data']['1.0.10']['content_labels'] = "
INSERT IGNORE INTO `content_labels` (`c_active`, `language`, `label`, `text`) VALUES 
('1', 'de', 'LABEL_PATH', 'Dateipfad'),
('1', 'de', 'LABEL_TEMPLATE_FILE', 'Template-Datei');";


$db_update['data']['1.0.14']['content_templates'] = "
ALTER TABLE `content_templates`
ADD `row_start` TEXT NULL DEFAULT NULL AFTER `path`,
ADD `row_end` TEXT NULL DEFAULT NULL AFTER `row_start`,
ADD `row_limit` INT(11) NOT NULL DEFAULT 0 AFTER `row_end`;";

$db_update['data']['1.0.14']['content_labels'] = "
INSERT IGNORE INTO `content_labels` (`c_active`, `language`, `label`, `text`) VALUES 
('1', 'de', 'LABEL_ROW_LIMIT', 'Anzahl pro Reihe'),
('1', 'de', 'LABEL_ROW_START', 'Reihe start'),
('1', 'de', 'LABEL_ROW_END', 'Reihe ende');";


$db_update['data']['1.0.14']['content_modules'] = "
INSERT IGNORE INTO `content_modules` (`id`, `sortorder`, `c_active`, `title`, `text`, `language`, `level_module`, `icon`, `c_cms`, `c_admin`, `c_editor`, `c_viewer`) VALUES
(11, 11, '1', 'content_templates', 'Templates', 'de', NULL, 'view_quilt', '1', '1', '1', '1');";


$db_update['data']['1.0.15']['content_templates'] = "
ALTER TABLE `content_templates`
ADD `group_start` TEXT NULL DEFAULT NULL AFTER `path`,
ADD `group_end` TEXT NULL DEFAULT NULL AFTER `group_start`;";

$db_update['data']['1.0.15']['content_labels'] = "
INSERT IGNORE INTO `content_labels` (`c_active`, `language`, `label`, `text`) VALUES 
('1', 'de', 'LABEL_GROUP_START', 'Gruppe start'),
('1', 'de', 'LABEL_GROUP_END', 'Gruppe ende');";


$db_update['data']['1.0.17']['content_templates'] = "ALTER TABLE `content_templates` ADD `group_key` VARCHAR(100) NULL DEFAULT NULL AFTER `path`;";

$db_update['data']['1.0.17']['content_labels'] = "INSERT IGNORE INTO `content_labels` (`c_active`, `language`, `label`, `text`) VALUES ('1', 'de', 'LABEL_GROUP_KEY', 'Gruppenschlüssel');";

$db_update['data']['1.0.18']['content_templates'] = "ALTER TABLE `content_templates` ADD `row_count` INT(11) NOT NULL DEFAULT 1 AFTER `row_limit`";
$db_update['data']['1.0.18']['content_labels'] = "INSERT IGNORE INTO `content_labels` (`c_active`, `language`, `label`, `text`) VALUES ('1', 'de', 'LABEL_ROW_COUNT', 'Reihen Zähler');";
