Skip to content

Commit

Permalink
Dev: fixed table creations
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jul 11, 2017
1 parent 7015f58 commit 79e003c
Showing 1 changed file with 63 additions and 48 deletions.
111 changes: 63 additions & 48 deletions installer/sql/create-mysql.sql
Expand Up @@ -696,59 +696,74 @@ INSERT INTO `prefix_surveymenu_entries` VALUES
-- -----------------------------------------------------
-- Table `lime_templates`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `prefix_templates` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(150) NOT NULL,
`creation_date` DATE NULL,
`author` VARCHAR(150) NULL,
`author_email` VARCHAR(255) NULL,
`author_url` VARCHAR(255) NULL,
`copyright` MEDIUMTEXT NULL,
`license` MEDIUMTEXT NULL,
`version` VARCHAR(45) NULL,
`description` TEXT NULL,
`last_update` DATETIME NULL,
`path` VARCHAR(45) NULL,
`owner_id` INT(11) NULL,
`extends_templates_id` INT(11) NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
UNIQUE INDEX `name_UNIQUE` (`name` ASC),
INDEX `fk_lime_templates_lime_templates1_idx` (`extends_templates_id` ASC))
ENGINE = MyISAM;

CREATE TABLE `prefix_templates` (
`id` int(11) UNSIGNED NOT NULL,
`name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'identifier, no special chars',
`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,
`author_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`author_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`copyright` mediumtext COLLATE utf8mb4_unicode_ci,
`license` mediumtext COLLATE utf8mb4_unicode_ci,
`version` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`api_version` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`view_folder` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`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;

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);


-- -----------------------------------------------------
-- Table `lime_template_configuration`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `prefix_template_configuration` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`templates_id` INT(11) UNSIGNED NOT NULL,
`gsid` INT(11) UNSIGNED NULL COMMENT 'linked survey group - optional',
`sid` INT(11) UNSIGNED NULL COMMENT 'linked survey - optional',
`files_css` MEDIUMTEXT NULL COMMENT 'CSS files to load at each page ',
`files_js` MEDIUMTEXT NULL COMMENT 'JS files to load at each page',
`files_print_css` MEDIUMTEXT NULL,
`options` MEDIUMTEXT NULL COMMENT 'options as json array',
`engine_cssframework_name` VARCHAR(45) NULL,
`engine_cssframework_css` MEDIUMTEXT NULL,
`viewdirectory` VARCHAR(255) NULL,
`filesdirectory` VARCHAR(255) NULL,
`packages` MEDIUMTEXT NULL COMMENT 'json array of packages to load',
`packages-ltr` MEDIUMTEXT NULL,
`packages-rtl` MEDIUMTEXT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
INDEX `fk_lime_template_configuration_lime_templates_idx` (`templates_id` ASC))
ENGINE = MyISAM;

INSERT INTO `prefix_templates` (`id`, `name`, `creation_date`, `author`, `author_email`, `author_url`, `copyright`, `license`, `version`, `description`, `last_update`, `path`, `owner_id`, `extends_templates_id`) VALUES (NULL, 'Advanced template', '2017-07-11', 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team
All rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php <br>LimeSurvey 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', 'LimeSurvey Advanced Template:
Many options for user customizations.
', NULL, 'advanced', '0', NULL);

INSERT INTO `prefix_template_configuration` (`id`, `templates_id`, `gsid`, `sid`, `files_css`, `files_js`, `files_print_css`, `options`, `engine_cssframework_name`, `engine_cssframework_css`, `viewdirectory`, `filesdirectory`, `packages`, `packages-ltr`, `packages-rtl`) VALUES (NULL, '1', NULL, NULL, '{ "add":"css/template.css", "add":"css/animate.css", }', '{ "add":"scripts/template.js",}', '{"add":"css/print_template.css",}', '{ "ajaxmode":"on","brandlogo":"on","backgroundimage":"on","animatebody":"on","bodyanimation":"lightSpeedIn","animatequestion":"on","questionanimation":"flipInX","animatealert":"on","alertanimation":"shake",}', 'bootstrap', '{"replace":"css/bootstrap.css","replace":"css/yiistrap.css",}', 'views', 'files', 'template-default,', 'template-default-ltr,', 'template-default-rtl,');
CREATE TABLE `prefix_template_configuration` (
`id` int(11) UNSIGNED NOT NULL,
`templates_name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
`gsid` int(11) UNSIGNED DEFAULT NULL COMMENT 'linked survey group - optional',
`sid` int(11) UNSIGNED DEFAULT NULL COMMENT 'linked survey - optional',
`files_css` mediumtext COLLATE utf8mb4_unicode_ci COMMENT 'CSS files to load at each page ',
`files_js` mediumtext COLLATE utf8mb4_unicode_ci COMMENT 'JS files to load at each page',
`files_print_css` mediumtext COLLATE utf8mb4_unicode_ci,
`options` mediumtext COLLATE utf8mb4_unicode_ci COMMENT 'options as json array',
`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
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



ALTER TABLE `lime_template_configuration`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id_UNIQUE` (`id`),
ADD KEY `fk_lime_template_configuration_lime_templates_idx` (`templates_name`);

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,');


SET SQL_MODE=@OLD_SQL_MODE;
Expand Down

0 comments on commit 79e003c

Please sign in to comment.