Skip to content

Commit

Permalink
LDEV-4180: Make DB patches produce up-to-date structure during build …
Browse files Browse the repository at this point in the history
…instead of applying multiple patches.

Get rid of unnecessary tables and keys.
Modify boolean columns to tinyint(1)
Simplify patches where possible.
  • Loading branch information
MarcinCieslak committed Feb 27, 2017
1 parent 91ec1f0 commit 5df0d44
Show file tree
Hide file tree
Showing 223 changed files with 3,658 additions and 5,837 deletions.
18 changes: 8 additions & 10 deletions lams_build/librarypackages/chatscribe/libraryActivity1_insert.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
insert into lams_learning_activity
(activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text,
learning_activity_type_id,grouping_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,run_offline_flag,
max_number_of_options,min_number_of_options,tool_id,tool_content_id,
gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image,
(description,title,help_text,
learning_activity_type_id,
learning_library_id,create_date_time,
library_activity_ui_image,
grouping_support_type_id, apply_grouping_flag,activity_category_id, language_file)
values
(null,null,'Combined Chat and Scribe','Prepare Group Report',null,null,null,
('Combined Chat and Scribe','Prepare Group Report',
'Learners to prepare group report, discussing report in chat',
6,null,null,0,
null,${learning_library_id},now(),0,
null,null,null,null,
null,null,null,'images/icon_groupreporting.svg',
6,
${learning_library_id},now(),
'images/icon_groupreporting.svg',
2,0,5,
'org.lamsfoundation.lams.library.chatscribe.ApplicationResources');
20 changes: 10 additions & 10 deletions lams_build/librarypackages/chatscribe/toolActivity1_insert.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
insert into lams_learning_activity
(activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text,
learning_activity_type_id,grouping_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,run_offline_flag,
max_number_of_options,min_number_of_options,tool_id,tool_content_id,
gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image,
(description,title,parent_activity_id,help_text,
learning_activity_type_id,
create_date_time,
tool_id,
library_activity_ui_image,
grouping_support_type_id, apply_grouping_flag,activity_category_id,
language_file)
values
(null,null,'Chat Tool','Chat Tool',null,null,${parent_activity_id},'Chat',
1,null,null,0,
null,null,now(),0,
null,null,${tool_id},null,
null,null,null,'tool/lachat11/images/icon_chat.svg',
('Chat Tool','Chat Tool',${parent_activity_id},'Chat',
1,
now(),
${tool_id},
'tool/lachat11/images/icon_chat.svg',
2,0,2,
'org.lamsfoundation.lams.tool.chat.ApplicationResources');
20 changes: 10 additions & 10 deletions lams_build/librarypackages/chatscribe/toolActivity2_insert.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
insert into lams_learning_activity
(activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text,
learning_activity_type_id,grouping_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,run_offline_flag,
max_number_of_options,min_number_of_options,tool_id,tool_content_id,
gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image,
(description,title,parent_activity_id,help_text,
learning_activity_type_id,
create_date_time,
tool_id,
library_activity_ui_image,
grouping_support_type_id, apply_grouping_flag,activity_category_id,
language_file)
values
(null,null,'Scribe Tool','Scribe Tool',null,null,${parent_activity_id},'Scribe',
1,null,null,0,
null,null,now(),0,
null,null,${tool_id},null,
null,null,null,'tool/lascrb11/images/icon_scribe.svg',
('Scribe Tool','Scribe Tool',${parent_activity_id},'Scribe',
1,
now(),
${tool_id},
'tool/lascrb11/images/icon_scribe.svg',
2,0,2,
'org.lamsfoundation.lams.tool.scribe.ApplicationResources');
18 changes: 8 additions & 10 deletions lams_build/librarypackages/forumscribe/libraryActivity1_insert.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
insert into lams_learning_activity
(activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text,
learning_activity_type_id,grouping_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,run_offline_flag,
max_number_of_options,min_number_of_options,tool_id,tool_content_id,
gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image,
(description,title,help_text,
learning_activity_type_id,
learning_library_id,create_date_time,
library_activity_ui_image,
grouping_support_type_id, apply_grouping_flag,activity_category_id, language_file)
values
(null,null,'Combined Chat and Scribe','Prepare Group Report',null,null,null,
('Combined Chat and Scribe','Prepare Group Report',
'Learners to prepare group report, discussing report in chat',
6,null,null,0,
null,${learning_library_id},now(),0,
null,null,null,null,
null,null,null,'images/icon_forum_and_scribe.svg',
6,
${learning_library_id},now(),
'images/icon_forum_and_scribe.svg',
2,0,5,
'org.lamsfoundation.lams.library.forumscribe.ApplicationResources');
22 changes: 11 additions & 11 deletions lams_build/librarypackages/forumscribe/toolActivity1_insert.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
insert into lams_learning_activity
(activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text,
learning_activity_type_id,grouping_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,run_offline_flag,
max_number_of_options,min_number_of_options,tool_id,tool_content_id,
gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image,
(description,title,parent_activity_id,help_text,
learning_activity_type_id,
create_date_time,
tool_id,
library_activity_ui_image,
grouping_support_type_id, apply_grouping_flag,activity_category_id,
language_file)
values
(null,null,'Forum/Message Board','Forum',null,null,${parent_activity_id},'Forum/Message Board',
1,null,null,0,
null,null,now(),0,
null,null,${tool_id},null,
null,null,null,'tool/lafrum11/images/icon_forum.svg',
('Forum/Message Board','Forum',${parent_activity_id},'Forum/Message Board',
1,
now(),
${tool_id},
'tool/lafrum11/images/icon_forum.svg',
2,0,2,
'org.lamsfoundation.lams.tool.forum.ApplicationResources');
'org.lamsfoundation.lams.tool.forum.ApplicationResources');
20 changes: 10 additions & 10 deletions lams_build/librarypackages/forumscribe/toolActivity2_insert.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
insert into lams_learning_activity
(activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text,
learning_activity_type_id,grouping_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,run_offline_flag,
max_number_of_options,min_number_of_options,tool_id,tool_content_id,
gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image,
(description,title,parent_activity_id,help_text,
learning_activity_type_id,
create_date_time,
tool_id,
library_activity_ui_image,
grouping_support_type_id, apply_grouping_flag,activity_category_id,
language_file)
values
(null,null,'Scribe Tool','Scribe Tool',null,null,${parent_activity_id},'Scribe',
1,null,null,0,
null,null,now(),0,
null,null,${tool_id},null,
null,null,null,'tool/lascrb11/images/icon_scribe.svg',
('Scribe Tool','Scribe Tool',${parent_activity_id},'Scribe',
1,
now(),
${tool_id},
'tool/lascrb11/images/icon_scribe.svg',
2,0,2,
'org.lamsfoundation.lams.tool.scribe.ApplicationResources');
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
insert into lams_learning_activity
(activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text,
learning_activity_type_id,grouping_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,run_offline_flag,
max_number_of_options,min_number_of_options,tool_id,tool_content_id,
gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image,
(description,title,help_text,
learning_activity_type_id,
learning_library_id,create_date_time,
library_activity_ui_image,
grouping_support_type_id, apply_grouping_flag,activity_category_id, language_file)
values
(null,null,'Combined Share Resources and Forum','Discuss Shared Resources',null,null,null,
('Combined Share Resources and Forum','Discuss Shared Resources',
'Learners to discuss items they have viewed via Share Resources.',
6,null,null,0,
null,${learning_library_id},now(),0,
null,null,null,null,
null,null,null,'images/icon_urlcontentmessageboard.svg',
6,
${learning_library_id},now(),
'images/icon_urlcontentmessageboard.svg',
2,0,5,
'org.lamsfoundation.lams.library.shareresourcesforum.ApplicationResources');
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
insert into lams_learning_activity
(activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text,
learning_activity_type_id,grouping_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,run_offline_flag,
max_number_of_options,min_number_of_options,tool_id,tool_content_id,
gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image,
(description,title,parent_activity_id,help_text,
learning_activity_type_id,
create_date_time,
tool_id,
library_activity_ui_image,
grouping_support_type_id, apply_grouping_flag,activity_category_id,
language_file)
values
(null,null,'Share Resources','Share Resources',null,null,${parent_activity_id},'Share Resources',
1,null,null,0,
null,null,now(),0,
null,null,${tool_id},null,
null,null,null,'tool/larsrc11/images/icon_rsrc.svg',
('Share Resources','Share Resources',${parent_activity_id},'Share Resources',
1,
now(),
${tool_id},
'tool/larsrc11/images/icon_rsrc.svg',
2,0,4,
'org.lamsfoundation.lams.tool.rsrc.ApplicationResources');
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
insert into lams_learning_activity
(activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text,
learning_activity_type_id,grouping_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,run_offline_flag,
max_number_of_options,min_number_of_options,tool_id,tool_content_id,
gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image,
(description,title,parent_activity_id,help_text,
learning_activity_type_id,
create_date_time,
tool_id,
library_activity_ui_image,
grouping_support_type_id, apply_grouping_flag,activity_category_id,
language_file)
values
(null,null,'Forum/Message Board','Forum',null,null,${parent_activity_id},'Forum/Message Board',
1,null,null,0,
null,null,now(),0,
null,null,${tool_id},null,
null,null,null,'tool/lafrum11/images/icon_forum.svg',
('Forum/Message Board','Forum',${parent_activity_id},'Forum/Message Board',
1,
now(),
${tool_id},
'tool/lafrum11/images/icon_forum.svg',
2,0,2,
'org.lamsfoundation.lams.tool.forum.ApplicationResources');
6 changes: 0 additions & 6 deletions lams_common/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,13 @@
</classpath>

<transaction src="${basedir}/build/sql/create_lams_11_db.sql"/>
<transaction src="${db.scripts}/drop_lams_11_tables.sql"/>
<transaction src="${db.scripts}/create_lams_11_tables.sql"/>
<!-- Create tables for LAMS and other application's integration -->
<transaction src="${db.scripts}/create_integration_tables.sql"/>
<transaction src="${db.scripts}/insert_lams_users.sql"/>
<transaction src="${db.scripts}/insert_types_data.sql"/>
<transaction src="${basedir}/build/sql/${lamsconf.table.sql}"/>
<!-- Create Quartz table -->
<transaction src="${db.scripts}/create_quartz_table.sql"/>
<!-- Create tables for Core Notebook Service -->
<transaction src="${db.scripts}/create_notebook_tables.sql"/>
<!-- Create tables for Presence Chat Service -->
<transaction src="${db.scripts}/create_presence_chat_tables.sql"/>
</sql>
</target>

Expand Down
84 changes: 0 additions & 84 deletions lams_common/db/sql/create_integration_tables.sql

This file was deleted.

31 changes: 1 addition & 30 deletions lams_common/db/sql/create_lams_11_db.sql
Original file line number Diff line number Diff line change
@@ -1,37 +1,8 @@


SET FOREIGN_KEY_CHECKS=0;
DROP DATABASE IF EXISTS @dbname@;
CREATE DATABASE @dbname@ DEFAULT CHARACTER SET utf8;
CREATE DATABASE @dbname@ DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
SET FOREIGN_KEY_CHECKS=1;

--USE mysql;

--DELETE FROM user WHERE user='';
-- DELETE FROM user WHERE user IS NULL;

--DELETE FROM db WHERE user='';
-- DELETE FROM db WHERE user IS NULL;

--GRANT ALL PRIVILEGES ON *.* TO lams@localhost IDENTIFIED BY 'lamsdemo';
--REVOKE PROCESS,SUPER ON *.* from lams@localhost;

--The hostname below should be replaced with the actual host name
--GRANT ALL PRIVILEGES ON *.* TO lams@'hostname' IDENTIFIED BY 'lamsdemo';
--REVOKE PROCESS,SUPER ON *.* from lams@'hostname';

--GRANT ALL PRIVILEGES ON *.* TO lams@'%' IDENTIFIED BY 'lamsdemo';
--REVOKE PROCESS,SUPER ON *.* from lams@'%';

--FLUSH PRIVILEGES;

--GRANT ALL PRIVILEGES ON lams.* TO lams@localhost IDENTIFIED BY 'lamsdemo' WITH GRANT OPTION;
--The hostname below should be replaced with the actual host name
--GRANT ALL PRIVILEGES ON lams.* TO lams@'hostname' IDENTIFIED BY 'lamsdemo' WITH GRANT OPTION;
--GRANT ALL PRIVILEGES ON lams.* TO lams@'%' IDENTIFIED BY 'lamsdemo' WITH GRANT OPTION;

--FLUSH PRIVILEGES;

USE @dbname@;

SET FOREIGN_KEY_CHECKS=1;
Loading

0 comments on commit 5df0d44

Please sign in to comment.