4d8184a8f4ebfa1a51e67de0c2090e6641c03f7f
[atutor.git] / mods / patcher / module.sql
1 # --------------------------------------------------------\r
2 # Table structure for table `patches`\r
3 # since 1.6.1\r
4 \r
5 CREATE TABLE `patches` (\r
6         `patches_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,\r
7         `atutor_patch_id` VARCHAR(20) NOT NULL default '',\r
8         `applied_version` VARCHAR(10) NOT NULL default '',\r
9         `patch_folder` VARCHAR(250) NOT NULL default '',\r
10   `description` TEXT NOT NULL,\r
11         `available_to` VARCHAR(250) NOT NULL default '',\r
12   `sql_statement` text NOT NULL,\r
13   `status` varchar(20) NOT NULL default '',\r
14   `remove_permission_files` text NOT NULL,\r
15   `backup_files` text NOT NULL,\r
16   `patch_files` text NOT NULL,\r
17         PRIMARY KEY  (`patches_id`)\r
18 );\r
19 \r
20 \r
21 # --------------------------------------------------------\r
22 # Table structure for table `patches_files`\r
23 # since 1.6.1\r
24 \r
25 CREATE TABLE `patches_files` (\r
26         `patches_files_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,\r
27         `patches_id` MEDIUMINT UNSIGNED NOT NULL default 0,\r
28         `action` VARCHAR(20) NOT NULL default '',\r
29         `name` TEXT NOT NULL,\r
30         `location` VARCHAR(250) NOT NULL default '',\r
31         PRIMARY KEY  (`patches_files_id`)\r
32 );\r
33 \r
34 # --------------------------------------------------------\r
35 # Table structure for table `patches_files_actions`\r
36 # since 1.6.1\r
37 \r
38 CREATE TABLE `patches_files_actions` (\r
39         `patches_files_actions_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,\r
40         `patches_files_id` MEDIUMINT UNSIGNED NOT NULL default 0,\r
41         `action` VARCHAR(20) NOT NULL default '',\r
42         `code_from` TEXT NOT NULL,\r
43         `code_to` TEXT NOT NULL,\r
44         PRIMARY KEY  (`patches_files_actions_id`)\r
45 );\r
46 \r
47 # --------------------------------------------------------\r
48 # New records for table `language_text`\r
49 # since 1.6.1\r
50 \r
51 INSERT INTO `language_text` VALUES ('en', '_module','patcher','Patcher',NOW(),'');\r
52 INSERT INTO `language_text` VALUES ('en', '_template', 'get_my_patch', 'Get My Patch', now(), '');\r
53 INSERT INTO `language_text` VALUES ('en', '_template', 'atutor_patch_id', 'ATutor Patch ID', now(), '');\r
54 INSERT INTO `language_text` VALUES ('en', '_template', 'available_to', 'Available To', now(), '');\r
55 INSERT INTO `language_text` VALUES ('en', '_template', 'available_patches', 'Available Patches', now(), '');\r
56 INSERT INTO `language_text` VALUES ('en', '_template', 'available_patches_text', 'There are <strong>%s</strong> patches available to install.', now(), '');\r
57 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_ERROR_PATCH_ALREADY_INSTALLED', 'The selected patch is already installed.', now(), 'error msg');\r
58 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_ERROR_CHOOSE_UNINSTALLED_PATCH', 'Please choose an uninstalled patch.', now(), 'error msg');\r
59 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_ERROR_PATCH_XML_NOT_FOUND', 'Patch XML file is not found.', now(), 'error msg');\r
60 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_ERROR_REMOVE_WRITE_PERMISSION', 'Please remove write permission from the listed files.', now(), 'error msg');\r
61 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_ERROR_CANNOT_UNZIP', 'Can NOT unzip the uploaded file.', now(), 'error msg');\r
62 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_FEEDBACK_PATCH_INSTALLED_SUCCESSFULLY', 'The patch has been installed successfully.', now(), 'feedback msg');\r
63 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_ERROR_PATCH_DEPENDENCY', 'Due to patch dependency, please install the listed patches before installing this patch: %s', now(), 'error msg');\r
64 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_INFOS_PATCH_INSTALLED_AND_REMOVE_PERMISSION', 'The patch has been installed. Please remove write permission as instruction.', now(), 'info msg');\r
65 INSERT INTO `language_text` VALUES ('en', '_template', 'patcher_overwrite_modified_files', \r
66 'The listed files are modified locally. If you choose to proceed, the patch file will be copied to your local machine. \r
67 You have to manually merge this file and your local copy.<br>', now(), 'patcher');\r
68 INSERT INTO `language_text` VALUES ('en', '_template', 'patch_local_file_not_exist', \r
69 'Cannot proceed. The listed files are not exist in your local machine. If you renamed them to your copy, in order to proceed, please rename back.<br>', now(), 'patcher');\r
70 INSERT INTO `language_text` VALUES ('en', '_template', 'patcher_alter_modified_files', \r
71 'The listed files are modified locally. If you choose to proceed, your local file will be modified. The original\r
72 file will be backup before the modification. Please note that the modification on your customized code may break your customization.<br>', now(), 'patcher');\r
73 INSERT INTO `language_text` VALUES ('en', '_template', 'grant_write_permission', \r
74 'Please grant <strong>write</strong> permission to folders and files listed below:<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rw</kbd> then the file name.</p>', now(), 'patcher');\r
75 INSERT INTO `language_text` VALUES ('en', '_template', 'remove_write_permission', \r
76 '<span style="color:red">Please <strong>REMOVE</strong> write permission on the listed folders and files for your security:</span><p><strong>Note:</strong> To remove permissions on Unix use <kbd>chmod 755</kbd> then the file name..</p>', now(), 'patcher');\r
77 INSERT INTO `language_text` VALUES ('en', '_template', 'patcher_show_backup_files', \r
78 'Below is the list of the backup files created by patch installation. After ensuring ATutor works properly with the patch, you may want to \r
79 delete these files. If  ATutor does not work properly with the patch, you can always revert back to the old files by renaming the backup files \r
80 to the original file names,  removing the [patch_id].old portion of the file name. <br>', now(), 'patcher');\r
81 INSERT INTO `language_text` VALUES ('en', '_template', 'patcher_show_patch_files', \r
82 'Below is the list of the patch files copied to your computer. \r
83 Please manually merge the change between the patch files and your local copy. <br>', now(), 'patcher');\r
84 INSERT INTO `language_text` VALUES ('en', '_template', 'patch_dependent_patch_not_installed', \r
85 '<br><span style="color: red">Waring: Due to patch dependency, please install the listed patches first: </span>', now(), 'patcher');\r
86 INSERT INTO `language_text` VALUES ('en', '_template', 'upload_patch', \r
87 'Upload a zip file to install patch:', now(), 'patcher');\r
88 \r
89 # --------------------------------------------------------\r
90 # New tables for patch creator\r
91 # since 1.6.1\r
92 CREATE TABLE `myown_patches` (\r
93         `myown_patch_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,\r
94         `atutor_patch_id` VARCHAR(20) NOT NULL default '',\r
95         `applied_version` VARCHAR(10) NOT NULL default '',\r
96   `description` TEXT NOT NULL,\r
97   `sql_statement` text NOT NULL,\r
98   `status` varchar(20) NOT NULL default '',\r
99   `last_modified` datetime NOT NULL,\r
100         PRIMARY KEY  (`myown_patch_id`)\r
101 );\r
102 \r
103 CREATE TABLE `myown_patches_dependent` (\r
104         `myown_patches_dependent_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,\r
105         `myown_patch_id` MEDIUMINT UNSIGNED NOT NULL,\r
106         `dependent_patch_id` VARCHAR(50) NOT NULL default '',\r
107         PRIMARY KEY  (`myown_patches_dependent_id`)\r
108 );\r
109 \r
110 CREATE TABLE `myown_patches_files` (\r
111         `myown_patches_files_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,\r
112         `myown_patch_id` MEDIUMINT UNSIGNED NOT NULL,\r
113         `action` VARCHAR(20) NOT NULL default '',\r
114         `name` VARCHAR(250) NOT NULL,\r
115         `location` VARCHAR(250) NOT NULL default '',\r
116         `code_from` TEXT NOT NULL,\r
117         `code_to` TEXT NOT NULL,\r
118         `uploaded_file` TEXT NOT NULL,\r
119         PRIMARY KEY  (`myown_patches_files_id`)\r
120 );\r
121 \r
122 # --------------------------------------------------------\r
123 # New records for table `language_text` (for patch creator)\r
124 # since 1.6.1\r
125 \r
126 INSERT INTO `language_text` VALUES ('en', '_template', 'myown_patches', 'My Own Patches', now(), '');\r
127 INSERT INTO `language_text` VALUES ('en', '_template', 'atutor_patch_id', 'ATutor Patch ID', now(), '');\r
128 INSERT INTO `language_text` VALUES ('en', '_template', 'atutor_version_to_apply', 'ATutor Version to Apply', now(), '');\r
129 INSERT INTO `language_text` VALUES ('en', '_template', 'dependent_patches', 'Dependent Patches', now(), '');\r
130 INSERT INTO `language_text` VALUES ('en', '_template', 'dependent_patch_id', 'Dependent Patch ID', now(), '');\r
131 INSERT INTO `language_text` VALUES ('en', '_template', 'add_dependent_patch', 'Add A Dependent Patch', now(), '');\r
132 INSERT INTO `language_text` VALUES ('en', '_template', 'sql_statement', 'SQL Statement', now(), '');\r
133 INSERT INTO `language_text` VALUES ('en', '_template', 'relative_directory', 'Directory is relative directory to ATutor root, for example: docs/images/ or tools/tests/. Leave empty if it is ATutor root directory.', now(), '');\r
134 INSERT INTO `language_text` VALUES ('en', '_template', 'create_patch', 'Create Patch', now(), '');\r
135 INSERT INTO `language_text` VALUES ('en', '_template', 'edit_patch', 'Edit Patch', now(), '');\r
136 INSERT INTO `language_text` VALUES ('en', '_template', 'delete_patch', 'Delete Patch', now(), '');\r
137 INSERT INTO `language_text` VALUES ('en', '_template', 'add_a_file', 'Add A File', now(), '');\r
138 INSERT INTO `language_text` VALUES ('en', '_template', 'delete_this_file', 'Delete This File', now(), '');\r
139 INSERT INTO `language_text` VALUES ('en', '_template', 'replace_file', 'Replace File', now(), '');\r
140 INSERT INTO `language_text` VALUES ('en', '_template', 'alter', 'Alter', now(), '');\r
141 INSERT INTO `language_text` VALUES ('en', '_template', 'code_to_replace_from', 'Code To Replace From', now(), '');\r
142 INSERT INTO `language_text` VALUES ('en', '_template', 'code_to_replace_to', 'Code To Replace To', now(), '');\r
143 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_ERROR_CHOOSE_ACTION', 'Please choose action for file <strong>%s</strong>', now(), '');\r
144 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_FEEDBACK_PATCH_CREATED_SUCCESSFULLY', 'The patch has been created successfully.', now(), 'feedback msg');\r
145 INSERT INTO `language_text` VALUES ('en', '_msgs', 'AT_CONFIRM_DELETE_MYOWN_PATCH', 'Are you sure you want to <strong>delete</strong> patch <strong>%s</strong>', now(), '');\r