PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/install/sql_php_upgrade/upgrade_slims8_akasia.sql.php

https://gitlab.com/mucill/sman7
PHP | 269 lines | 177 code | 41 blank | 51 comment | 0 complexity | 7f233eb2037b475ee4b9aa56c977cfe8 MD5 | raw file
  1. <?php
  2. $sql['delete'][] = "DELETE FROM `setting` WHERE `setting`.`setting_name` = 'barcode_encoding';";
  3. $sql['update'][] = "UPDATE `setting` SET `setting_value` = 'a:2:{s:5:\"theme\";s:7:\"default\";s:3:\"css\";s:26:\"template/default/style.css\";}' WHERE `setting_id` = 3;";
  4. $sql['alter'][] = "ALTER TABLE `biblio` ADD `content_type_id` INT NULL DEFAULT NULL AFTER `spec_detail_info`,
  5. ADD `media_type_id` INT NULL DEFAULT NULL AFTER `content_type_id`,
  6. ADD `carrier_type_id` INT NULL DEFAULT NULL AFTER `media_type_id`,
  7. ADD INDEX (`content_type_id`, `media_type_id`, `carrier_type_id`) ;";
  8. $sql['alter'][] = "ALTER TABLE `search_biblio` ADD `content_type` VARCHAR(100) NULL DEFAULT NULL AFTER `image`, ADD `media_type` VARCHAR(100) NULL DEFAULT NULL AFTER `content_type`,
  9. ADD `carrier_type` VARCHAR(100) NULL DEFAULT NULL AFTER `media_type`, ADD INDEX (`content_type`, `media_type`, `carrier_type`);";
  10. $sql['alter'][] = "ALTER TABLE `user` CHANGE `passwd` `passwd` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;";
  11. $sql['alter'][] = "ALTER TABLE `member` CHANGE `mpasswd` `mpasswd` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL;";
  12. /*-- change all users password to : 'akasia'*/
  13. // $sql['update'][] = "UPDATE `user` SET passwd='$2y$10$/Czdb/DbXSDO2peXwlfvDusUZ6CF0VTeSoErlOOXgSXXA2RanoLd.';";
  14. /*-- change all members password to : 'akasia'*/
  15. // $hash_member = '$2y$10$Vx12rbVCdtYW701HrULLYOLDKJdb3fDusG2rE7GJzAcH9mqu2MjKK';
  16. // $sql['update'][] = "UPDATE `member` SET `mpasswd`='$hash_member' WHERE `mpasswd` IS NOT NULL;";
  17. /*--
  18. -- Table structure for table `mst_carrier_type`
  19. --*/
  20. $sql['create'][] = "CREATE TABLE IF NOT EXISTS `mst_carrier_type` (
  21. `id` int(11) NOT NULL,
  22. `carrier_type` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  23. `code` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  24. `code2` char(1) COLLATE utf8_unicode_ci NOT NULL,
  25. `input_date` datetime NOT NULL,
  26. `last_update` datetime NOT NULL
  27. ) ENGINE=MyISAM AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
  28. /*--
  29. -- Dumping data for table `mst_carrier_type`
  30. --*/
  31. $sql['insert'][] = "INSERT INTO `mst_carrier_type` (`id`, `carrier_type`, `code`, `code2`, `input_date`, `last_update`) VALUES
  32. (1, 'audio cartridge', 'sg', 'g', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  33. (2, 'audio cylinder', 'se', 'e', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  34. (3, 'audio disc', 'sd', 'd', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  35. (4, 'sound track reel', 'si', 'i', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  36. (5, 'audio roll', 'sq', 'q', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  37. (6, 'audiocassette', 'ss', 's', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  38. (7, 'audiotape reel', 'st', 't', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  39. (8, 'other (audio)', 'sz', 'z', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  40. (9, 'computer card', 'ck', 'k', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  41. (10, 'computer chip cartridge', 'cb', 'b', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  42. (11, 'computer disc', 'cd', 'd', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  43. (12, 'computer disc cartridge', 'ce', 'e', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  44. (13, 'computer tape cartridge', 'ca', 'a', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  45. (14, 'computer tape cassette', 'cf', 'f', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  46. (15, 'computer tape reel', 'ch', 'h', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  47. (16, 'online resource', 'cr', 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  48. (17, 'other (computer)', 'cz', 'z', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  49. (18, 'aperture card', 'ha', 'a', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  50. (19, 'microfiche', 'he', 'e', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  51. (20, 'microfiche cassette', 'hf', 'f', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  52. (21, 'microfilm cartridge', 'hb', 'b', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  53. (22, 'microfilm cassette', 'hc', 'c', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  54. (23, 'microfilm reel', 'hd', 'd', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  55. (24, 'microfilm roll', 'hj', 'j', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  56. (25, 'microfilm slip', 'hh', 'h', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  57. (26, 'microopaque', 'hg', 'g', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  58. (27, 'other (microform)', 'hz', 'z', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  59. (28, 'microscope slide', 'pp', 'p', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  60. (29, 'other (microscope)', 'pz', 'z', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  61. (30, 'film cartridge', 'mc', 'c', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  62. (31, 'film cassette', 'mf', 'f', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  63. (32, 'film reel', 'mr', 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  64. (33, 'film roll', 'mo', 'o', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  65. (34, 'filmslip', 'gd', 'd', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  66. (35, 'filmstrip', 'gf', 'f', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  67. (36, 'filmstrip cartridge', 'gc', 'c', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  68. (37, 'overhead transparency', 'gt', 't', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  69. (38, 'slide', 'gs', 's', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  70. (39, 'other (projected image)', 'mz', 'z', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  71. (40, 'stereograph card', 'eh', 'h', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  72. (41, 'stereograph disc', 'es', 's', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  73. (42, 'other (stereographic)', 'ez', 'z', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  74. (43, 'card', 'no', 'o', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  75. (44, 'flipchart', 'nn', 'n', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  76. (45, 'roll', 'na', 'a', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  77. (46, 'sheet', 'nb', 'b', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  78. (47, 'volume', 'nc', 'c', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  79. (48, 'object', 'nr', 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  80. (49, 'other (unmediated)', 'nz', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  81. (50, 'video cartridge', 'vc', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  82. (51, 'videocassette', 'vf', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  83. (52, 'videodisc', 'vd', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  84. (53, 'videotape reel', 'vr', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  85. (54, 'other (video)', 'vz', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  86. (55, 'unspecified', 'zu', 'u', '0000-00-00 00:00:00', '0000-00-00 00:00:00');";
  87. /*--
  88. -- Table structure for table `mst_content_type`
  89. --*/
  90. $sql['create'][] = "CREATE TABLE IF NOT EXISTS `mst_content_type` (
  91. `id` int(11) NOT NULL,
  92. `content_type` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  93. `code` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  94. `code2` char(1) COLLATE utf8_unicode_ci NOT NULL,
  95. `input_date` datetime NOT NULL,
  96. `last_update` datetime NOT NULL
  97. ) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
  98. /*--
  99. -- Dumping data for table `mst_content_type`
  100. --*/
  101. $sql['insert'][] = "INSERT INTO `mst_content_type` (`id`, `content_type`, `code`, `code2`, `input_date`, `last_update`) VALUES
  102. (1, 'cartographic dataset', 'crd', 'e', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  103. (2, 'cartographic image', 'cri', 'e', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  104. (3, 'cartographic moving image', 'crm', 'e', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  105. (4, 'cartographic tactile image', 'crt', 'e', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  106. (5, 'cartographic tactile three-dimensional form', 'crn', 'e', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  107. (6, 'cartographic three-dimensional form', 'crf', 'e', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  108. (7, 'computer dataset', 'cod', 'm', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  109. (8, 'computer program', 'cop', 'm', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  110. (9, 'notated movement', 'ntv', 'a', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  111. (10, 'notated music', 'ntm', 'c', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  112. (11, 'performed music', 'prm', 'j', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  113. (12, 'sounds', 'snd', 'i', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  114. (13, 'spoken word', 'spw', 'i', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  115. (14, 'still image', 'sti', 'k', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  116. (15, 'tactile image', 'tci', 'k', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  117. (16, 'tactile notated music', 'tcm', 'c', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  118. (17, 'tactile notated movement', 'tcn', 'a', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  119. (18, 'tactile text', 'tct', 'a', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  120. (19, 'tactile three-dimensional form', 'tcf', 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  121. (20, 'text', 'txt', 'a', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  122. (21, 'three-dimensional form', 'tdf', 'r', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  123. (22, 'three-dimensional moving image', 'tdm', 'g', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  124. (23, 'two-dimensional moving image', 'tdi', 'g', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  125. (24, 'other', 'xxx', 'o', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  126. (25, 'unspecified', 'zzz', ' ', '0000-00-00 00:00:00', '0000-00-00 00:00:00');";
  127. /*--
  128. -- Table structure for table `mst_media_type`
  129. --*/
  130. $sql['create'][] = "CREATE TABLE IF NOT EXISTS `mst_media_type` (
  131. `id` int(11) NOT NULL,
  132. `media_type` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  133. `code` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
  134. `code2` char(1) COLLATE utf8_unicode_ci NOT NULL,
  135. `input_date` datetime NOT NULL,
  136. `last_update` datetime NOT NULL
  137. ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
  138. /*--
  139. -- Dumping data for table `mst_media_type`
  140. --*/
  141. $sql['insert'][] = "INSERT INTO `mst_media_type` (`id`, `media_type`, `code`, `code2`, `input_date`, `last_update`) VALUES
  142. (1, 'audio', 's', 's', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  143. (2, 'computer', 'c', 'c', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  144. (3, 'microform', 'h', 'h', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  145. (4, 'microscopic', 'p', ' ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  146. (5, 'projected', 'g', 'g', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  147. (6, 'stereographic', 'e', ' ', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  148. (7, 'unmediated', 'n', 't', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  149. (8, 'video', 'v', 'v', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  150. (9, 'other', 'x', 'z', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
  151. (10, 'unspecified', 'z', 'z', '0000-00-00 00:00:00', '0000-00-00 00:00:00');";
  152. /*--
  153. -- Table structure for table `mst_relation_term`
  154. --*/
  155. $sql['create'][] = "CREATE TABLE IF NOT EXISTS `mst_relation_term` (
  156. `ID` int(11) NOT NULL,
  157. `rt_id` varchar(11) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  158. `rt_desc` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
  159. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;";
  160. /*--
  161. -- Dumping data for table `mst_relation_term`
  162. --*/
  163. $sql['insert'][] = "INSERT INTO `mst_relation_term` (`ID`, `rt_id`, `rt_desc`) VALUES
  164. (1, 'U', 'Use'),
  165. (2, 'UF', 'Use For'),
  166. (3, 'BT', 'Broader Term'),
  167. (4, 'NT', 'Narrower Term'),
  168. (5, 'RT', 'Related Term'),
  169. (6, 'SA', 'See Also');";
  170. $sql['create'][] = "CREATE TABLE IF NOT EXISTS `biblio_relation` (
  171. `biblio_id` int(11) NOT NULL DEFAULT '0',
  172. `rel_biblio_id` int(11) NOT NULL DEFAULT '0',
  173. `rel_type` int(1) DEFAULT '1'
  174. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
  175. /*--
  176. -- Indexes for dumped tables
  177. --
  178. --
  179. -- Indexes for table `biblio_relation`
  180. --*/
  181. $sql['alter'][] = "ALTER TABLE `biblio_relation`
  182. ADD PRIMARY KEY (`biblio_id`,`rel_biblio_id`);";
  183. /*--
  184. -- Table structure for table `mst_voc_ctrl`
  185. --*/
  186. $sql['create'][] = "CREATE TABLE IF NOT EXISTS `mst_voc_ctrl` (
  187. `topic_id` int(11) NOT NULL,
  188. `vocabolary_id` int(11) NOT NULL,
  189. `rt_id` varchar(11) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  190. `related_topic_id` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
  191. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=43 ;";
  192. $sql['insert'][] = "INSERT IGNORE INTO `setting` (`setting_name`, `setting_value`) VALUES
  193. ('shortcuts_1', 'a:6:{i:0;s:42:\"Daftar Bibliografi|/bibliography/index.php\";i:1;s:61:\"Tambah Bibliografi Baru|/bibliography/index.php?action=detail\";i:2;s:51:\"Mulai Transaksi|/circulation/index.php?action=start\";i:3;s:48:\"Pengembalian Kilat|/circulation/quick_return.php\";i:4;s:42:\"Lihat Daftar Anggota|/membership/index.php\";i:5;s:37:\"Shortcut Setting|/system/shortcut.php\";}');";
  194. /*--
  195. -- Indexes for table `mst_relation_term`
  196. --*/
  197. $sql['alter'][] = "ALTER TABLE `mst_relation_term`
  198. ADD PRIMARY KEY (`ID`);";
  199. /*--
  200. -- Indexes for table `mst_voc_ctrl`
  201. --*/
  202. $sql['alter'][] = "ALTER TABLE `mst_voc_ctrl`
  203. ADD PRIMARY KEY (`vocabolary_id`);";
  204. /*--
  205. -- AUTO_INCREMENT for table `mst_relation_term`
  206. --*/
  207. $sql['alter'][] = "ALTER TABLE `mst_relation_term`
  208. MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;";
  209. /*--
  210. -- AUTO_INCREMENT for table `mst_voc_ctrl`
  211. --*/
  212. $sql['alter'][] = "ALTER TABLE `mst_voc_ctrl`
  213. MODIFY `vocabolary_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;";
  214. $sql['alter'][] = "ALTER TABLE `mst_carrier_type`
  215. ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `media_type` (`carrier_type`), ADD KEY `code` (`code`);";
  216. $sql['alter'][] = "ALTER TABLE `mst_content_type`
  217. ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `content_type` (`content_type`), ADD KEY `code` (`code`);";
  218. $sql['alter'][] = "ALTER TABLE `mst_media_type`
  219. ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `media_type` (`media_type`), ADD KEY `code` (`code`);";
  220. $sql['alter'][] = "ALTER TABLE `mst_carrier_type`
  221. MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=56;";
  222. $sql['alter'][] = "ALTER TABLE `mst_content_type`
  223. MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=26;";
  224. $sql['alter'][] = "ALTER TABLE `mst_media_type`
  225. MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=11;";
  226. $sql['alter'][] = "ALTER TABLE `content` ADD `is_news` SMALLINT(1) NULL DEFAULT NULL AFTER `content_path`;";
  227. ?>