Index: lams_common/conf/create_lams_11_tables.sql
===================================================================
diff -u
--- lams_common/conf/create_lams_11_tables.sql (revision 0)
+++ lams_common/conf/create_lams_11_tables.sql (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -0,0 +1,743 @@
+CREATE TABLE lams_gate_activity_level (
+ gate_activity_level_id INT(11) NOT NULL DEFAULT 0
+ , description VARCHAR(128) NOT NULL
+ , PRIMARY KEY (gate_activity_level_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_grouping_type (
+ grouping_type_id INT(11) NOT NULL
+ , description VARCHAR(128) NOT NULL
+ , PRIMARY KEY (grouping_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learning_activity_type (
+ learning_activity_type_id INT(11) NOT NULL DEFAULT 0
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (learning_activity_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learning_library (
+ learning_library_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , description TEXT
+ , title VARCHAR(255)
+ , valid_flag TINYINT(1) NOT NULL DEFAULT 1
+ , create_date_time DATETIME NOT NULL
+ , PRIMARY KEY (learning_library_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_workspace_folder_type (
+ lams_workspace_folder_type_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (lams_workspace_folder_type_id)
+)TYPE=InnoDB;
+
+
+CREATE TABLE lams_workspace_folder (
+ workspace_folder_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , parent_folder_id BIGINT(20)
+ , name VARCHAR(64) NOT NULL
+ , workspace_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , create_date_time DATETIME NOT NULL
+ , last_modified_date_time DATETIME
+ , lams_workspace_folder_type_id INT(3) NOT NULL
+ , PRIMARY KEY (workspace_folder_id)
+ , INDEX (parent_folder_id)
+ , CONSTRAINT FK_lams_workspace_folder_2 FOREIGN KEY (parent_folder_id)
+ REFERENCES lams_workspace_folder (workspace_folder_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (lams_workspace_folder_type_id)
+ , CONSTRAINT FK_lams_workspace_folder_4 FOREIGN KEY (lams_workspace_folder_type_id)
+ REFERENCES lams_workspace_folder_type (lams_workspace_folder_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_workspace (
+ workspace_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , root_folder_id BIGINT(20)
+ , name VARCHAR(255)
+ , PRIMARY KEY (workspace_id)
+ , INDEX (root_folder_id)
+ , CONSTRAINT FK_lams_workspace_1 FOREIGN KEY (root_folder_id)
+ REFERENCES lams_workspace_folder (workspace_folder_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_organisation_type (
+ organisation_type_id INT(3) NOT NULL
+ , name VARCHAR(64) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (organisation_type_id)
+)TYPE=InnoDB;
+CREATE UNIQUE INDEX UQ_lams_organisation_type_name ON lams_organisation_type (name ASC);
+
+CREATE TABLE lams_organisation (
+ organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , name VARCHAR(250)
+ , description VARCHAR(250)
+ , parent_organisation_id BIGINT(20)
+ , organisation_type_id INT(3) NOT NULL DEFAULT 0
+ , create_date DATETIME NOT NULL
+ , workspace_id BIGINT(20)
+ , PRIMARY KEY (organisation_id)
+ , INDEX (organisation_type_id)
+ , CONSTRAINT FK_lams_organisation_1 FOREIGN KEY (organisation_type_id)
+ REFERENCES lams_organisation_type (organisation_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (workspace_id)
+ , CONSTRAINT FK_lams_organisation_2 FOREIGN KEY (workspace_id)
+ REFERENCES lams_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (parent_organisation_id)
+ , CONSTRAINT FK_lams_organisation_3 FOREIGN KEY (parent_organisation_id)
+ REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_role (
+ role_id INT(6) NOT NULL DEFAULT 0
+ , name VARCHAR(64) NOT NULL
+ , description TEXT
+ , create_date DATETIME NOT NULL
+ , PRIMARY KEY (role_id)
+)TYPE=InnoDB;
+CREATE INDEX gname ON lams_role (name ASC);
+
+CREATE TABLE lams_tool_session_state (
+ tool_session_state_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (tool_session_state_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_lesson_state (
+ lesson_state_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (lesson_state_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_tool_session_type (
+ tool_session_type_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (tool_session_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_license (
+ license_id BIGINT(20) NOT NULL
+ , name VARCHAR(200) NOT NULL
+ , code VARCHAR(20) NOT NULL
+ , url VARCHAR(256)
+ , default_flag TINYINT(1) NOT NULL DEFAULT 0
+ , picture_url VARCHAR(256)
+ , PRIMARY KEY (license_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_copy_type (
+ copy_type_id TINYINT(4) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (copy_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_activity_category (
+ activity_category_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (activity_category_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_cr_workspace (
+ workspace_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , name VARCHAR(255) NOT NULL
+ , PRIMARY KEY (workspace_id)
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_workspace COMMENT='Content repository workspace';
+
+CREATE TABLE lams_cr_credential (
+ credential_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , name VARCHAR(255) NOT NULL
+ , password VARCHAR(255) NOT NULL
+ , PRIMARY KEY (credential_id)
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_credential COMMENT='Records the identification properties for a tool.';
+
+CREATE TABLE lams_grouping_support_type (
+ grouping_support_type_id INT(3) NOT NULL
+ , description VARCHAR(64) NOT NULL
+ , PRIMARY KEY (grouping_support_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_log_event_type (
+ log_event_type_id INT(5) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (log_event_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_workspace_folder_content_type (
+ content_type_id INT(3) NOT NULL AUTO_INCREMENT
+ , description VARCHAR(64) NOT NULL
+ , PRIMARY KEY (content_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_authentication_method_type (
+ authentication_method_type_id INT(3) NOT NULL
+ , description VARCHAR(64) NOT NULL
+ , PRIMARY KEY (authentication_method_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_authentication_method (
+ authentication_method_id BIGINT(20) NOT NULL
+ , authentication_method_type_id INT(3) NOT NULL DEFAULT 0
+ , authentication_method_name VARCHAR(255) NOT NULL
+ , UNIQUE UQ_lams_authentication_method_1 (authentication_method_name)
+ , PRIMARY KEY (authentication_method_id)
+ , INDEX (authentication_method_type_id)
+ , CONSTRAINT FK_lams_authorization_method_1 FOREIGN KEY (authentication_method_type_id)
+ REFERENCES lams_authentication_method_type (authentication_method_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_css_style (
+ style_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , name VARCHAR(100) NOT NULL
+ , description VARCHAR(100)
+ , style_type VARCHAR(100) NOT NULL
+ , parent_style_id BIGINT(20)
+ , PRIMARY KEY (style_id)
+ , INDEX (parent_style_id)
+ , CONSTRAINT FK_css_style_parent FOREIGN KEY (parent_style_id)
+ REFERENCES lams_css_style (style_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+ALTER TABLE lams_css_style COMMENT='May be a a visual element for a theme or a theme.';
+
+CREATE TABLE lams_css_style_property (
+ sp_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , name VARCHAR(100) NOT NULL
+ , value VARCHAR(100) NOT NULL
+ , element_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (sp_id)
+ , INDEX (element_id)
+ , CONSTRAINT FK_css_style_property_element FOREIGN KEY (element_id)
+ REFERENCES lams_css_style (style_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+ALTER TABLE lams_css_style_property COMMENT='Represents a single property in a css style e.g. font-weight: bold';
+
+CREATE TABLE lams_user_preference (
+ preference_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , language VARCHAR(2) NOT NULL DEFAULT 'en'
+ , country VARCHAR(2)
+ , theme_id BIGINT(20)
+ , PRIMARY KEY (preference_id)
+ , INDEX (theme_id)
+ , CONSTRAINT FK_user_preference_style FOREIGN KEY (theme_id)
+ REFERENCES lams_css_style (style_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_user (
+ user_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , login VARCHAR(20) NOT NULL
+ , password VARCHAR(50) NOT NULL
+ , title VARCHAR(32)
+ , first_name VARCHAR(64)
+ , last_name VARCHAR(128)
+ , address_line_1 VARCHAR(64)
+ , address_line_2 VARCHAR(64)
+ , address_line_3 VARCHAR(64)
+ , city VARCHAR(64)
+ , state VARCHAR(64)
+ , country VARCHAR(64)
+ , day_phone VARCHAR(64)
+ , evening_phone VARCHAR(64)
+ , mobile_phone VARCHAR(64)
+ , fax VARCHAR(64)
+ , email VARCHAR(128)
+ , disabled_flag TINYINT(1) NOT NULL DEFAULT 0
+ , create_date DATETIME NOT NULL
+ , authentication_method_id BIGINT(20) NOT NULL DEFAULT 0
+ , workspace_id BIGINT(20)
+ , base_organisation_id BIGINT(20) NOT NULL DEFAULT 0
+ , preference_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (user_id)
+ , INDEX (authentication_method_id)
+ , CONSTRAINT FK_lams_user_1 FOREIGN KEY (authentication_method_id)
+ REFERENCES lams_authentication_method (authentication_method_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (workspace_id)
+ , CONSTRAINT FK_lams_user_2 FOREIGN KEY (workspace_id)
+ REFERENCES lams_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (base_organisation_id)
+ , CONSTRAINT FK_lams_user_3 FOREIGN KEY (base_organisation_id)
+ REFERENCES lams_organisation (organisation_id)
+ , INDEX (preference_id)
+ , CONSTRAINT FK_user_preference FOREIGN KEY (preference_id)
+ REFERENCES lams_user_preference (preference_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+CREATE UNIQUE INDEX UQ_lams_user_login ON lams_user (login ASC);
+CREATE INDEX login ON lams_user (login ASC);
+
+CREATE TABLE lams_learning_design (
+ learning_design_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , learning_design_ui_id INT(11)
+ , description TEXT
+ , title VARCHAR(255)
+ , first_activity_id BIGINT(20)
+ , max_id INT(11)
+ , valid_design_flag TINYINT(4) NOT NULL
+ , read_only_flag TINYINT(4) NOT NULL
+ , date_read_only DATETIME
+ , user_id BIGINT(20) NOT NULL
+ , help_text TEXT
+ , online_instructions TEXT
+ , offline_instructions TEXT
+ , copy_type_id TINYINT(4) NOT NULL
+ , create_date_time DATETIME NOT NULL
+ , version VARCHAR(56)
+ , parent_learning_design_id BIGINT(20)
+ , workspace_folder_id BIGINT(20)
+ , duration BIGINT(38)
+ , license_id BIGINT(20)
+ , license_text TEXT
+ , lesson_org_id BIGINT(20)
+ , lesson_org_name VARCHAR(255)
+ , lesson_id BIGINT(20)
+ , lesson_start_date_time DATETIME
+ , lesson_name VARCHAR(255)
+ , last_modified_date_time DATETIME
+ , PRIMARY KEY (learning_design_id)
+ , INDEX (parent_learning_design_id)
+ , CONSTRAINT FK_lams_learning_design_2 FOREIGN KEY (parent_learning_design_id)
+ REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_learning_design_3 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (workspace_folder_id)
+ , CONSTRAINT FK_lams_learning_design_4 FOREIGN KEY (workspace_folder_id)
+ REFERENCES lams_workspace_folder (workspace_folder_id)
+ , INDEX (license_id)
+ , CONSTRAINT FK_lams_learning_design_5 FOREIGN KEY (license_id)
+ REFERENCES lams_license (license_id)
+ , INDEX (copy_type_id)
+ , CONSTRAINT FK_lams_learning_design_6 FOREIGN KEY (copy_type_id)
+ REFERENCES lams_copy_type (copy_type_id)
+)TYPE=InnoDB;
+CREATE INDEX idx_design_first_act ON lams_learning_design (first_activity_id ASC);
+
+CREATE TABLE lams_grouping (
+ grouping_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , grouping_ui_id INT(11)
+ , grouping_type_id INT(11) NOT NULL
+ , number_of_groups INT(11)
+ , learners_per_group INT(11)
+ , staff_group_id BIGINT(20) DEFAULT 0
+ , max_number_of_groups INT(3)
+ , PRIMARY KEY (grouping_id)
+ , INDEX (grouping_type_id)
+ , CONSTRAINT FK_lams_learning_grouping_1 FOREIGN KEY (grouping_type_id)
+ REFERENCES lams_grouping_type (grouping_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_group (
+ group_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , grouping_id BIGINT(20) NOT NULL
+ , order_id INT(6) NOT NULL DEFAULT 1
+ , PRIMARY KEY (group_id)
+ , INDEX (grouping_id)
+ , CONSTRAINT FK_lams_learning_group_1 FOREIGN KEY (grouping_id)
+ REFERENCES lams_grouping (grouping_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+
+CREATE TABLE lams_tool (
+ tool_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , tool_signature VARCHAR(64) NOT NULL
+ , service_name VARCHAR(255) NOT NULL
+ , tool_display_name VARCHAR(255) NOT NULL
+ , description TEXT
+ , tool_identifier VARCHAR(64) NOT NULL
+ , tool_version VARCHAR(10) NOT NULL
+ , learning_library_id BIGINT(20)
+ , default_tool_content_id BIGINT(20)
+ , valid_flag TINYINT(1) NOT NULL DEFAULT 1
+ , grouping_support_type_id INT(3) NOT NULL
+ , supports_define_later_flag TINYINT(1) NOT NULL DEFAULT 0
+ , supports_run_offline_flag TINYINT(1) NOT NULL
+ , supports_moderation_flag TINYINT(1) NOT NULL
+ , supports_contribute_flag TINYINT(1) NOT NULL
+ , learner_url TEXT NOT NULL
+ , author_url TEXT NOT NULL
+ , define_later_url TEXT
+ , export_portfolio_url TEXT NOT NULL
+ , monitor_url TEXT NOT NULL
+ , contribute_url TEXT
+ , moderation_url TEXT
+ , create_date_time DATETIME NOT NULL
+ , UNIQUE UQ_lams_tool_sig (tool_signature)
+ , UNIQUE UQ_lams_tool_class_name (service_name)
+ , PRIMARY KEY (tool_id)
+ , INDEX (learning_library_id)
+ , CONSTRAINT FK_lams_tool_1 FOREIGN KEY (learning_library_id)
+ REFERENCES lams_learning_library (learning_library_id)
+ , INDEX (grouping_support_type_id)
+ , CONSTRAINT FK_lams_tool_2 FOREIGN KEY (grouping_support_type_id)
+ REFERENCES lams_grouping_support_type (grouping_support_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learning_activity (
+ activity_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , activity_ui_id INT(11)
+ , description TEXT
+ , title VARCHAR(255)
+ , help_text TEXT
+ , xcoord INT(11)
+ , ycoord INT(11)
+ , parent_activity_id BIGINT(20)
+ , parent_ui_id INT(11)
+ , learning_activity_type_id INT(11) NOT NULL DEFAULT 0
+ , grouping_support_type_id INT(3) NOT NULL
+ , apply_grouping_flag TINYINT(1) NOT NULL
+ , grouping_id BIGINT(20)
+ , grouping_ui_id INT(11)
+ , order_id INT(11)
+ , define_later_flag TINYINT(4) NOT NULL DEFAULT 0
+ , learning_design_id BIGINT(20)
+ , learning_library_id BIGINT(20)
+ , create_date_time DATETIME NOT NULL
+ , run_offline_flag TINYINT(1) NOT NULL
+ , max_number_of_options INT(5)
+ , min_number_of_options INT(5)
+ , options_instructions TEXT
+ , tool_id BIGINT(20)
+ , tool_content_id BIGINT(20)
+ , activity_category_id INT(3) NOT NULL
+ , gate_activity_level_id INT(11)
+ , gate_open_flag TINYINT(1)
+ , gate_start_time_offset BIGINT(38)
+ , gate_end_time_offset BIGINT(38)
+ , gate_start_date_time DATETIME
+ , gate_end_date_time DATETIME
+ , library_activity_ui_image VARCHAR(255)
+ , create_grouping_id BIGINT(20)
+ , create_grouping_ui_id INT(11)
+ , library_activity_id BIGINT(20)
+ , PRIMARY KEY (activity_id)
+ , INDEX (learning_library_id)
+ , CONSTRAINT FK_lams_learning_activity_7 FOREIGN KEY (learning_library_id)
+ REFERENCES lams_learning_library (learning_library_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (learning_design_id)
+ , CONSTRAINT FK_lams_learning_activity_6 FOREIGN KEY (learning_design_id)
+ REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (parent_activity_id)
+ , CONSTRAINT FK_learning_activity_2 FOREIGN KEY (parent_activity_id)
+ REFERENCES lams_learning_activity (activity_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (learning_activity_type_id)
+ , CONSTRAINT FK_learning_activity_3 FOREIGN KEY (learning_activity_type_id)
+ REFERENCES lams_learning_activity_type (learning_activity_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (grouping_id)
+ , CONSTRAINT FK_learning_activity_6 FOREIGN KEY (grouping_id)
+ REFERENCES lams_grouping (grouping_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (tool_id)
+ , CONSTRAINT FK_lams_learning_activity_8 FOREIGN KEY (tool_id)
+ REFERENCES lams_tool (tool_id)
+ , INDEX (gate_activity_level_id)
+ , CONSTRAINT FK_lams_learning_activity_10 FOREIGN KEY (gate_activity_level_id)
+ REFERENCES lams_gate_activity_level (gate_activity_level_id)
+ , INDEX (create_grouping_id)
+ , CONSTRAINT FK_lams_learning_activity_9 FOREIGN KEY (create_grouping_id)
+ REFERENCES lams_grouping (grouping_id)
+ , INDEX (library_activity_id)
+ , CONSTRAINT FK_lams_learning_activity_11 FOREIGN KEY (library_activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+ , INDEX (activity_category_id)
+ , CONSTRAINT FK_lams_learning_activity_12 FOREIGN KEY (activity_category_id)
+ REFERENCES lams_activity_category (activity_category_id)
+ , INDEX (grouping_support_type_id)
+ , CONSTRAINT FK_lams_learning_activity_13 FOREIGN KEY (grouping_support_type_id)
+ REFERENCES lams_grouping_support_type (grouping_support_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_lesson (
+ lesson_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , learning_design_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , name VARCHAR(255) NOT NULL
+ , description TEXT
+ , create_date_time DATETIME NOT NULL
+ , organisation_id BIGINT(20)
+ , class_grouping_id BIGINT(20)
+ , lesson_state_id INT(3) NOT NULL
+ , start_date_time DATETIME
+ , schedule_start_date_time DATETIME
+ , end_date_time DATETIME
+ , schedule_end_date_time DATETIME
+ , PRIMARY KEY (lesson_id)
+ , INDEX (learning_design_id)
+ , CONSTRAINT FK_lams_lesson_1_1 FOREIGN KEY (learning_design_id)
+ REFERENCES lams_learning_design (learning_design_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_lesson_2 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (organisation_id)
+ , CONSTRAINT FK_lams_lesson_3 FOREIGN KEY (organisation_id)
+ REFERENCES lams_organisation (organisation_id)
+ , INDEX (lesson_state_id)
+ , CONSTRAINT FK_lams_lesson_4 FOREIGN KEY (lesson_state_id)
+ REFERENCES lams_lesson_state (lesson_state_id)
+ , INDEX (class_grouping_id)
+ , CONSTRAINT FK_lams_lesson_5 FOREIGN KEY (class_grouping_id)
+ REFERENCES lams_grouping (grouping_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_user_organisation (
+ user_organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , organisation_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (user_organisation_id)
+ , INDEX (organisation_id)
+ , CONSTRAINT FK_lams_user_organisation_1 FOREIGN KEY (organisation_id)
+ REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_user_organisation_2 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learner_progress (
+ learner_progress_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , user_id BIGINT(20) NOT NULL
+ , lesson_id BIGINT(20) NOT NULL
+ , lesson_completed_flag TINYINT(1) NOT NULL DEFAULT 0
+ , waiting_flag TINYINT(1) NOT NULL
+ , start_date_time DATETIME NOT NULL
+ , finish_date_time DATETIME
+ , current_activity_id BIGINT(20)
+ , next_activity_id BIGINT(20)
+ , previous_activity_id BIGINT(20)
+ , requires_restart_flag TINYINT(1) NOT NULL
+ , PRIMARY KEY (learner_progress_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_learner_progress_1 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (lesson_id)
+ , CONSTRAINT FK_lams_learner_progress_2 FOREIGN KEY (lesson_id)
+ REFERENCES lams_lesson (lesson_id)
+ , INDEX (current_activity_id)
+ , CONSTRAINT FK_lams_learner_progress_3 FOREIGN KEY (current_activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+ , INDEX (next_activity_id)
+ , CONSTRAINT FK_lams_learner_progress_4 FOREIGN KEY (next_activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+ , INDEX (previous_activity_id)
+ , CONSTRAINT FK_lams_learner_progress_5 FOREIGN KEY (previous_activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_cr_node (
+ node_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , workspace_id BIGINT(20) UNSIGNED NOT NULL
+ , path VARCHAR(255)
+ , type VARCHAR(255) NOT NULL
+ , created_date_time DATETIME NOT NULL
+ , next_version_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 1
+ , parent_nv_id BIGINT(20) UNSIGNED
+ , nv_id BIGINT(20) UNSIGNED NOT NULL
+ , PRIMARY KEY (node_id)
+ , INDEX (workspace_id)
+ , CONSTRAINT FK_lams_cr_node_1 FOREIGN KEY (workspace_id)
+ REFERENCES lams_cr_workspace (workspace_id)
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_node COMMENT='The main table containing the node definition';
+
+CREATE TABLE lams_cr_node_version (
+ nv_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , node_id BIGINT(20) UNSIGNED NOT NULL
+ , version_id BIGINT(20) UNSIGNED NOT NULL
+ , created_date_time DATETIME NOT NULL
+ , id BIGINT(20) UNSIGNED NOT NULL
+ , PRIMARY KEY (nv_id)
+ , INDEX (node_id)
+ , CONSTRAINT FK_lams_cr_node_version_2 FOREIGN KEY (node_id)
+ REFERENCES lams_cr_node (node_id)
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_node_version COMMENT='Represents a version of a node';
+
+CREATE TABLE lams_user_organisation_role (
+ user_organisation_role_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , user_organisation_id BIGINT(20) NOT NULL
+ , role_id INT(6) NOT NULL
+ , PRIMARY KEY (user_organisation_role_id)
+ , INDEX (role_id)
+ , CONSTRAINT FK_lams_user_organisation_role_2 FOREIGN KEY (role_id)
+ REFERENCES lams_role (role_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (user_organisation_id)
+ , CONSTRAINT FK_lams_user_organisation_role_3 FOREIGN KEY (user_organisation_id)
+ REFERENCES lams_user_organisation (user_organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_tool_session (
+ tool_session_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , tool_session_type_id INT(3) NOT NULL
+ , lesson_id BIGINT(20) NOT NULL
+ , activity_id BIGINT(20) NOT NULL
+ , tool_session_state_id INT(3) NOT NULL
+ , create_date_time DATETIME NOT NULL
+ , group_id BIGINT(20)
+ , user_id BIGINT(20)
+ , unique_key VARCHAR(128) NOT NULL
+ , UNIQUE UQ_lams_tool_session_1 (unique_key)
+ , PRIMARY KEY (tool_session_id)
+ , INDEX (tool_session_state_id)
+ , CONSTRAINT FK_lams_tool_session_4 FOREIGN KEY (tool_session_state_id)
+ REFERENCES lams_tool_session_state (tool_session_state_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_tool_session_5 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (tool_session_type_id)
+ , CONSTRAINT FK_lams_tool_session_7 FOREIGN KEY (tool_session_type_id)
+ REFERENCES lams_tool_session_type (tool_session_type_id)
+ , INDEX (activity_id)
+ , CONSTRAINT FK_lams_tool_session_8 FOREIGN KEY (activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+ , INDEX (group_id)
+ , CONSTRAINT FK_lams_tool_session_1 FOREIGN KEY (group_id)
+ REFERENCES lams_group (group_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_progress_completed (
+ learner_progress_id BIGINT(20) NOT NULL
+ , activity_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (learner_progress_id, activity_id)
+ , INDEX (learner_progress_id)
+ , CONSTRAINT FK_lams_progress_completed_1 FOREIGN KEY (learner_progress_id)
+ REFERENCES lams_learner_progress (learner_progress_id)
+ , INDEX (activity_id)
+ , CONSTRAINT FK_lams_progress_completed_2 FOREIGN KEY (activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_progress_attempted (
+ learner_progress_id BIGINT(20) NOT NULL
+ , activity_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (learner_progress_id, activity_id)
+ , INDEX (learner_progress_id)
+ , CONSTRAINT FK_lams_progress_current_1 FOREIGN KEY (learner_progress_id)
+ REFERENCES lams_learner_progress (learner_progress_id)
+ , INDEX (activity_id)
+ , CONSTRAINT FK_lams_progress_current_2 FOREIGN KEY (activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_user_group (
+ user_id BIGINT(20) NOT NULL
+ , group_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (user_id, group_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_user_group_1 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (group_id)
+ , CONSTRAINT FK_lams_user_group_2 FOREIGN KEY (group_id)
+ REFERENCES lams_group (group_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_tool_content (
+ tool_content_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , tool_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (tool_content_id)
+ , INDEX (tool_id)
+ , CONSTRAINT FK_lams_tool_content_1 FOREIGN KEY (tool_id)
+ REFERENCES lams_tool (tool_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_activity_learners (
+ user_id BIGINT(20) NOT NULL DEFAULT 0
+ , activity_id BIGINT(20) NOT NULL DEFAULT 0
+ , INDEX (user_id)
+ , CONSTRAINT FK_TABLE_32_1 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (activity_id)
+ , CONSTRAINT FK_TABLE_32_2 FOREIGN KEY (activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_lesson_learner (
+ lesson_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , INDEX (lesson_id)
+ , CONSTRAINT FK_lams_lesson_learner_1 FOREIGN KEY (lesson_id)
+ REFERENCES lams_lesson (lesson_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_lesson_learner_2 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_cr_workspace_credential (
+ wc_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , workspace_id BIGINT(20) UNSIGNED NOT NULL
+ , credential_id BIGINT(20) UNSIGNED NOT NULL
+ , PRIMARY KEY (wc_id)
+ , INDEX (workspace_id)
+ , CONSTRAINT FK_lams_cr_workspace_credential_1 FOREIGN KEY (workspace_id)
+ REFERENCES lams_cr_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (credential_id)
+ , CONSTRAINT FK_lams_cr_workspace_credential_2 FOREIGN KEY (credential_id)
+ REFERENCES lams_cr_credential (credential_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_workspace_credential COMMENT='Maps tools access to workspaces';
+
+CREATE TABLE lams_cr_node_version_property (
+ id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , nv_id BIGINT(20) UNSIGNED NOT NULL
+ , name VARCHAR(255) NOT NULL
+ , value VARCHAR(255) NOT NULL
+ , type TINYINT NOT NULL
+ , PRIMARY KEY (id)
+ , INDEX (nv_id)
+ , CONSTRAINT FK_lams_cr_node_version_property_1 FOREIGN KEY (nv_id)
+ REFERENCES lams_cr_node_version (nv_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_log_event (
+ log_event_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , log_event_type_id INT(5) NOT NULL
+ , user_id BIGINT(20)
+ , timestamp DATETIME NOT NULL
+ , ref_id BIGINT(20)
+ , message VARCHAR(255)
+ , PRIMARY KEY (log_event_id)
+ , INDEX (log_event_type_id)
+ , CONSTRAINT FK_lams_event_log_1 FOREIGN KEY (log_event_type_id)
+ REFERENCES lams_log_event_type (log_event_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_workspace_folder_content (
+ folder_content_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , content_type_id INT(3) NOT NULL
+ , name VARCHAR(64) NOT NULL
+ , description VARCHAR(64) NOT NULL
+ , create_date_time DATETIME NOT NULL
+ , last_modified_date DATETIME NOT NULL
+ , workspace_folder_id BIGINT(20) NOT NULL
+ , uuid BIGINT(20)
+ , version_id BIGINT(20)
+ , mime_type VARCHAR(10) NOT NULL
+ , UNIQUE unique_content_name (name, workspace_folder_id, mime_type)
+ , UNIQUE unique_node_version (workspace_folder_id, uuid, version_id)
+ , PRIMARY KEY (folder_content_id)
+ , INDEX (workspace_folder_id)
+ , CONSTRAINT FK_lams_workspace_folder_content_1 FOREIGN KEY (workspace_folder_id)
+ REFERENCES lams_workspace_folder (workspace_folder_id)
+ , INDEX (content_type_id)
+ , CONSTRAINT FK_lams_workspace_folder_content_2 FOREIGN KEY (content_type_id)
+ REFERENCES lams_workspace_folder_content_type (content_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learning_transition (
+ transition_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , transition_ui_id INT(11)
+ , description TEXT
+ , title VARCHAR(255)
+ , to_activity_id BIGINT(20) NOT NULL
+ , from_activity_id BIGINT(20) NOT NULL
+ , learning_design_id BIGINT(20) NOT NULL DEFAULT 0
+ , create_date_time DATETIME NOT NULL
+ , to_ui_id INT(11)
+ , from_ui_id INT(11)
+ , PRIMARY KEY (transition_id)
+ , INDEX (from_activity_id)
+ , CONSTRAINT FK_learning_transition_3 FOREIGN KEY (from_activity_id)
+ REFERENCES lams_learning_activity (activity_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (to_activity_id)
+ , CONSTRAINT FK_learning_transition_2 FOREIGN KEY (to_activity_id)
+ REFERENCES lams_learning_activity (activity_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (learning_design_id)
+ , CONSTRAINT lddefn_transition_ibfk_1 FOREIGN KEY (learning_design_id)
+ REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml
===================================================================
diff -u -r7cb804782140d348edd332845c498640088603a5 -r4206c2b9c81db55b984029d55c41bef5abcb4788
--- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml (.../Activity.hbm.xml) (revision 7cb804782140d348edd332845c498640088603a5)
+++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml (.../Activity.hbm.xml) (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -59,15 +59,6 @@
@hibernate.property column="create_date_time" length="19" not-null="true"
-
- @hibernate.property column="offline_instructions" length="65535"
-
-
-
- @hibernate.property column="online_instructions" length="65535"
-
-
-
@hibernate.property column="run_offline_flag" length="4" not-null="true"
Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml
===================================================================
diff -u -r473f11f92b0560b59fdaa1891ddbc6b4099f3d45 -r4206c2b9c81db55b984029d55c41bef5abcb4788
--- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml (.../LearningDesign.hbm.xml) (revision 473f11f92b0560b59fdaa1891ddbc6b4099f3d45)
+++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml (.../LearningDesign.hbm.xml) (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -154,6 +154,15 @@
@hibernate.property column ="last_modified_date_time"
+
+ @hibernate.property column="offline_instructions" length="65535"
+
+
+
+ @hibernate.property column="online_instructions" length="65535"
+
+
+
Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSProperty.hbm.xml
===================================================================
diff -u
--- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSProperty.hbm.xml (revision 0)
+++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSProperty.hbm.xml (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+ @hibernate.class
+ table="lams_css_property"
+
+
+
+
+ @hibernate.id
+ generator-class="native"
+ type="java.lang.Long"
+ column="property_id"
+
+
+
+
+
+
+
+
+ @hibernate.property
+ column="name"
+ length="255"
+ not-null="true"
+
+
+
+
+ @hibernate.property
+ column="value"
+ length="100"
+ not-null="true"
+
+
+
+
+ @hibernate.property
+ column="type"
+ length="4"
+ not-null="true"
+
+
+
+
+ @hibernate.property
+ column="style_subset"
+ length="20"
+ not-null="true"
+
+
+
+
+
+
+
Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSStyle.hbm.xml
===================================================================
diff -u
--- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSStyle.hbm.xml (revision 0)
+++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSStyle.hbm.xml (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+ @hibernate.class
+ table="lams_css_style"
+
+
+
+
+ @hibernate.id
+ generator-class="native"
+ type="java.lang.Long"
+ column="style_id"
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+ @hibernate.set
+ lazy="false"
+ inverse="true"
+ cascade="all-delete-orphan"
+
+ @hibernate.collection-key
+ column="style_id"
+
+ @hibernate.collection-one-to-many
+ class="org.lamsfoundation.lams.themes.CSSProperty"
+
+
+
+
+
+
+
+
+
+
+
+ @hibernate.many-to-one
+ not-null="true"
+ cascade="none"
+ update="true"
+ insert="true"
+ @hibernate.column name="theme_ve_id"
+
+
+
+
+
+
+
+
+
Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSThemeVisualElement.hbm.xml
===================================================================
diff -u
--- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSThemeVisualElement.hbm.xml (revision 0)
+++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSThemeVisualElement.hbm.xml (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
+
+ @hibernate.class
+ table="lams_css_theme_ve"
+
+
+
+
+ @hibernate.id
+ generator-class="native"
+ type="java.lang.Long"
+ column="theme_ve_id"
+
+
+
+ true
+
+
+
+
+ true
+
+ @hibernate.property
+ column="name"
+ length="100"
+ not-null="true"
+
+
+
+ true
+
+ @hibernate.property
+ column="description"
+ length="100"
+
+
+
+ true
+
+ @hibernate.property
+ column="theme_flag"
+ length="1"
+ not-null="true"
+
+
+
+
+
+
+
+
+ @hibernate.set
+ lazy="true"
+ inverse="true"
+ cascade="none"
+ @hibernate.collection-key
+ column="theme_id"
+ @hibernate.collection-one-to-many
+ class="org.lamsfoundation.lams.usermanagement.User"
+
+
+
+
+
+
+
+
+
+
+
+ @hibernate.set
+ lazy="true"
+ inverse="true"
+ cascade="all-delete-orphan"
+
+ @hibernate.collection-key
+ column="theme_ve_id"
+
+ @hibernate.collection-one-to-many
+ class="org.lamsfoundation.lams.themes.CSSStyle"
+
+
+
+
+
+
+
+
+
+ @hibernate.set
+ lazy="true"
+ inverse="true"
+ cascade="all-delete-orphan"
+
+ @hibernate.collection-key
+ column="parent_id"
+
+ @hibernate.collection-one-to-many
+ class="org.lamsfoundation.lams.themes.CSSThemeVisualElement"
+
+
+
+
+
+
+
+
+
+ @hibernate.many-to-one
+ not-null="true"
+ cascade="none"
+ update="true"
+ insert="true"
+ @hibernate.column name="parent_id"
+
+
+
+
+
+
Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/Tool.hbm.xml
===================================================================
diff -u -r96871d90a1687f73bef35cac8e4837325b51e843 -r4206c2b9c81db55b984029d55c41bef5abcb4788
--- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/Tool.hbm.xml (.../Tool.hbm.xml) (revision 96871d90a1687f73bef35cac8e4837325b51e843)
+++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/Tool.hbm.xml (.../Tool.hbm.xml) (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -38,6 +38,36 @@
+
+ @hibernate.property
+ column="tool_identifier"
+ length="64"
+ not-null="true"
+
+
+
+
+
+ @hibernate.property
+ column="tool_version"
+ length="10"
+ not-null="true"
+
+
+
+
+
+
+
+ @hibernate.many-to-one
+ not-null="true"
+ @hibernate.column name="theme_id"
+
+
+
+
-
+
@@ -426,18 +426,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
@@ -733,7 +721,7 @@
-
+
@@ -889,6 +877,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1089,7 +1089,7 @@
-
+
@@ -1158,7 +1158,7 @@
-
+
@@ -1279,7 +1279,7 @@
-
+
@@ -1342,7 +1342,7 @@
-
+
@@ -1504,7 +1504,7 @@
-
+
@@ -1628,7 +1628,7 @@
-
+
@@ -1677,7 +1677,7 @@
-
+
@@ -1731,7 +1731,7 @@
-
+
@@ -1916,6 +1916,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1944,6 +1973,13 @@
+
+
+
+
+
+
+
@@ -1970,7 +2006,7 @@
-
+
@@ -2050,7 +2086,7 @@
-
+
@@ -2130,7 +2166,7 @@
-
+
@@ -2193,7 +2229,7 @@
-
+
@@ -2314,7 +2350,7 @@
-
+
@@ -2484,7 +2520,7 @@
-
+
@@ -2662,7 +2698,7 @@
-
+
@@ -2678,7 +2714,7 @@
-
+Unique signature for each version of a tool. <organisation><tool><version>
@@ -2704,6 +2740,21 @@
+
+Unique identifier for the tool. This should remain the same for every version of the tool.
+It will be used for the IMS LD import/export.
+
+
+
+
+
+
+Version of tool. Expected to be in format [major version.minor version] eg 1.2
+
+
+
+
+
@@ -2891,7 +2942,7 @@
-
+
@@ -3009,27 +3060,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -3051,12 +3088,19 @@
+
+
+
+
+
+
+
-
+
@@ -3111,7 +3155,7 @@
-
+
@@ -3166,7 +3210,7 @@
-
+
@@ -3199,7 +3243,7 @@
-
+
@@ -3254,7 +3298,7 @@
-
+
@@ -3287,7 +3331,7 @@
-
+
@@ -3334,7 +3378,7 @@
-
+
@@ -3387,7 +3431,7 @@
-
+
@@ -3440,7 +3484,7 @@
-
+
@@ -3473,7 +3517,7 @@
-
+
@@ -3540,7 +3584,7 @@
-
+
@@ -3573,7 +3617,7 @@
-
+
@@ -3609,7 +3653,7 @@
The main lookup is done on name, but given the small number of rows a complete table scan
should be fine. A name index would probably be about the same size as the table anyway.
-
+
@@ -3644,7 +3688,7 @@
Like lams_cr_workspace, there will usually be 0 or 1 workspace for each tool in LAMS, so this should be a pretty small table.
The main lookup is done on name, but given the small number of rows a complete table scan should be fine.
-
+
@@ -3673,19 +3717,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -3697,7 +3728,7 @@
-
+
@@ -3767,7 +3798,7 @@
It is the node_id and version_id combination that is the "real" key for this table.
-
+
@@ -3846,7 +3877,7 @@
-
+
@@ -3920,7 +3951,7 @@
A node can only belong to one parent - so each time a new version of a package is created, all the nodes are recreated.
-
+
@@ -4026,7 +4057,7 @@
-
+
@@ -4059,7 +4090,7 @@
-
+
@@ -4092,7 +4123,7 @@
-
+
@@ -4178,7 +4209,7 @@
-
+
@@ -4211,7 +4242,7 @@
-
+
@@ -4316,7 +4347,20 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -4337,7 +4381,7 @@
-
+
@@ -4368,6 +4412,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+All the lams_css_property values matching this lams_css_style make up the CSSStyleDeclaration for this
+style. It may be a "base" style for a theme, or it may be for a named visual element.
+Each style may have a subset of properties, such as "_tf"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_common/db/sql/create_lams_11_tables.sql
===================================================================
diff -u -rcdba68bf24f26a1ae8d8fbac9e15e531a42a39b6 -r4206c2b9c81db55b984029d55c41bef5abcb4788
--- lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision cdba68bf24f26a1ae8d8fbac9e15e531a42a39b6)
+++ lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -93,7 +93,6 @@
credential_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
, name VARCHAR(255) NOT NULL
, password VARCHAR(255) NOT NULL
- , wc_id BIGINT(20) UNSIGNED NOT NULL
, PRIMARY KEY (credential_id)
)TYPE=InnoDB;
ALTER TABLE lams_cr_credential COMMENT='Records the identification properties for a tool.';
@@ -116,6 +115,12 @@
, PRIMARY KEY (log_event_type_id)
)TYPE=InnoDB;
+CREATE TABLE lams_workspace_folder_content_type (
+ content_type_id INT(3) NOT NULL AUTO_INCREMENT
+ , description VARCHAR(64) NOT NULL
+ , PRIMARY KEY (content_type_id)
+)TYPE=InnoDB;
+
CREATE TABLE lams_authentication_method_type (
authentication_method_type_id INT(3) NOT NULL
, description VARCHAR(64) NOT NULL
@@ -181,6 +186,42 @@
REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
)TYPE=InnoDB;
+CREATE TABLE lams_css_theme_ve (
+ theme_ve_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , name VARCHAR(100) NOT NULL
+ , description VARCHAR(100)
+ , parent_id BIGINT(20)
+ , theme_flag TINYINT(1) NOT NULL DEFAULT 0
+ , PRIMARY KEY (theme_ve_id)
+ , INDEX (parent_id)
+ , CONSTRAINT FK_lams_css_theme_ve_2 FOREIGN KEY (parent_id)
+ REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+ALTER TABLE lams_css_theme_ve COMMENT='Stores both the Flash theme and visual element';
+
+CREATE TABLE lams_css_style (
+ style_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , theme_ve_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (style_id)
+ , INDEX (theme_ve_id)
+ , CONSTRAINT FK_lams_css_style_1 FOREIGN KEY (theme_ve_id)
+ REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+ALTER TABLE lams_css_style COMMENT='Groups lams_css_property into a CSSStyleDeclaration.';
+
+CREATE TABLE lams_css_property (
+ property_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , style_id BIGINT(20) NOT NULL
+ , name VARCHAR(255) NOT NULL
+ , value VARCHAR(100) NOT NULL
+ , style_subset VARCHAR(20)
+ , type TINYINT NOT NULL
+ , PRIMARY KEY (property_id)
+ -- , INDEX (style_id)
+ -- , CONSTRAINT FK_lams_css_property_1 FOREIGN KEY (style_id)
+ -- REFERENCES lams_css_style (style_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
CREATE TABLE lams_user (
user_id BIGINT(20) NOT NULL AUTO_INCREMENT
, login VARCHAR(20) NOT NULL
@@ -204,6 +245,9 @@
, authentication_method_id BIGINT(20) NOT NULL DEFAULT 0
, workspace_id BIGINT(20)
, base_organisation_id BIGINT(20) NOT NULL DEFAULT 0
+ , locale_language CHAR(2) NOT NULL DEFAULT 'en'
+ , locale_country CHAR(2)
+ , theme_id BIGINT(20)
, PRIMARY KEY (user_id)
, INDEX (authentication_method_id)
, CONSTRAINT FK_lams_user_1 FOREIGN KEY (authentication_method_id)
@@ -213,7 +257,10 @@
REFERENCES lams_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION
, INDEX (base_organisation_id)
, CONSTRAINT FK_lams_user_3 FOREIGN KEY (base_organisation_id)
- REFERENCES lams_organisation (organisation_id)
+ REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (theme_id)
+ , CONSTRAINT FK_lams_user_4 FOREIGN KEY (theme_id)
+ REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION
)TYPE=InnoDB;
CREATE UNIQUE INDEX UQ_lams_user_login ON lams_user (login ASC);
CREATE INDEX login ON lams_user (login ASC);
@@ -230,6 +277,8 @@
, date_read_only DATETIME
, user_id BIGINT(20) NOT NULL
, help_text TEXT
+ , online_instructions TEXT
+ , offline_instructions TEXT
, copy_type_id TINYINT(4) NOT NULL
, create_date_time DATETIME NOT NULL
, version VARCHAR(56)
@@ -287,57 +336,14 @@
REFERENCES lams_grouping (grouping_id) ON DELETE NO ACTION ON UPDATE NO ACTION
)TYPE=InnoDB;
-CREATE TABLE lams_user_organisation (
- user_organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT
- , organisation_id BIGINT(20) NOT NULL
- , user_id BIGINT(20) NOT NULL
- , PRIMARY KEY (user_organisation_id)
- , INDEX (organisation_id)
- , CONSTRAINT FK_lams_user_organisation_1 FOREIGN KEY (organisation_id)
- REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
- , INDEX (user_id)
- , CONSTRAINT FK_lams_user_organisation_2 FOREIGN KEY (user_id)
- REFERENCES lams_user (user_id) ON DELETE NO ACTION ON UPDATE NO ACTION
-)TYPE=InnoDB;
-
-CREATE TABLE lams_lesson (
- lesson_id BIGINT(20) NOT NULL AUTO_INCREMENT
- , learning_design_id BIGINT(20) NOT NULL
- , user_id BIGINT(20) NOT NULL
- , name VARCHAR(255) NOT NULL
- , description TEXT
- , create_date_time DATETIME NOT NULL
- , organisation_id BIGINT(20)
- , class_grouping_id BIGINT(20)
- , lesson_state_id INT(3) NOT NULL
- , start_date_time DATETIME
- , schedule_start_date_time DATETIME
- , end_date_time DATETIME
- , schedule_end_date_time DATETIME
- , PRIMARY KEY (lesson_id)
- , INDEX (learning_design_id)
- , CONSTRAINT FK_lams_lesson_1_1 FOREIGN KEY (learning_design_id)
- REFERENCES lams_learning_design (learning_design_id)
- , INDEX (user_id)
- , CONSTRAINT FK_lams_lesson_2 FOREIGN KEY (user_id)
- REFERENCES lams_user (user_id)
- , INDEX (organisation_id)
- , CONSTRAINT FK_lams_lesson_3 FOREIGN KEY (organisation_id)
- REFERENCES lams_organisation (organisation_id)
- , INDEX (lesson_state_id)
- , CONSTRAINT FK_lams_lesson_4 FOREIGN KEY (lesson_state_id)
- REFERENCES lams_lesson_state (lesson_state_id)
- , INDEX (class_grouping_id)
- , CONSTRAINT FK_lams_lesson_5 FOREIGN KEY (class_grouping_id)
- REFERENCES lams_grouping (grouping_id)
-)TYPE=InnoDB;
-
CREATE TABLE lams_tool (
tool_id BIGINT(20) NOT NULL AUTO_INCREMENT
, tool_signature VARCHAR(64) NOT NULL
, service_name VARCHAR(255) NOT NULL
, tool_display_name VARCHAR(255) NOT NULL
, description TEXT
+ , tool_identifier VARCHAR(64) NOT NULL
+ , tool_version VARCHAR(10) NOT NULL
, learning_library_id BIGINT(20)
, default_tool_content_id BIGINT(20)
, valid_flag TINYINT(1) NOT NULL DEFAULT 1
@@ -386,8 +392,6 @@
, learning_library_id BIGINT(20)
, create_date_time DATETIME NOT NULL
, run_offline_flag TINYINT(1) NOT NULL
- , offline_instructions TEXT
- , online_instructions TEXT
, max_number_of_options INT(5)
, min_number_of_options INT(5)
, options_instructions TEXT
@@ -440,6 +444,52 @@
REFERENCES lams_grouping_support_type (grouping_support_type_id)
)TYPE=InnoDB;
+CREATE TABLE lams_lesson (
+ lesson_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , learning_design_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , name VARCHAR(255) NOT NULL
+ , description TEXT
+ , create_date_time DATETIME NOT NULL
+ , organisation_id BIGINT(20)
+ , class_grouping_id BIGINT(20)
+ , lesson_state_id INT(3) NOT NULL
+ , start_date_time DATETIME
+ , schedule_start_date_time DATETIME
+ , end_date_time DATETIME
+ , schedule_end_date_time DATETIME
+ , PRIMARY KEY (lesson_id)
+ , INDEX (learning_design_id)
+ , CONSTRAINT FK_lams_lesson_1_1 FOREIGN KEY (learning_design_id)
+ REFERENCES lams_learning_design (learning_design_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_lesson_2 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (organisation_id)
+ , CONSTRAINT FK_lams_lesson_3 FOREIGN KEY (organisation_id)
+ REFERENCES lams_organisation (organisation_id)
+ , INDEX (lesson_state_id)
+ , CONSTRAINT FK_lams_lesson_4 FOREIGN KEY (lesson_state_id)
+ REFERENCES lams_lesson_state (lesson_state_id)
+ , INDEX (class_grouping_id)
+ , CONSTRAINT FK_lams_lesson_5 FOREIGN KEY (class_grouping_id)
+ REFERENCES lams_grouping (grouping_id)
+)TYPE=InnoDB;
+
+
+CREATE TABLE lams_user_organisation (
+ user_organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , organisation_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (user_organisation_id)
+ , INDEX (organisation_id)
+ , CONSTRAINT FK_lams_user_organisation_1 FOREIGN KEY (organisation_id)
+ REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_user_organisation_2 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
CREATE TABLE lams_learner_progress (
learner_progress_id BIGINT(20) NOT NULL AUTO_INCREMENT
, user_id BIGINT(20) NOT NULL
@@ -499,6 +549,7 @@
)TYPE=InnoDB;
ALTER TABLE lams_cr_node_version COMMENT='Represents a version of a node';
+
CREATE TABLE lams_user_organisation_role (
user_organisation_role_id BIGINT(20) NOT NULL AUTO_INCREMENT
, user_organisation_id BIGINT(20) NOT NULL
@@ -524,15 +575,9 @@
, unique_key VARCHAR(128) NOT NULL
, UNIQUE UQ_lams_tool_session_1 (unique_key)
, PRIMARY KEY (tool_session_id)
- , INDEX (group_id)
- , CONSTRAINT FK_lams_tool_session_1 FOREIGN KEY (group_id)
- REFERENCES lams_group (group_id)
, INDEX (tool_session_state_id)
, CONSTRAINT FK_lams_tool_session_4 FOREIGN KEY (tool_session_state_id)
REFERENCES lams_tool_session_state (tool_session_state_id)
- , INDEX (group_id)
- , CONSTRAINT FK_lams_tool_session_3 FOREIGN KEY (group_id)
- REFERENCES lams_group (group_id)
, INDEX (user_id)
, CONSTRAINT FK_lams_tool_session_5 FOREIGN KEY (user_id)
REFERENCES lams_user (user_id)
@@ -542,6 +587,9 @@
, INDEX (activity_id)
, CONSTRAINT FK_lams_tool_session_8 FOREIGN KEY (activity_id)
REFERENCES lams_learning_activity (activity_id)
+ , INDEX (group_id)
+ , CONSTRAINT FK_lams_tool_session_1 FOREIGN KEY (group_id)
+ REFERENCES lams_group (group_id)
)TYPE=InnoDB;
CREATE TABLE lams_progress_completed (
@@ -650,6 +698,28 @@
REFERENCES lams_log_event_type (log_event_type_id)
)TYPE=InnoDB;
+CREATE TABLE lams_workspace_folder_content (
+ folder_content_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , content_type_id INT(3) NOT NULL
+ , name VARCHAR(64) NOT NULL
+ , description VARCHAR(64) NOT NULL
+ , create_date_time DATETIME NOT NULL
+ , last_modified_date DATETIME NOT NULL
+ , workspace_folder_id BIGINT(20) NOT NULL
+ , uuid BIGINT(20)
+ , version_id BIGINT(20)
+ , mime_type VARCHAR(10) NOT NULL
+ , UNIQUE unique_content_name (name, workspace_folder_id, mime_type)
+ , UNIQUE unique_node_version (workspace_folder_id, uuid, version_id)
+ , PRIMARY KEY (folder_content_id)
+ , INDEX (workspace_folder_id)
+ , CONSTRAINT FK_lams_workspace_folder_content_1 FOREIGN KEY (workspace_folder_id)
+ REFERENCES lams_workspace_folder (workspace_folder_id)
+ , INDEX (content_type_id)
+ , CONSTRAINT FK_lams_workspace_folder_content_2 FOREIGN KEY (content_type_id)
+ REFERENCES lams_workspace_folder_content_type (content_type_id)
+)TYPE=InnoDB;
+
CREATE TABLE lams_learning_transition (
transition_id BIGINT(20) NOT NULL AUTO_INCREMENT
, transition_ui_id INT(11)
@@ -673,30 +743,3 @@
REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION
)TYPE=InnoDB;
-CREATE TABLE lams_workspace_folder_content_type (
- content_type_id INT(3) NOT NULL AUTO_INCREMENT
- , description VARCHAR(64) NOT NULL
- , PRIMARY KEY (content_type_id)
-)TYPE=InnoDB;
-
-CREATE TABLE lams_workspace_folder_content (
- folder_content_id BIGINT(20) NOT NULL AUTO_INCREMENT
- , content_type_id INT(3) NOT NULL
- , name VARCHAR(64) NOT NULL
- , description VARCHAR(64) NOT NULL
- , create_date_time DATETIME NOT NULL
- , last_modified_date DATETIME NOT NULL
- , workspace_folder_id BIGINT(20) NOT NULL
- , uuid BIGINT(20)
- , version_id BIGINT(20)
- , mime_type VARCHAR(10)NOT NULL
- , UNIQUE unique_content_name (name,workspace_folder_id,mime_type)
- , UNIQUE unique_node_version (workspace_folder_id,uuid,version_id)
- , PRIMARY KEY (folder_content_id)
- , INDEX (workspace_folder_id)
- , CONSTRAINT FK_lams_workspace_folder_content_1 FOREIGN KEY (workspace_folder_id)
- REFERENCES lams_workspace_folder (workspace_folder_id)
- , INDEX (content_type_id)
- , CONSTRAINT FK_lams_workspace_folder_content_2 FOREIGN KEY (content_type_id)
- REFERENCES lams_workspace_folder_content_type (content_type_id)
-)TYPE=InnoDB;
\ No newline at end of file
Index: lams_common/db/sql/drop_lams_11_tables.sql
===================================================================
diff -u -r5ef30da5c8c3f97d81d42ac4abed7430f8261ef3 -r4206c2b9c81db55b984029d55c41bef5abcb4788
--- lams_common/db/sql/drop_lams_11_tables.sql (.../drop_lams_11_tables.sql) (revision 5ef30da5c8c3f97d81d42ac4abed7430f8261ef3)
+++ lams_common/db/sql/drop_lams_11_tables.sql (.../drop_lams_11_tables.sql) (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -11,6 +11,9 @@
DROP TABLE IF EXISTS lams_cr_node_version_property;
DROP TABLE IF EXISTS lams_cr_workspace;
DROP TABLE IF EXISTS lams_cr_workspace_credential;
+DROP TABLE IF EXISTS lams_css_property;
+DROP TABLE IF EXISTS lams_css_style;
+DROP TABLE IF EXISTS lams_css_theme_ve;
DROP TABLE IF EXISTS lams_gate_activity_level;
DROP TABLE IF EXISTS lams_group;
DROP TABLE IF EXISTS lams_grouping;
@@ -42,6 +45,7 @@
DROP TABLE IF EXISTS lams_user_group;
DROP TABLE IF EXISTS lams_user_organisation;
DROP TABLE IF EXISTS lams_user_organisation_role;
+DROP TABLE IF EXISTS lams_user_preference;
DROP TABLE IF EXISTS lams_workspace;
DROP TABLE IF EXISTS lams_workspace_folder;
DROP TABLE IF EXISTS lams_workspace_folder_type;
Index: lams_common/db/sql/insert_survey_design.sql
===================================================================
diff -u -r399bf4a51dc4e009339b8d30e9380d99e431ba30 -r4206c2b9c81db55b984029d55c41bef5abcb4788
--- lams_common/db/sql/insert_survey_design.sql (.../insert_survey_design.sql) (revision 399bf4a51dc4e009339b8d30e9380d99e431ba30)
+++ lams_common/db/sql/insert_survey_design.sql (.../insert_survey_design.sql) (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -7,15 +7,15 @@
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(100,6,'Survey Template','Survey',10,20,null,'Help Text for Activity',
1,null,0,0,
-2,6,'20050101','Offline Instructions ',0,
+2,6,'20050101',0,
null,null,6,17,
null,null,null,'SurveyImage',
-1,0,'Online Instructions',1);
+1,0,1);
Index: lams_common/db/sql/insert_test_data.sql
===================================================================
diff -u -r2510a4c2308e8aef161b49bba004d6ed2d15cf09 -r4206c2b9c81db55b984029d55c41bef5abcb4788
--- lams_common/db/sql/insert_test_data.sql (.../insert_test_data.sql) (revision 2510a4c2308e8aef161b49bba004d6ed2d15cf09)
+++ lams_common/db/sql/insert_test_data.sql (.../insert_test_data.sql) (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -48,21 +48,34 @@
INSERT INTO lams_user_organisation_role VALUES (17, 9, 3);
INSERT INTO lams_user_organisation_role VALUES (18, 10,3);
-INSERT INTO lams_user VALUES(1, 'sysadmin','sysadmin','Mr','Fei','Yang',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'fyang@melcoe.mq.edu.au',0,NOW(),1,null,1);
-INSERT INTO lams_user VALUES(2, 'test','test','Mr','Kevin','Han',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'khan@melcoe.mq.edu.au',0,NOW(),3,null,2);
-INSERT INTO lams_user VALUES(3, 'lamskh01','dummy','Mr','Jacky','Fang',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'jfang@melcoe.mq.edu.au',0,NOW(),2,null,3);
+-- themes and styles
+INSERT INTO lams_css_style (style_id, theme_ve_id) VALUES (1,1);
+INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (1, 1, "borderStyle", "outset", NULL, 1);
+INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (2, 1, "color", "12452097", "_tf", 3);
+INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (3, 1, "rollOverColor", "16711680", NULL, 2);
+INSERT INTO lams_css_style (style_id,theme_ve_id) VALUES (2,2);
+INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (4, 2, "display", "block", "_tf", 1);
+INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (5, 2, "selectionColor", "16711681", NULL, 3);
+
+INSERT INTO lams_css_theme_ve (theme_ve_id, name, description, parent_id, theme_flag) VALUES (1, "ruby", "cut down ruby theme for testing", null, 1);
+INSERT INTO lams_css_theme_ve (theme_ve_id, name, description, parent_id, theme_flag) VALUES (2, "button", null, 1, 0);
+
+-- users
+INSERT INTO lams_user VALUES(1, 'sysadmin','sysadmin','Mr','Fei','Yang',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'fyang@melcoe.mq.edu.au',0,NOW(),1,null,1,'en','au',1);
+INSERT INTO lams_user VALUES(2, 'test','test','Mr','Kevin','Han',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'khan@melcoe.mq.edu.au',0,NOW(),3,null,2,'mi','nz',1);
+INSERT INTO lams_user VALUES(3, 'lamskh01','dummy','Mr','Jacky','Fang',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'jfang@melcoe.mq.edu.au',0,NOW(),2,null,3,'en','nz',1);
+
insert into lams_user (user_id,login,password,title,first_name,last_name,address_line_1,address_line_2,address_line_3,
city,state,country,day_phone,evening_phone,mobile_phone,
fax,email,
disabled_flag,create_date,authentication_method_id,workspace_id,
base_organisation_id)
values
-(4,'mminhas','mminhas','Ms','Manpreet','Minhas','170-22','Great Western Highway',null,
-'Parramatta','NSW','Australia','029509061','0298938052','0405651097',
-'0209509062','mminhas@melcoe.mq.edu.au',
-0,'20041223',1,6,
-4);
+(4,'mmmmmmm','mmmmmmm','Ms','Mary','Morgan','99','First Ave',null,
+'Parramatta','NSW','Australia','0295099999','0298939999','0499999999',
+'0299999999','mmmmmmm@xx.os',
+0,'20041223',1,6,4);
insert into lams_workspace_folder (workspace_folder_id,parent_folder_id,name,workspace_id,user_id,create_date_time,last_modified_date_time,lams_workspace_folder_type_id)
values(1,null,'ROOT',1,1,'20041223','20041223',1);
@@ -125,105 +138,105 @@
-- Populates the lams_tool table with default tools corresponding to each of the above libraries
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(1,'notebook_signature','notebookService','Notebook','Notebook Description',1,
+values(1,'notebook_signature','notebookService','Notebook','Notebook Description','notebook','1.1',1,
2,0,1,0,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,1);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(2,'noticeboard_signature','noticeboardService','Noticeboard','Noticeboard Description',2,
+values(2,'noticeboard_signature','noticeboardService','Noticeboard','Noticeboard Description','noticeboard','1.1',2,
2,1,1,0,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,2);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(3,'multiple_choice_signature','multipleChoiceService','Multiple Choice','Multiple Coice Description',3,
+values(3,'multiple_choice_signature','multipleChoiceService','Multiple Choice','Multiple Coice Description','multiple choice','1.1',3,
2,1,1,1,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,3);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(4,'question_answer_signature','questionAnswerService','Question and Answers','Question and Answers Description',4,
+values(4,'question_answer_signature','questionAnswerService','Question and Answers','Question and Answers Description','q & a','1.1',4,
2,1,1,1,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,4);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(5,'message_board_signature','messageBoardService','Message Board','Message Board Description',5,
+values(5,'message_board_signature','messageBoardService','Message Board','Message Board Description','forum','1.1',5,
2,1,1,1,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,5);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(6,'survey_signature','surveyService','Survey','Survey Description',6,
+values(6,'survey_signature','surveyService','Survey','Survey Description','survey','1.1',6,
2,1,1,1,1,
'/lams_tool_survey/tool/survey/survey.do?method=loadQuestionnaire','/lams_tool_survey/tool/survey/authoring.do?method=loadSurvey','define_later_url','export_portfolio_url',
'/lams_tool_survey/tool/survey/report.do?method=loadMonitorReport','contribute_url','moderation_url',
1,6);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(7,'chat_signature','chatService','Chat','Chat Description',7,
+values(7,'chat_signature','chatService','Chat','Chat Description','chat','1.1',7,
2,1,1,1,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,7);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(8,'shared_resources_signature','sharedResourcesService','Shared Resources','Shared Resources Description',8,
+values(8,'shared_resources_signature','sharedResourcesService','Shared Resources','Shared Resources Description','shared resources','1.1',8,
2,1,0,1,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,8);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(9,'voting_signature','votingService','Voting','Voting Description',9,
+values(9,'voting_signature','votingService','Voting','Voting Description','voting','1.1',9,
2,1,1,1,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,9);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(10,'submit_files_signature','submitFilesService','Submit Files','Submit Files Description',10,
+values(10,'submit_files_signature','submitFilesService','Submit Files','Submit Files Description','submit files','1.1',10,
2,1,1,1,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,10);
-insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id,
+insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id,
grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag,
learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url,
valid_flag,learning_library_id)
-values(11,'instant_messaging_signature','instantMessagingService','Instant Messaging','Instant Messaging Description',11,
+values(11,'instant_messaging_signature','instantMessagingService','Instant Messaging','Instant Messaging Description','instant messaging','1.1',11,
2,1,1,1,1,
'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url',
1,11);
@@ -280,292 +293,292 @@
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(1,1,'Notebook Template','Notebook',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,1,'20050101','Offline Instructions ',0,
+null,1,'20050101',0,
null,null,1,1,
null,null,null,'/lams/images/icon_journal.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(2,2,'NoticeBoard Template','NoticeBoard',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,2,'20050101','Offline Instructions ',0,
+null,2,'20050101',0,
null,null,2,2,
null,null,null,'/lams/images/icon_noticeboard.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(3,3,'Multiple Choice Template','Multiple Choice',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,3,'20050101','Offline Instructions ',0,
+null,3,'20050101',0,
null,null,3,3,
null,null,null,'missing.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(4,4,'Question and Answer Template','Question and Answer',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,4,'20050101','Offline Instructions ',0,
+null,4,'20050101',0,
null,null,4,4,
null,null,null,'/lams/tool/laqa/images/icon_questionanswer.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(5,5,'MessageBoard Template','MessageBoard',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,5,'20050101','Offline Instructions ',0,
+null,5,'20050101',0,
null,null,5,5,
null,null,null,'/lams/images/icon_messageboard.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(6,6,'Survey Template','Survey',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,6,'20050101','Offline Instructions ',0,
+null,6,'20050101',0,
null,null,6,6,
null,null,null,'/lams/images/icon_survey.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(7,7,'Chat Template','Chat',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,7,'20050101','Offline Instructions ',0,
+null,7,'20050101',0,
null,null,7,7,
null,null,null,'/lams/images/icon_chat.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(8,8,'Shared Resources Template','Shared Resources',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,8,'20050101','Offline Instructions ',0,
+null,8,'20050101',0,
null,null,8,8,
null,null,null,'/lams/images/icon_singleresource.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(9,9,'Voting Template','Voting',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,9,'20050101','Offline Instructions ',0,
+null,9,'20050101',0,
null,null,9,9,
null,null,null,'/lams/images/icon_ranking.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(10,10,'Submit Files Template','Submit Files',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,10,'20050101','Offline Instructions ',0,
+null,10,'20050101',0,
null,null,10,10,
null,null,null,'/lams/images/icon_reportsubmission.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(11,11,'Instant Messaging Template','Instant Messaging',10,20,null,'Help Text for Activity',
1,null,0,0,
-null,11,'20050101','Offline Instructions ',0,
+null,11,'20050101',0,
null,null,11,11,
null,null,null,'missing.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(12,12,'Optional Activity Description','Optional Activity Title',10,20,null,'Help Text for Activity',
7,null,1,0,
-1,null,'20050101','Offline Instructions ',0,
+1,null,'20050101',0,
1,1,null,null,
null,'20050101','20050101','missing.swf',
-3,1,'Online Instructions',1);
+3,1,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(13,13,'Parallel Activity Description','Parallel Activity Title',10,20,null,'Help Text for Activity',
6,null,1,0,
-1,null,'20050101','Parallel Activity Offline Instructions ',0,
+1,null,'20050101',0,
null,null,null,null,
null,null,null,'missing.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(14,14,'Sequence Activity Description','Sequence Activity Title',10,20,null,'Help Text for Activity',
8,null,1,0,
-1,null,'20050101','Sequence Activity Offline Instructions ',0,
+1,null,'20050101',0,
null,null,null,null,
null,null,null,'missing.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(15,1,'Notebook Activity Description','Notebook Activity Title',10,20,null,'Help Text for Activity',
1,null,1,0,
-1,1,'20050101','Notebook Activity Offline Instructions ',0,
+1,1,'20050101',0,
null,null,1,12,
null,null,null,'/lams/images/icon_journal.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(16,2,'NoticeBoard Activity','NoticeBoard Activity',10,20,12,'Help Text for Activity',
1,null,0,0,
-1,2,'20050101','NoticeBoard Activity Offline Instructions ',0,
+1,2,'20050101',0,
null,null,2,13,
null,null,null,'/lams/images/icon_noticeboard.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(17,3,'Multiple Choice Activity ','Multiple Choice',10,20,12,'Help Text for Activity',
1,null,1,0,
-1,3,'20050101','Tool Activity Offline Instructions ',0,
+1,3,'20050101',0,
null,null,3,14,
null,null,null,'missing.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(18,4,'Question and Answer Activity','Question and Answer',10,20,13,'Help Text for Activity',
1,null,0,1,
-1,4,'20050101','Tool Activity Offline Instructions ',0,
+1,4,'20050101',0,
null,null,4,15,
null,null,null,'/lams/tool/laqa/images/icon_questionanswer.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(19,5,'Message Board Activity','Message Board',10,20,13,'Help Text for Activity',
1,100,1,0,
-1,5,'20050101','Tool Activity Offline Instructions ',0,
+1,5,'20050101',0,
null,null,5,16,
null,null,null,'/lams/images/icon_messageboard.swf',
-1,0,'Online Instructions',1);
+1,0,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(20,6,'Survey Activity','Survey Title',10,20,null,'Help Text for Activity',
1,null,0,1,
-1,6,'20050101','Tool Activity Offline Instructions ',0,
+1,6,'20050101',0,
null,null,6,17,
null,null,null,'/lams/images/icon_survey.swf',
-1,0,'Online Instructions',1);
+1,0,1);
insert into lams_learning_activity
(activity_id,activity_ui_id,
@@ -574,7 +587,7 @@
parent_activity_id,parent_ui_id,learning_activity_type_id,
grouping_id,grouping_ui_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,
-run_offline_flag,offline_instructions,
+run_offline_flag,
max_number_of_options,min_number_of_options,options_instructions,
tool_id,tool_content_id,
gate_activity_level_id,gate_open_flag,
@@ -583,15 +596,15 @@
library_activity_ui_image,
create_grouping_id,create_grouping_ui_id,
library_activity_id,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(21,7,
'Chat Activity Description','Chat Title','Help Text for Chat Activity',
10,20,
null,null,1,
99,99,0,0,
1,7,'20050101',
-1,'Tool Activity Offline Instructions ',
+1,
null,null,null,
7,18,
null,null,
@@ -600,22 +613,22 @@
'/lams/images/icon_chat.swf',
null,null,
7,
-2,1,'Online Instructions',1);
+2,1,1);
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,offline_instructions,run_offline_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,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(22,8,'Shared Resources Activity','Shared Resources',10,20,14,'Help Text for Activity',
1,null,0,0,
-1,8,'20050101','Tool Activity Offline Instructions ',0,
+1,8,'20050101',0,
null,null,8,19,
null,null,null,'/lams/images/icon_singleresource.swf',
-1,0,'Online Instructions',1);
+1,0,1);
-- Sample GroupingActivity with RandomGrouping
@@ -626,7 +639,7 @@
parent_activity_id,parent_ui_id,learning_activity_type_id,
grouping_id,grouping_ui_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,
-run_offline_flag,offline_instructions,
+run_offline_flag,
max_number_of_options,min_number_of_options,options_instructions,
tool_id,tool_content_id,
gate_activity_level_id,gate_open_flag,
@@ -635,15 +648,15 @@
library_activity_ui_image,
create_grouping_id,create_grouping_ui_id,
library_activity_id,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(23,23,
'Random Grouping Activity Description','RandomGroupingActivity Title','Help Text for RandomGroupingActivity',
10,20,
null,null,2,
null,null,0,0,
1,null,'20050101',
-0,null,
+0,
null,null,null,
null,null,
null,null,
@@ -652,7 +665,7 @@
'missing.swf',
99,99,
null,
-1,0,'Online Instructions',1);
+1,0,1);
insert into lams_learning_activity
(activity_id,activity_ui_id,
@@ -661,7 +674,7 @@
parent_activity_id,parent_ui_id,learning_activity_type_id,
grouping_id,grouping_ui_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,
-run_offline_flag,offline_instructions,
+run_offline_flag,
max_number_of_options,min_number_of_options,options_instructions,
tool_id,tool_content_id,
gate_activity_level_id,gate_open_flag,
@@ -670,15 +683,15 @@
library_activity_ui_image,
create_grouping_id,create_grouping_ui_id,
library_activity_id,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(24,24,
'QNA Activity Description','QNA Activity Title','Help Text for QNA Activity',
10,20,
null,null,1,
99,99,0,1,
1,4,'20050101',
-1,'QNA Activity Offline Instructions ',
+1,
null,null,null,
4,20,
null,null,
@@ -687,7 +700,7 @@
'/lams/tool/laqa/images/icon_questionanswer.swf',
null,null,
4,
-2,1,'Online Instructions',1);
+2,1,1);
insert into lams_learning_activity
(activity_id,activity_ui_id,
@@ -696,7 +709,7 @@
parent_activity_id,parent_ui_id,learning_activity_type_id,
grouping_id,grouping_ui_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,
-run_offline_flag,offline_instructions,
+run_offline_flag,
max_number_of_options,min_number_of_options,options_instructions,
tool_id,tool_content_id,
gate_activity_level_id,gate_open_flag,
@@ -705,15 +718,15 @@
library_activity_ui_image,
create_grouping_id,create_grouping_ui_id,
library_activity_id,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(25,25,
'QNA Activity Description','QNA Activity Title','Help Text for QNA Activity',
10,20,
14,14,1,
null,null,1,1,
1,4,'20050101',
-1,'QNA Activity Offline Instructions ',
+1,
null,null,null,
4,21,
null,null,
@@ -722,7 +735,7 @@
'/lams/tool/laqa/images/icon_questionanswer.swf',
null,null,
4,
-1,0,'Online Instructions',1);
+1,0,1);
@@ -733,7 +746,7 @@
parent_activity_id,parent_ui_id,learning_activity_type_id,
grouping_id,grouping_ui_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,
-run_offline_flag,offline_instructions,
+run_offline_flag,
max_number_of_options,min_number_of_options,options_instructions,
tool_id,tool_content_id,
gate_activity_level_id,gate_open_flag,
@@ -742,15 +755,15 @@
library_activity_ui_image,
create_grouping_id,create_grouping_ui_id,
library_activity_id,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(26,26,
'Synch Gate','Synch Gate Activity','Help Text for Synch Gate',
10,20,
null,null,3,
null,null,0,0,
1,null,'20050101',
-0,null,
+0,
null,null,null,
null,null,
3,0,
@@ -759,7 +772,7 @@
'missing.swf',
null,null,
null,
-1,0,'Online Instructions',1);
+1,0,1);
insert into lams_learning_activity
(activity_id,activity_ui_id,
@@ -768,7 +781,7 @@
parent_activity_id,parent_ui_id,learning_activity_type_id,
grouping_id,grouping_ui_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,
-run_offline_flag,offline_instructions,
+run_offline_flag,
max_number_of_options,min_number_of_options,options_instructions,
tool_id,tool_content_id,
gate_activity_level_id,gate_open_flag,
@@ -777,15 +790,15 @@
library_activity_ui_image,
create_grouping_id,create_grouping_ui_id,
library_activity_id,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(27,27,
'Schedule Gate','Schedule Gate Activity','Help Text for Schedule Gate',
10,20,
null,null,4,
null,null,0,0,
1,null,'20050101',
-0,null,
+0,
null,null,null,
null,null,
3,0,
@@ -794,7 +807,7 @@
'missing.swf',
null,null,
null,
-1,0,'Online Instructions',1);
+1,0,1);
insert into lams_learning_activity
(activity_id,activity_ui_id,
@@ -803,7 +816,7 @@
parent_activity_id,parent_ui_id,learning_activity_type_id,
grouping_id,grouping_ui_id,order_id,define_later_flag,
learning_design_id,learning_library_id,create_date_time,
-run_offline_flag,offline_instructions,
+run_offline_flag,
max_number_of_options,min_number_of_options,options_instructions,
tool_id,tool_content_id,
gate_activity_level_id,gate_open_flag,
@@ -812,15 +825,15 @@
library_activity_ui_image,
create_grouping_id,create_grouping_ui_id,
library_activity_id,
-grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id)
+grouping_support_type_id, apply_grouping_flag,activity_category_id)
values
(28,28,
'Permission Gate','Permission Gate Activity','Help Text for Permission Gate',
10,20,
null,null,5,
null,null,0,0,
1,null,'20050101',
-0,null,
+0,
null,null,null,
null,null,
3,0,
@@ -829,7 +842,7 @@
'missing.swf',
null,null,
null,
-1,0,'Online Instructions',1);
+1,0,1);
-- Populates the lams_learning_transition table with various transitions for the dummy design
@@ -887,10 +900,12 @@
insert into lams_learning_design(learning_design_ui_id,description,title,first_activity_id,max_id,valid_design_flag,
read_only_flag,user_id,help_text,copy_type_id,create_date_time,version,
- parent_learning_design_id,workspace_folder_id)
+ parent_learning_design_id,workspace_folder_id,
+ online_instructions,offline_instructions)
values
(1,'Test Learning Design','Test Learning Design title',20,1,1,0,1,
- 'Help Text',1,'20041223','1.0',null,2);
+ 'Help Text',1,'20041223','1.0',null,2,
+ 'Online instructions', 'Offline instructions');
-- insert the test data for the content repository
INSERT INTO lams_cr_credential (credential_id, name, password) VALUES (1, 'atool','atool');
Index: lams_common/db/sql/lams_11.sql
===================================================================
diff -u
--- lams_common/db/sql/lams_11.sql (revision 0)
+++ lams_common/db/sql/lams_11.sql (revision 4206c2b9c81db55b984029d55c41bef5abcb4788)
@@ -0,0 +1,743 @@
+CREATE TABLE lams_gate_activity_level (
+ gate_activity_level_id INT(11) NOT NULL DEFAULT 0
+ , description VARCHAR(128) NOT NULL
+ , PRIMARY KEY (gate_activity_level_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_grouping_type (
+ grouping_type_id INT(11) NOT NULL
+ , description VARCHAR(128) NOT NULL
+ , PRIMARY KEY (grouping_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learning_activity_type (
+ learning_activity_type_id INT(11) NOT NULL DEFAULT 0
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (learning_activity_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learning_library (
+ learning_library_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , description TEXT
+ , title VARCHAR(255)
+ , valid_flag TINYINT(1) NOT NULL DEFAULT 1
+ , create_date_time DATETIME NOT NULL
+ , PRIMARY KEY (learning_library_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_organisation_type (
+ organisation_type_id INT(3) NOT NULL
+ , name VARCHAR(64) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (organisation_type_id)
+)TYPE=InnoDB;
+CREATE UNIQUE INDEX UQ_lams_organisation_type_name ON lams_organisation_type (name ASC);
+
+CREATE TABLE lams_role (
+ role_id INT(6) NOT NULL DEFAULT 0
+ , name VARCHAR(64) NOT NULL
+ , description TEXT
+ , create_date DATETIME NOT NULL
+ , PRIMARY KEY (role_id)
+)TYPE=InnoDB;
+CREATE INDEX gname ON lams_role (name ASC);
+
+CREATE TABLE lams_tool_session_state (
+ tool_session_state_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (tool_session_state_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_lesson_state (
+ lesson_state_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (lesson_state_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_tool_session_type (
+ tool_session_type_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (tool_session_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_license (
+ license_id BIGINT(20) NOT NULL
+ , name VARCHAR(200) NOT NULL
+ , code VARCHAR(20) NOT NULL
+ , url VARCHAR(256)
+ , default_flag TINYINT(1) NOT NULL DEFAULT 0
+ , picture_url VARCHAR(256)
+ , PRIMARY KEY (license_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_copy_type (
+ copy_type_id TINYINT(4) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (copy_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_activity_category (
+ activity_category_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (activity_category_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_cr_workspace (
+ workspace_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , name VARCHAR(255) NOT NULL
+ , PRIMARY KEY (workspace_id)
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_workspace COMMENT='Content repository workspace';
+
+CREATE TABLE lams_cr_credential (
+ credential_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , name VARCHAR(255) NOT NULL
+ , password VARCHAR(255) NOT NULL
+ , PRIMARY KEY (credential_id)
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_credential COMMENT='Records the identification properties for a tool.';
+
+CREATE TABLE lams_workspace_folder_type (
+ lams_workspace_folder_type_id INT(3) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (lams_workspace_folder_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_grouping_support_type (
+ grouping_support_type_id INT(3) NOT NULL
+ , description VARCHAR(64) NOT NULL
+ , PRIMARY KEY (grouping_support_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_log_event_type (
+ log_event_type_id INT(5) NOT NULL
+ , description VARCHAR(255) NOT NULL
+ , PRIMARY KEY (log_event_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_workspace_folder_content_type (
+ content_type_id INT(3) NOT NULL AUTO_INCREMENT
+ , description VARCHAR(64) NOT NULL
+ , PRIMARY KEY (content_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_authentication_method_type (
+ authentication_method_type_id INT(3) NOT NULL
+ , description VARCHAR(64) NOT NULL
+ , PRIMARY KEY (authentication_method_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_authentication_method (
+ authentication_method_id BIGINT(20) NOT NULL
+ , authentication_method_type_id INT(3) NOT NULL DEFAULT 0
+ , authentication_method_name VARCHAR(255) NOT NULL
+ , UNIQUE UQ_lams_authentication_method_1 (authentication_method_name)
+ , PRIMARY KEY (authentication_method_id)
+ , INDEX (authentication_method_type_id)
+ , CONSTRAINT FK_lams_authorization_method_1 FOREIGN KEY (authentication_method_type_id)
+ REFERENCES lams_authentication_method_type (authentication_method_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_workspace_folder (
+ workspace_folder_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , parent_folder_id BIGINT(20)
+ , name VARCHAR(64) NOT NULL
+ , workspace_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , create_date_time DATETIME NOT NULL
+ , last_modified_date_time DATETIME
+ , lams_workspace_folder_type_id INT(3) NOT NULL
+ , PRIMARY KEY (workspace_folder_id)
+ , INDEX (parent_folder_id)
+ , CONSTRAINT FK_lams_workspace_folder_2 FOREIGN KEY (parent_folder_id)
+ REFERENCES lams_workspace_folder (workspace_folder_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (lams_workspace_folder_type_id)
+ , CONSTRAINT FK_lams_workspace_folder_4 FOREIGN KEY (lams_workspace_folder_type_id)
+ REFERENCES lams_workspace_folder_type (lams_workspace_folder_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_workspace (
+ workspace_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , root_folder_id BIGINT(20)
+ , name VARCHAR(255)
+ , PRIMARY KEY (workspace_id)
+ , INDEX (root_folder_id)
+ , CONSTRAINT FK_lams_workspace_1 FOREIGN KEY (root_folder_id)
+ REFERENCES lams_workspace_folder (workspace_folder_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_user (
+ user_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , login VARCHAR(20) NOT NULL
+ , password VARCHAR(50) NOT NULL
+ , title VARCHAR(32)
+ , first_name VARCHAR(64)
+ , last_name VARCHAR(128)
+ , address_line_1 VARCHAR(64)
+ , address_line_2 VARCHAR(64)
+ , address_line_3 VARCHAR(64)
+ , city VARCHAR(64)
+ , state VARCHAR(64)
+ , country VARCHAR(64)
+ , day_phone VARCHAR(64)
+ , evening_phone VARCHAR(64)
+ , mobile_phone VARCHAR(64)
+ , fax VARCHAR(64)
+ , email VARCHAR(128)
+ , disabled_flag TINYINT(1) NOT NULL DEFAULT 0
+ , create_date DATETIME NOT NULL
+ , authentication_method_id BIGINT(20) NOT NULL DEFAULT 0
+ , workspace_id BIGINT(20)
+ , base_organisation_id BIGINT(20) NOT NULL DEFAULT 0
+ , locale_language CHAR(2) NOT NULL DEFAULT 'en'
+ , locale_country CHAR(2)
+ , theme_id BIGINT(20)
+ , PRIMARY KEY (user_id)
+ , INDEX (authentication_method_id)
+ , CONSTRAINT FK_lams_user_1 FOREIGN KEY (authentication_method_id)
+ REFERENCES lams_authentication_method (authentication_method_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (workspace_id)
+ , CONSTRAINT FK_lams_user_2 FOREIGN KEY (workspace_id)
+ REFERENCES lams_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (base_organisation_id)
+ , CONSTRAINT FK_lams_user_3 FOREIGN KEY (base_organisation_id)
+ REFERENCES lams_organisation (organisation_id)
+ , INDEX (theme_id)
+ , CONSTRAINT FK_lams_user_4 FOREIGN KEY (theme_id)
+ REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+CREATE UNIQUE INDEX UQ_lams_user_login ON lams_user (login ASC);
+CREATE INDEX login ON lams_user (login ASC);
+
+CREATE TABLE lams_learning_design (
+ learning_design_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , learning_design_ui_id INT(11)
+ , description TEXT
+ , title VARCHAR(255)
+ , first_activity_id BIGINT(20)
+ , max_id INT(11)
+ , valid_design_flag TINYINT(4) NOT NULL
+ , read_only_flag TINYINT(4) NOT NULL
+ , date_read_only DATETIME
+ , user_id BIGINT(20) NOT NULL
+ , help_text TEXT
+ , online_instructions TEXT
+ , offline_instructions TEXT
+ , copy_type_id TINYINT(4) NOT NULL
+ , create_date_time DATETIME NOT NULL
+ , version VARCHAR(56)
+ , parent_learning_design_id BIGINT(20)
+ , workspace_folder_id BIGINT(20)
+ , duration BIGINT(38)
+ , license_id BIGINT(20)
+ , license_text TEXT
+ , lesson_org_id BIGINT(20)
+ , lesson_org_name VARCHAR(255)
+ , lesson_id BIGINT(20)
+ , lesson_start_date_time DATETIME
+ , lesson_name VARCHAR(255)
+ , last_modified_date_time DATETIME
+ , PRIMARY KEY (learning_design_id)
+ , INDEX (parent_learning_design_id)
+ , CONSTRAINT FK_lams_learning_design_2 FOREIGN KEY (parent_learning_design_id)
+ REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_learning_design_3 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (workspace_folder_id)
+ , CONSTRAINT FK_lams_learning_design_4 FOREIGN KEY (workspace_folder_id)
+ REFERENCES lams_workspace_folder (workspace_folder_id)
+ , INDEX (license_id)
+ , CONSTRAINT FK_lams_learning_design_5 FOREIGN KEY (license_id)
+ REFERENCES lams_license (license_id)
+ , INDEX (copy_type_id)
+ , CONSTRAINT FK_lams_learning_design_6 FOREIGN KEY (copy_type_id)
+ REFERENCES lams_copy_type (copy_type_id)
+)TYPE=InnoDB;
+CREATE INDEX idx_design_first_act ON lams_learning_design (first_activity_id ASC);
+
+CREATE TABLE lams_grouping (
+ grouping_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , grouping_ui_id INT(11)
+ , grouping_type_id INT(11) NOT NULL
+ , number_of_groups INT(11)
+ , learners_per_group INT(11)
+ , staff_group_id BIGINT(20) DEFAULT 0
+ , max_number_of_groups INT(3)
+ , PRIMARY KEY (grouping_id)
+ , INDEX (grouping_type_id)
+ , CONSTRAINT FK_lams_learning_grouping_1 FOREIGN KEY (grouping_type_id)
+ REFERENCES lams_grouping_type (grouping_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_group (
+ group_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , grouping_id BIGINT(20) NOT NULL
+ , order_id INT(6) NOT NULL DEFAULT 1
+ , PRIMARY KEY (group_id)
+ , INDEX (grouping_id)
+ , CONSTRAINT FK_lams_learning_group_1 FOREIGN KEY (grouping_id)
+ REFERENCES lams_grouping (grouping_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_organisation (
+ organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , name VARCHAR(250)
+ , description VARCHAR(250)
+ , parent_organisation_id BIGINT(20)
+ , organisation_type_id INT(3) NOT NULL DEFAULT 0
+ , create_date DATETIME NOT NULL
+ , workspace_id BIGINT(20)
+ , PRIMARY KEY (organisation_id)
+ , INDEX (organisation_type_id)
+ , CONSTRAINT FK_lams_organisation_1 FOREIGN KEY (organisation_type_id)
+ REFERENCES lams_organisation_type (organisation_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (workspace_id)
+ , CONSTRAINT FK_lams_organisation_2 FOREIGN KEY (workspace_id)
+ REFERENCES lams_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (parent_organisation_id)
+ , CONSTRAINT FK_lams_organisation_3 FOREIGN KEY (parent_organisation_id)
+ REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learning_activity (
+ activity_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , activity_ui_id INT(11)
+ , description TEXT
+ , title VARCHAR(255)
+ , help_text TEXT
+ , xcoord INT(11)
+ , ycoord INT(11)
+ , parent_activity_id BIGINT(20)
+ , parent_ui_id INT(11)
+ , learning_activity_type_id INT(11) NOT NULL DEFAULT 0
+ , grouping_support_type_id INT(3) NOT NULL
+ , apply_grouping_flag TINYINT(1) NOT NULL
+ , grouping_id BIGINT(20)
+ , grouping_ui_id INT(11)
+ , order_id INT(11)
+ , define_later_flag TINYINT(4) NOT NULL DEFAULT 0
+ , learning_design_id BIGINT(20)
+ , learning_library_id BIGINT(20)
+ , create_date_time DATETIME NOT NULL
+ , run_offline_flag TINYINT(1) NOT NULL
+ , max_number_of_options INT(5)
+ , min_number_of_options INT(5)
+ , options_instructions TEXT
+ , tool_id BIGINT(20)
+ , tool_content_id BIGINT(20)
+ , activity_category_id INT(3) NOT NULL
+ , gate_activity_level_id INT(11)
+ , gate_open_flag TINYINT(1)
+ , gate_start_time_offset BIGINT(38)
+ , gate_end_time_offset BIGINT(38)
+ , gate_start_date_time DATETIME
+ , gate_end_date_time DATETIME
+ , library_activity_ui_image VARCHAR(255)
+ , create_grouping_id BIGINT(20)
+ , create_grouping_ui_id INT(11)
+ , library_activity_id BIGINT(20)
+ , PRIMARY KEY (activity_id)
+ , INDEX (learning_library_id)
+ , CONSTRAINT FK_lams_learning_activity_7 FOREIGN KEY (learning_library_id)
+ REFERENCES lams_learning_library (learning_library_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (learning_design_id)
+ , CONSTRAINT FK_lams_learning_activity_6 FOREIGN KEY (learning_design_id)
+ REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (parent_activity_id)
+ , CONSTRAINT FK_learning_activity_2 FOREIGN KEY (parent_activity_id)
+ REFERENCES lams_learning_activity (activity_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (learning_activity_type_id)
+ , CONSTRAINT FK_learning_activity_3 FOREIGN KEY (learning_activity_type_id)
+ REFERENCES lams_learning_activity_type (learning_activity_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (grouping_id)
+ , CONSTRAINT FK_learning_activity_6 FOREIGN KEY (grouping_id)
+ REFERENCES lams_grouping (grouping_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (tool_id)
+ , CONSTRAINT FK_lams_learning_activity_8 FOREIGN KEY (tool_id)
+ REFERENCES lams_tool (tool_id)
+ , INDEX (gate_activity_level_id)
+ , CONSTRAINT FK_lams_learning_activity_10 FOREIGN KEY (gate_activity_level_id)
+ REFERENCES lams_gate_activity_level (gate_activity_level_id)
+ , INDEX (create_grouping_id)
+ , CONSTRAINT FK_lams_learning_activity_9 FOREIGN KEY (create_grouping_id)
+ REFERENCES lams_grouping (grouping_id)
+ , INDEX (library_activity_id)
+ , CONSTRAINT FK_lams_learning_activity_11 FOREIGN KEY (library_activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+ , INDEX (activity_category_id)
+ , CONSTRAINT FK_lams_learning_activity_12 FOREIGN KEY (activity_category_id)
+ REFERENCES lams_activity_category (activity_category_id)
+ , INDEX (grouping_support_type_id)
+ , CONSTRAINT FK_lams_learning_activity_13 FOREIGN KEY (grouping_support_type_id)
+ REFERENCES lams_grouping_support_type (grouping_support_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_lesson (
+ lesson_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , learning_design_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , name VARCHAR(255) NOT NULL
+ , description TEXT
+ , create_date_time DATETIME NOT NULL
+ , organisation_id BIGINT(20)
+ , class_grouping_id BIGINT(20)
+ , lesson_state_id INT(3) NOT NULL
+ , start_date_time DATETIME
+ , schedule_start_date_time DATETIME
+ , end_date_time DATETIME
+ , schedule_end_date_time DATETIME
+ , PRIMARY KEY (lesson_id)
+ , INDEX (learning_design_id)
+ , CONSTRAINT FK_lams_lesson_1_1 FOREIGN KEY (learning_design_id)
+ REFERENCES lams_learning_design (learning_design_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_lesson_2 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (organisation_id)
+ , CONSTRAINT FK_lams_lesson_3 FOREIGN KEY (organisation_id)
+ REFERENCES lams_organisation (organisation_id)
+ , INDEX (lesson_state_id)
+ , CONSTRAINT FK_lams_lesson_4 FOREIGN KEY (lesson_state_id)
+ REFERENCES lams_lesson_state (lesson_state_id)
+ , INDEX (class_grouping_id)
+ , CONSTRAINT FK_lams_lesson_5 FOREIGN KEY (class_grouping_id)
+ REFERENCES lams_grouping (grouping_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_tool (
+ tool_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , tool_signature VARCHAR(64) NOT NULL
+ , service_name VARCHAR(255) NOT NULL
+ , tool_display_name VARCHAR(255) NOT NULL
+ , description TEXT
+ , tool_identifier VARCHAR(64) NOT NULL
+ , tool_version VARCHAR(10) NOT NULL
+ , learning_library_id BIGINT(20)
+ , default_tool_content_id BIGINT(20)
+ , valid_flag TINYINT(1) NOT NULL DEFAULT 1
+ , grouping_support_type_id INT(3) NOT NULL
+ , supports_define_later_flag TINYINT(1) NOT NULL DEFAULT 0
+ , supports_run_offline_flag TINYINT(1) NOT NULL
+ , supports_moderation_flag TINYINT(1) NOT NULL
+ , supports_contribute_flag TINYINT(1) NOT NULL
+ , learner_url TEXT NOT NULL
+ , author_url TEXT NOT NULL
+ , define_later_url TEXT
+ , export_portfolio_url TEXT NOT NULL
+ , monitor_url TEXT NOT NULL
+ , contribute_url TEXT
+ , moderation_url TEXT
+ , create_date_time DATETIME NOT NULL
+ , UNIQUE UQ_lams_tool_sig (tool_signature)
+ , UNIQUE UQ_lams_tool_class_name (service_name)
+ , PRIMARY KEY (tool_id)
+ , INDEX (learning_library_id)
+ , CONSTRAINT FK_lams_tool_1 FOREIGN KEY (learning_library_id)
+ REFERENCES lams_learning_library (learning_library_id)
+ , INDEX (grouping_support_type_id)
+ , CONSTRAINT FK_lams_tool_2 FOREIGN KEY (grouping_support_type_id)
+ REFERENCES lams_grouping_support_type (grouping_support_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_user_organisation (
+ user_organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , organisation_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (user_organisation_id)
+ , INDEX (organisation_id)
+ , CONSTRAINT FK_lams_user_organisation_1 FOREIGN KEY (organisation_id)
+ REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_user_organisation_2 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learner_progress (
+ learner_progress_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , user_id BIGINT(20) NOT NULL
+ , lesson_id BIGINT(20) NOT NULL
+ , lesson_completed_flag TINYINT(1) NOT NULL DEFAULT 0
+ , waiting_flag TINYINT(1) NOT NULL
+ , start_date_time DATETIME NOT NULL
+ , finish_date_time DATETIME
+ , current_activity_id BIGINT(20)
+ , next_activity_id BIGINT(20)
+ , previous_activity_id BIGINT(20)
+ , requires_restart_flag TINYINT(1) NOT NULL
+ , PRIMARY KEY (learner_progress_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_learner_progress_1 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (lesson_id)
+ , CONSTRAINT FK_lams_learner_progress_2 FOREIGN KEY (lesson_id)
+ REFERENCES lams_lesson (lesson_id)
+ , INDEX (current_activity_id)
+ , CONSTRAINT FK_lams_learner_progress_3 FOREIGN KEY (current_activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+ , INDEX (next_activity_id)
+ , CONSTRAINT FK_lams_learner_progress_4 FOREIGN KEY (next_activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+ , INDEX (previous_activity_id)
+ , CONSTRAINT FK_lams_learner_progress_5 FOREIGN KEY (previous_activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_cr_node (
+ node_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , workspace_id BIGINT(20) UNSIGNED NOT NULL
+ , path VARCHAR(255)
+ , type VARCHAR(255) NOT NULL
+ , created_date_time DATETIME NOT NULL
+ , next_version_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 1
+ , parent_nv_id BIGINT(20) UNSIGNED
+ , nv_id BIGINT(20) UNSIGNED NOT NULL
+ , PRIMARY KEY (node_id)
+ , INDEX (workspace_id)
+ , CONSTRAINT FK_lams_cr_node_1 FOREIGN KEY (workspace_id)
+ REFERENCES lams_cr_workspace (workspace_id)
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_node COMMENT='The main table containing the node definition';
+
+CREATE TABLE lams_cr_node_version (
+ nv_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , node_id BIGINT(20) UNSIGNED NOT NULL
+ , version_id BIGINT(20) UNSIGNED NOT NULL
+ , created_date_time DATETIME NOT NULL
+ , id BIGINT(20) UNSIGNED NOT NULL
+ , PRIMARY KEY (nv_id)
+ , INDEX (node_id)
+ , CONSTRAINT FK_lams_cr_node_version_2 FOREIGN KEY (node_id)
+ REFERENCES lams_cr_node (node_id)
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_node_version COMMENT='Represents a version of a node';
+
+CREATE TABLE lams_css_theme_ve (
+ theme_ve_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , name VARCHAR(100) NOT NULL
+ , description VARCHAR(100)
+ , parent_id BIGINT(20)
+ , theme_flag TINYINT(1) NOT NULL DEFAULT 0
+ , PRIMARY KEY (theme_ve_id)
+ , INDEX (parent_id)
+ , CONSTRAINT FK_lams_css_theme_ve_2 FOREIGN KEY (parent_id)
+ REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+ALTER TABLE lams_css_theme_ve COMMENT='Stores both the Flash theme and visual element';
+
+CREATE TABLE lams_css_style (
+ style_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , theme_ve_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (style_id)
+ , INDEX (theme_ve_id)
+ , CONSTRAINT FK_lams_css_style_1 FOREIGN KEY (theme_ve_id)
+ REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+ALTER TABLE lams_css_style COMMENT='Groups lams_css_property into a CSSStyleDeclaration.';
+
+CREATE TABLE lams_user_organisation_role (
+ user_organisation_role_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , user_organisation_id BIGINT(20) NOT NULL
+ , role_id INT(6) NOT NULL
+ , PRIMARY KEY (user_organisation_role_id)
+ , INDEX (role_id)
+ , CONSTRAINT FK_lams_user_organisation_role_2 FOREIGN KEY (role_id)
+ REFERENCES lams_role (role_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (user_organisation_id)
+ , CONSTRAINT FK_lams_user_organisation_role_3 FOREIGN KEY (user_organisation_id)
+ REFERENCES lams_user_organisation (user_organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_tool_session (
+ tool_session_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , tool_session_type_id INT(3) NOT NULL
+ , lesson_id BIGINT(20) NOT NULL
+ , activity_id BIGINT(20) NOT NULL
+ , tool_session_state_id INT(3) NOT NULL
+ , create_date_time DATETIME NOT NULL
+ , group_id BIGINT(20)
+ , user_id BIGINT(20)
+ , unique_key VARCHAR(128) NOT NULL
+ , UNIQUE UQ_lams_tool_session_1 (unique_key)
+ , PRIMARY KEY (tool_session_id)
+ , INDEX (tool_session_state_id)
+ , CONSTRAINT FK_lams_tool_session_4 FOREIGN KEY (tool_session_state_id)
+ REFERENCES lams_tool_session_state (tool_session_state_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_tool_session_5 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (tool_session_type_id)
+ , CONSTRAINT FK_lams_tool_session_7 FOREIGN KEY (tool_session_type_id)
+ REFERENCES lams_tool_session_type (tool_session_type_id)
+ , INDEX (activity_id)
+ , CONSTRAINT FK_lams_tool_session_8 FOREIGN KEY (activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+ , INDEX (group_id)
+ , CONSTRAINT FK_lams_tool_session_1 FOREIGN KEY (group_id)
+ REFERENCES lams_group (group_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_progress_completed (
+ learner_progress_id BIGINT(20) NOT NULL
+ , activity_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (learner_progress_id, activity_id)
+ , INDEX (learner_progress_id)
+ , CONSTRAINT FK_lams_progress_completed_1 FOREIGN KEY (learner_progress_id)
+ REFERENCES lams_learner_progress (learner_progress_id)
+ , INDEX (activity_id)
+ , CONSTRAINT FK_lams_progress_completed_2 FOREIGN KEY (activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_progress_attempted (
+ learner_progress_id BIGINT(20) NOT NULL
+ , activity_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (learner_progress_id, activity_id)
+ , INDEX (learner_progress_id)
+ , CONSTRAINT FK_lams_progress_current_1 FOREIGN KEY (learner_progress_id)
+ REFERENCES lams_learner_progress (learner_progress_id)
+ , INDEX (activity_id)
+ , CONSTRAINT FK_lams_progress_current_2 FOREIGN KEY (activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_user_group (
+ user_id BIGINT(20) NOT NULL
+ , group_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (user_id, group_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_user_group_1 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (group_id)
+ , CONSTRAINT FK_lams_user_group_2 FOREIGN KEY (group_id)
+ REFERENCES lams_group (group_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_tool_content (
+ tool_content_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , tool_id BIGINT(20) NOT NULL
+ , PRIMARY KEY (tool_content_id)
+ , INDEX (tool_id)
+ , CONSTRAINT FK_lams_tool_content_1 FOREIGN KEY (tool_id)
+ REFERENCES lams_tool (tool_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_activity_learners (
+ user_id BIGINT(20) NOT NULL DEFAULT 0
+ , activity_id BIGINT(20) NOT NULL DEFAULT 0
+ , INDEX (user_id)
+ , CONSTRAINT FK_TABLE_32_1 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+ , INDEX (activity_id)
+ , CONSTRAINT FK_TABLE_32_2 FOREIGN KEY (activity_id)
+ REFERENCES lams_learning_activity (activity_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_lesson_learner (
+ lesson_id BIGINT(20) NOT NULL
+ , user_id BIGINT(20) NOT NULL
+ , INDEX (lesson_id)
+ , CONSTRAINT FK_lams_lesson_learner_1 FOREIGN KEY (lesson_id)
+ REFERENCES lams_lesson (lesson_id)
+ , INDEX (user_id)
+ , CONSTRAINT FK_lams_lesson_learner_2 FOREIGN KEY (user_id)
+ REFERENCES lams_user (user_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_cr_workspace_credential (
+ wc_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , workspace_id BIGINT(20) UNSIGNED NOT NULL
+ , credential_id BIGINT(20) UNSIGNED NOT NULL
+ , PRIMARY KEY (wc_id)
+ , INDEX (workspace_id)
+ , CONSTRAINT FK_lams_cr_workspace_credential_1 FOREIGN KEY (workspace_id)
+ REFERENCES lams_cr_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (credential_id)
+ , CONSTRAINT FK_lams_cr_workspace_credential_2 FOREIGN KEY (credential_id)
+ REFERENCES lams_cr_credential (credential_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+ALTER TABLE lams_cr_workspace_credential COMMENT='Maps tools access to workspaces';
+
+CREATE TABLE lams_cr_node_version_property (
+ id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT
+ , nv_id BIGINT(20) UNSIGNED NOT NULL
+ , name VARCHAR(255) NOT NULL
+ , value VARCHAR(255) NOT NULL
+ , type TINYINT NOT NULL
+ , PRIMARY KEY (id)
+ , INDEX (nv_id)
+ , CONSTRAINT FK_lams_cr_node_version_property_1 FOREIGN KEY (nv_id)
+ REFERENCES lams_cr_node_version (nv_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_log_event (
+ log_event_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , log_event_type_id INT(5) NOT NULL
+ , user_id BIGINT(20)
+ , timestamp DATETIME NOT NULL
+ , ref_id BIGINT(20)
+ , message VARCHAR(255)
+ , PRIMARY KEY (log_event_id)
+ , INDEX (log_event_type_id)
+ , CONSTRAINT FK_lams_event_log_1 FOREIGN KEY (log_event_type_id)
+ REFERENCES lams_log_event_type (log_event_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_workspace_folder_content (
+ folder_content_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , content_type_id INT(3) NOT NULL
+ , name VARCHAR(64) NOT NULL
+ , description VARCHAR(64) NOT NULL
+ , create_date_time DATETIME NOT NULL
+ , last_modified_date DATETIME NOT NULL
+ , workspace_folder_id BIGINT(20) NOT NULL
+ , uuid BIGINT(20)
+ , version_id BIGINT(20)
+ , mime_type VARCHAR(10) NOT NULL
+ , UNIQUE unique_content_name (name, workspace_folder_id, mime_type)
+ , UNIQUE unique_node_version (workspace_folder_id, uuid, version_id)
+ , PRIMARY KEY (folder_content_id)
+ , INDEX (workspace_folder_id)
+ , CONSTRAINT FK_lams_workspace_folder_content_1 FOREIGN KEY (workspace_folder_id)
+ REFERENCES lams_workspace_folder (workspace_folder_id)
+ , INDEX (content_type_id)
+ , CONSTRAINT FK_lams_workspace_folder_content_2 FOREIGN KEY (content_type_id)
+ REFERENCES lams_workspace_folder_content_type (content_type_id)
+)TYPE=InnoDB;
+
+CREATE TABLE lams_css_property (
+ property_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , style_id BIGINT(20) NOT NULL
+ , name VARCHAR(255) NOT NULL
+ , value VARCHAR(100) NOT NULL
+ , style_subset VARCHAR(20)
+ , type TINYINT NOT NULL
+ , PRIMARY KEY (property_id)
+ , INDEX (style_id)
+ , CONSTRAINT FK_lams_css_property_1 FOREIGN KEY (style_id)
+ REFERENCES lams_css_style (style_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+
+CREATE TABLE lams_learning_transition (
+ transition_id BIGINT(20) NOT NULL AUTO_INCREMENT
+ , transition_ui_id INT(11)
+ , description TEXT
+ , title VARCHAR(255)
+ , to_activity_id BIGINT(20) NOT NULL
+ , from_activity_id BIGINT(20) NOT NULL
+ , learning_design_id BIGINT(20) NOT NULL DEFAULT 0
+ , create_date_time DATETIME NOT NULL
+ , to_ui_id INT(11)
+ , from_ui_id INT(11)
+ , PRIMARY KEY (transition_id)
+ , INDEX (from_activity_id)
+ , CONSTRAINT FK_learning_transition_3 FOREIGN KEY (from_activity_id)
+ REFERENCES lams_learning_activity (activity_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (to_activity_id)
+ , CONSTRAINT FK_learning_transition_2 FOREIGN KEY (to_activity_id)
+ REFERENCES lams_learning_activity (activity_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+ , INDEX (learning_design_id)
+ , CONSTRAINT lddefn_transition_ibfk_1 FOREIGN KEY (learning_design_id)
+ REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION
+)TYPE=InnoDB;
+