Skip to content

Commit

Permalink
Dev: defined 'name' as PK for template table
Browse files Browse the repository at this point in the history
Dev: removed duplicate views/files folder
  • Loading branch information
LouisGac authored and TonisOrmisson committed Jul 14, 2017
1 parent 8bb310b commit 390880b
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions installer/sql/create-mysql.sql
Expand Up @@ -697,8 +697,8 @@ INSERT INTO `prefix_surveymenu_entries` VALUES
-- Table `lime_templates`
-- -----------------------------------------------------
CREATE TABLE `prefix_templates` (
`id` int(11) UNSIGNED NOT NULL,
`name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'identifier, no special chars',
`folder` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the title that will be show for this template that can have special chars',
`creation_date` date DEFAULT NULL,
`author` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
Expand All @@ -712,22 +712,16 @@ CREATE TABLE `prefix_templates` (
`files_folder` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`last_update` datetime DEFAULT NULL,
`folder` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`owner_id` int(11) DEFAULT NULL,
`extends_templates_name` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

ALTER TABLE `lime_templates`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id_UNIQUE` (`id`),
ADD UNIQUE KEY `name_UNIQUE` (`name`),
ADD KEY `fk_lime_templates_lime_templates_namex` (`extends_templates_name`,`name`) USING BTREE;
ADD PRIMARY KEY (`name`);

ALTER TABLE `lime_templates`
MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

INSERT INTO `lime_templates` (`id`, `name`, `title`, `creation_date`, `author`, `author_email`, `author_url`, `copyright`, `license`, `version`, `api_version`, `view_folder`, `files_folder`, `description`, `last_update`, `folder`, `owner_id`, `extends_templates_name`) VALUES
(1, 'default', '', '2017-07-11', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\r\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\r\n\r\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '2.0', '3.0', 'views', 'files', 'LimeSurvey Advanced Template:\r\nMany options for user customizations. \r\n', NULL, 'default', 0, NULL);
INSERT INTO `lime_templates` (`name`, `title`, `creation_date`, `author`, `author_email`, `author_url`, `copyright`, `license`, `version`, `api_version`, `view_folder`, `files_folder`, `description`, `last_update`, `folder`, `owner_id`, `extends_templates_name`) VALUES
('default', 'Advanced Template', '2017-07-11', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\r\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\r\n\r\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', 'LimeSurvey Advanced Template:\r\nMany options for user customizations. \r\n', NULL, 'default', 0, NULL);


-- -----------------------------------------------------
Expand All @@ -745,8 +739,6 @@ CREATE TABLE `prefix_template_configuration` (
`cssframework_name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`cssframework_css` mediumtext COLLATE utf8mb4_unicode_ci,
`cssframework_js` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`viewdirectory` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`filesdirectory` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`packages_to_load` mediumtext COLLATE utf8mb4_unicode_ci COMMENT 'json object of packages to load',
`packages_ltr` mediumtext COLLATE utf8mb4_unicode_ci,
`packages_rtl` mediumtext COLLATE utf8mb4_unicode_ci
Expand All @@ -762,8 +754,8 @@ ALTER TABLE `lime_template_configuration`
ALTER TABLE `lime_template_configuration`
MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

INSERT INTO `lime_template_configuration` (`id`, `templates_name`, `gsid`, `sid`, `files_css`, `files_js`, `files_print_css`, `options`, `cssframework_name`, `cssframework_css`, `cssframework_js`, `viewdirectory`, `filesdirectory`, `packages_to_load`, `packages_ltr`, `packages_rtl`) VALUES
(1, 'default', NULL, NULL, '{\r\n "add": ["css/template.css", "css/animate.css"]\r\n}', '{\r\n "add": ["scripts/template.js"]\r\n}', '{\r\n"add":"css/print_template.css",\r\n}', '{\r\n"ajaxmode":"on",\r\n"brandlogo":"on",\r\n"backgroundimage":"on",\r\n"animatebody":"on",\r\n"bodyanimation":"lightSpeedIn",\r\n"animatequestion":"on",\r\n"questionanimation":"flipInX",\r\n"animatealert":"on",\r\n"alertanimation":"shake"\r\n}', 'bootstrap', '{\r\n "replace": ["css/bootstrap.css", "css/yiistrap.css"]\r\n}', '', 'views', 'files', 'template-default,', 'template-default-ltr,', 'template-default-rtl,');
INSERT INTO `lime_template_configuration` (`id`, `templates_name`, `gsid`, `sid`, `files_css`, `files_js`, `files_print_css`, `options`, `cssframework_name`, `cssframework_css`, `cssframework_js`, `packages_to_load`, `packages_ltr`, `packages_rtl`) VALUES
(1, 'default', NULL, NULL, '{\r\n "add": ["css/template.css", "css/animate.css"]\r\n}', '{\r\n "add": ["scripts/template.js"]\r\n}', '{\r\n"add":"css/print_template.css",\r\n}', '{\r\n"ajaxmode":"on",\r\n"brandlogo":"on",\r\n"backgroundimage":"on",\r\n"animatebody":"on",\r\n"bodyanimation":"lightSpeedIn",\r\n"animatequestion":"on",\r\n"questionanimation":"flipInX",\r\n"animatealert":"on",\r\n"alertanimation":"shake"\r\n}', 'bootstrap', '{\r\n "replace": ["css/bootstrap.css", "css/yiistrap.css"]\r\n}', '', 'template-default,', 'template-default-ltr,', 'template-default-rtl,');


SET SQL_MODE=@OLD_SQL_MODE;
Expand Down

0 comments on commit 390880b

Please sign in to comment.