Skip to content

Commit

Permalink
Dev: fixed database creation for postgres.
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Jul 17, 2017
1 parent 74dcf7b commit 60d447c
Show file tree
Hide file tree
Showing 3 changed files with 224 additions and 77 deletions.
111 changes: 95 additions & 16 deletions installer/sql/create-mssql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ CREATE TABLE prefix_surveymenu (
[id] int(11) NOT NULL ,
[parent_id] int(11) DEFAULT NULL,
[survey_id] int(11) DEFAULT NULL,
[user_id] int(11) DEFAULT NULL,
[order] int(11) DEFAULT '0',
[level] int(11) DEFAULT '0',
[title] VARCHAR(255) NOT NULL DEFAULT '',
Expand All @@ -643,15 +644,18 @@ CREATE TABLE prefix_surveymenu (
);

create index [parent_id_index] on [prefix_surveymenu] ([parent_id]);
create index [user_id_index] on [prefix_surveymenu] ([user_id]);
create index [order_index] on [prefix_surveymenu] ([order]);
create index [title_index] on [prefix_surveymenu] ([title]);


INSERT INTO prefix_surveymenu VALUES (1,NULL,NULL,0,0,'surveymenu','Main survey menu',GETDATE(),0,GETDATE(),0);
INSERT INTO prefix_surveymenu VALUES (1,NULL,NULL,NULL,0,0,'surveymenu','side','Main survey menu',NOW(),0,NOW(),0);
INSERT INTO prefix_surveymenu VALUES (2,NULL,NULL,NULL,0,0,'quickmenue','collapsed','quickmenu',NOW(),0,NOW(),0);

CREATE TABLE prefix_surveymenu_entries (
[id] int(11) NOT NULL ,
[menu_id] int(11) DEFAULT NULL,
[user_id] int(11) DEFAULT NULL,
[order] int(11) DEFAULT '0',
[name] VARCHAR(255) NOT NULL DEFAULT '',
[title] VARCHAR(255) NOT NULL DEFAULT '',
Expand Down Expand Up @@ -679,26 +683,101 @@ CREATE TABLE prefix_surveymenu_entries (
);

create index [order_index] on [prefix_surveymenu] ([order]);
create index [user_index] on [prefix_surveymenu] ([user]);
create index [title_index] on [prefix_surveymenu] ([title]);
create index [menu_title_index] on [prefix_surveymenu] ([menu_title]);

INSERT INTO prefix_surveymenu_entries VALUES
(1,1,1,'overview','Survey overview','Overview','Open general survey overview and quick action','list','fontawesome','','admin/survey/sa/view','','','','','','',NULL,'','en-GB',NOW(),0,NOW(),0),
(2,1,2,'generalsettings','Edit survey general settings','General settings','Open general survey settings','gears','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_generaloptions_panel','','surveysettings','read',NULL,'_generalTabEditSurvey','en-GB',NOW(),0,NOW(),0),
(3,1,3,'surveytexts','Edit survey text elements','Survey texts','Edit survey text elements','file-text-o','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/tab_edit_view','','surveylocale','read',NULL,'_getTextEditData','en-GB',NOW(),0,NOW(),0),
(4,1,4,'participants','Survey participants','Survey participants','Go to survey participant and token settings','user','fontawesome','','admin/tokens/sa/index/','','','','','surveysettings','update',NULL,'','en-GB',NOW(),0,NOW(),0),
(5,1,4,'presentation','Presentation & navigation settings','Presentation','Edit presentation and navigation settings','eye-slash','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_presentation_panel','','surveylocale','read',NULL,'_tabPresentationNavigation','en-GB',NOW(),0,NOW(),0),
(6,1,5,'publication','Publication and access control settings','Publication & access','Edit settings for publicationa and access control','key','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_publication_panel','','surveylocale','read',NULL,'_tabPublicationAccess','en-GB',NOW(),0,NOW(),0),
(7,1,6,'surveypermissions','Edit surveypermissions','Survey permissions','Edit permissions for this survey','lock','fontawesome','','admin/surveypermission/sa/view/','','','','','surveysecurity','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(8,1,7,'tokens','Token handling','Participant tokens','Define how tokens should be treated or generated','users','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_tokens_panel','','surveylocale','read',NULL,'_tabTokens','en-GB',NOW(),0,NOW(),0),
(9,1,8,'quotas','Edit quotas','Survey quotas','Edit quotas for this survey.','tasks','fontawesome','','admin/quotas/sa/index/','','','','','quotas','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(10,1,9,'assessments','Edit assessments','Assessments','Edit and look at the asessements for this survey.','comment-o','fontawesome','','admin/assessments/sa/index/','','','','','assessments','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(11,1,10,'notification','Notification and data management settings','Data management','Edit settings for notification and data management','feed','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_notification_panel','','surveylocale','read',NULL,'_tabNotificationDataManagement','en-GB',NOW(),0,NOW(),0),
(12,1,11,'emailtemplates','Email templates','Email templates','Edit the templates for invitation, reminder and registration emails','envelope-square','fontawesome','','admin/emailtemplates/sa/index/','','','','','assessments','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(13,1,12,'panelintegration','Edit survey panel integration','Panel integration','Define panel integrations for your survey','link','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_integration_panel','','surveylocale','read',NULL,'_tabPanelIntegration','en-GB',NOW(),0,NOW(),0),
(14,1,13,'ressources','Add/Edit ressources to the survey','Ressources','Add/Edit ressources to the survey','file','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_resources_panel','','surveylocale','read',NULL,'_tabResourceManagement','en-GB',NOW(),0,NOW(),0);
(1,1,NULL,1,'overview','Survey overview','Overview','Open general survey overview and quick action','list','fontawesome','','admin/survey/sa/view','','','','','','',NULL,'','en-GB',NOW(),0,NOW(),0),
(2,1,NULL,2,'generalsettings','Edit survey general settings','General settings','Open general survey settings','gears','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_generaloptions_panel','','surveysettings','read',NULL,'_generalTabEditSurvey','en-GB',NOW(),0,NOW(),0),
(3,1,NULL,3,'surveytexts','Edit survey text elements','Survey texts','Edit survey text elements','file-text-o','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/tab_edit_view','','surveylocale','read',NULL,'_getTextEditData','en-GB',NOW(),0,NOW(),0),
(4,1,NULL,4,'participants','Survey participants','Survey participants','Go to survey participant and token settings','user','fontawesome','','admin/tokens/sa/index/','','','','','surveysettings','update',NULL,'','en-GB',NOW(),0,NOW(),0),
(5,1,NULL,4,'presentation','Presentation & navigation settings','Presentation','Edit presentation and navigation settings','eye-slash','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_presentation_panel','','surveylocale','read',NULL,'_tabPresentationNavigation','en-GB',NOW(),0,NOW(),0),
(6,1,NULL,5,'publication','Publication and access control settings','Publication & access','Edit settings for publicationa and access control','key','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_publication_panel','','surveylocale','read',NULL,'_tabPublicationAccess','en-GB',NOW(),0,NOW(),0),
(7,1,NULL,6,'surveypermissions','Edit surveypermissions','Survey permissions','Edit permissions for this survey','lock','fontawesome','','admin/surveypermission/sa/view/','','','','','surveysecurity','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(8,1,NULL,7,'tokens','Token handling','Participant tokens','Define how tokens should be treated or generated','users','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_tokens_panel','','surveylocale','read',NULL,'_tabTokens','en-GB',NOW(),0,NOW(),0),
(9,1,NULL,8,'quotas','Edit quotas','Survey quotas','Edit quotas for this survey.','tasks','fontawesome','','admin/quotas/sa/index/','','','','','quotas','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(10,1,NULL,9,'assessments','Edit assessments','Assessments','Edit and look at the asessements for this survey.','comment-o','fontawesome','','admin/assessments/sa/index/','','','','','assessments','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(11,1,NULL,10,'notification','Notification and data management settings','Data management','Edit settings for notification and data management','feed','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_notification_panel','','surveylocale','read',NULL,'_tabNotificationDataManagement','en-GB',NOW(),0,NOW(),0),
(12,1,NULL,11,'emailtemplates','Email templates','Email templates','Edit the templates for invitation, reminder and registration emails','envelope-square','fontawesome','','admin/emailtemplates/sa/index/','','','','','assessments','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(13,1,NULL,12,'panelintegration','Edit survey panel integration','Panel integration','Define panel integrations for your survey','link','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_integration_panel','','surveylocale','read',NULL,'_tabPanelIntegration','en-GB',NOW(),0,NOW(),0),
(14,1,NULL,13,'ressources','Add/Edit ressources to the survey','Ressources','Add/Edit ressources to the survey','file','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_resources_panel','','surveylocale','read',NULL,'_tabResourceManagement','en-GB',NOW(),0,NOW(),0),
(15,2,NULL,1,'activateSurvey','Activate survey','Activate survey','Activate survey','play','fontawesome','','admin/survey/sa/activate','','','','','surveyactivation','update','{\"render\"\: {\"isActive\"\: false}}','','en-GB',NOW(),0,NOW(),0),
(16,2,NULL,2,'deactivateSurvey','Stop this survey','Stop this survey','Stop this survey','stop','fontawesome','','admin/survey/sa/deactivate','','','','','surveyactivation','update','{\"render\"\: {\"isActive\"\: true}}','','en-GB',NOW(),0,NOW(),0),
(17,2,NULL,3,'testSurvey','Go to survey','Go to survey','Go to survey','cog','fontawesome','','survey/index/','','','','','','','{\"render\"\: {\"link\"\: {\"external\"\: true, \"data\"\: {\"sid\"\: [\"this\",\"getSurveyId\"], newtest\: \"Y\", lang\: [\"this\",\"getLanguage\"]}}}','','en-GB',NOW(),0,NOW(),0),
(18,2,NULL,4,'listQuestions','List questions','List questions','List questions','list','fontawesome','','admin/survey/sa/listquestions','','','','','surveycontent','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(19,2,NULL,5,'listQuestionGroups','List question groups','List question groups','List question groups','th-list','fontawesome','','admin/survey/sa/listquestiongroups','','','','','surveycontent','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(20,2,NULL,6,'generalsettings','Edit survey general settings','General settings','Open general survey settings','gears','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_generaloptions_panel','','surveysettings','read',NULL,'_generalTabEditSurvey','en-GB',NOW(),0,NOW(),0),
(21,2,NULL,7,'surveypermissions','Edit surveypermissions','Survey permissions','Edit permissions for this survey','lock','fontawesome','','admin/surveypermission/sa/view/','','','','','surveysecurity','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(22,2,NULL,8,'quotas','Edit quotas','Survey quotas','Edit quotas for this survey.','tasks','fontawesome','','admin/quotas/sa/index/','','','','','quotas','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(23,2,NULL,9,'assessments','Edit assessments','Assessments','Edit and look at the asessements for this survey.','comment-o','fontawesome','','admin/assessments/sa/index/','','','','','assessments','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(24,2,NULL,10,'emailtemplates','Email templates','Email templates','Edit the templates for invitation, reminder and registration emails','envelope-square','fontawesome','','admin/emailtemplates/sa/index/','','','','','surveylocale','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(25,2,NULL,11,'surveyLogicFile','Survey logic file','Survey logic file','Survey logic file','sitemap','fontawesome','','admin/expressions/sa/survey_logic_file/','','','','','surveycontent','read',NULL,'','en-GB',NOW(),0,NOW(),0),
(26,2,NULL,12,'tokens','Token handling','Participant tokens','Define how tokens should be treated or generated','user','fontawesome','','','updatesurveylocalesettings','editLocalSettings_main_view','/admin/survey/subview/accordion/_tokens_panel','','surveylocale','read',NULL,'_tabTokens','en-GB',NOW(),0,NOW(),0),
(27,2,NULL,13,'cpdb','Central participant database','Central participant database','Central participant database','users','fontawesome','','admin/participants/sa/displayParticipants','','','','','tokens','read','{render\: {\"link\"\: {}}','','en-GB',NOW(),0,NOW(),0),
(28,2,NULL,14,'responses','Responses','Responses','Responses','icon-browse','iconclass','','admin/responses/sa/browse/','','','','','responses','read','{\"render\"\: {\"isActive\"\: true}}','','en-GB',NOW(),0,NOW(),0),
(29,2,NULL,15,'statistics','Statistics','Statistics','Statistics','bar-chart','fontawesome','','admin/statistics/sa/index/','','','','','statistics','read','{\"render\"\: {\"isActive\"\: true}}','','en-GB',NOW(),0,NOW(),0),
(30,2,NULL,16,'reorder','Reorder questions/question groups','Reorder questions/question groups','Reorder questions/question groups','icon-organize','iconclass','','admin/survey/sa/organize/','','','','','surveycontent','update','{\"render\"\: {\"isActive\"\: false}}','','en-GB',NOW(),0,NOW(),0);



-- -----------------------------------------------------
-- Table [prefix_templates]
-- -----------------------------------------------------
CREATE TABLE prefix_templates (
[name] varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
[folder] varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
[title] varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
[creation_date] timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
[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,
[owner_id] int(11) DEFAULT NULL,
[extends_templates_name] varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY ([name])
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



INSERT INTO prefix_templates VALUES
('default', 'default', 'Advanced Template', '2017-07-12 10:00:00', '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, 1, '');


-- -----------------------------------------------------
-- Table [prefix_template_configuration]
-- -----------------------------------------------------
CREATE TABLE prefix_template_configuration (
[id] int(11) NOT NULL AUTO_INCREMENT,
[templates_name] varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
[sid] int(11) DEFAULT NULL,
[gsid] int(11) DEFAULT NULL,
[uid] int(11) DEFAULT NULL,
[files_css] mediumtext COLLATE utf8mb4_unicode_ci,
[files_js] mediumtext COLLATE utf8mb4_unicode_ci,
[files_print_css] mediumtext COLLATE utf8mb4_unicode_ci,
[options] mediumtext COLLATE utf8mb4_unicode_ci,
[cssframework_name] varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
[cssframework_css] mediumtext COLLATE utf8mb4_unicode_ci,
[cssframework_js] mediumtext COLLATE utf8mb4_unicode_ci,
[packages_to_load] mediumtext COLLATE utf8mb4_unicode_ci,
[packages_ltr] mediumtext COLLATE utf8mb4_unicode_ci,
[packages_rtl] mediumtext COLLATE utf8mb4_unicode_ci,
PRIMARY KEY([id])
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO prefix_template_configuration VALUES
(1, 'default', NULL, NULL, NULL, '{"add": ["css/template.css", "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"]}', '', '', '', '');

--
-- Version Info
--
INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '293');
INSERT INTO prefix_settings_global VALUES ('DBVersion', '296');
Loading

0 comments on commit 60d447c

Please sign in to comment.