1 -- --------------------------------------------------------
2 -- SQL Commands to set up the pmadb as described in the documentation.
4 -- This file is meant for use with Drizzle 2011.03.13 and above!
6 -- This script expects that you take care of database permissions.
8 -- Please don't forget to set up the tablenames in config.inc.php
11 -- --------------------------------------------------------
14 -- Database : `phpmyadmin`
16 CREATE DATABASE IF NOT EXISTS `phpmyadmin`
20 -- --------------------------------------------------------
23 -- Table structure for table `pma__bookmark`
26 CREATE TABLE IF NOT EXISTS `pma__bookmark` (
27 `id` int(11) NOT NULL auto_increment,
28 `dbase` varchar(255) NOT NULL default '',
29 `user` varchar(255) NOT NULL default '',
30 `label` varchar(255) COLLATE utf8_general_ci NOT NULL default '',
31 `query` text NOT NULL,
37 -- --------------------------------------------------------
40 -- Table structure for table `pma__column_info`
43 CREATE TABLE IF NOT EXISTS `pma__column_info` (
44 `id` int(5) NOT NULL auto_increment,
45 `db_name` varchar(64) NOT NULL default '',
46 `table_name` varchar(64) NOT NULL default '',
47 `column_name` varchar(64) NOT NULL default '',
48 `comment` varchar(255) COLLATE utf8_general_ci NOT NULL default '',
49 `mimetype` varchar(255) COLLATE utf8_general_ci NOT NULL default '',
50 `transformation` varchar(255) NOT NULL default '',
51 `transformation_options` varchar(255) NOT NULL default '',
52 `input_transformation` varchar(255) NOT NULL default '',
53 `input_transformation_options` varchar(255) NOT NULL default '',
55 UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`)
57 COMMENT='Column information for phpMyAdmin'
60 -- --------------------------------------------------------
63 -- Table structure for table `pma__history`
66 CREATE TABLE IF NOT EXISTS `pma__history` (
67 `id` bigint(20) NOT NULL auto_increment,
68 `username` varchar(64) NOT NULL default '',
69 `db` varchar(64) NOT NULL default '',
70 `table` varchar(64) NOT NULL default '',
71 `timevalue` timestamp NOT NULL,
72 `sqlquery` text NOT NULL,
74 KEY `username` (`username`,`db`,`table`,`timevalue`)
76 COMMENT='SQL history for phpMyAdmin'
79 -- --------------------------------------------------------
82 -- Table structure for table `pma__pdf_pages`
85 CREATE TABLE IF NOT EXISTS `pma__pdf_pages` (
86 `db_name` varchar(64) NOT NULL default '',
87 `page_nr` int(10) NOT NULL auto_increment,
88 `page_descr` varchar(50) COLLATE utf8_general_ci NOT NULL default '',
89 PRIMARY KEY (`page_nr`),
90 KEY `db_name` (`db_name`)
92 COMMENT='PDF relation pages for phpMyAdmin'
95 -- --------------------------------------------------------
98 -- Table structure for table `pma__recent`
101 CREATE TABLE IF NOT EXISTS `pma__recent` (
102 `username` varchar(64) NOT NULL,
103 `tables` text NOT NULL,
104 PRIMARY KEY (`username`)
106 COMMENT='Recently accessed tables'
109 -- --------------------------------------------------------
112 -- Table structure for table `pma__table_uiprefs`
115 CREATE TABLE IF NOT EXISTS `pma__table_uiprefs` (
116 `username` varchar(64) NOT NULL,
117 `db_name` varchar(64) NOT NULL,
118 `table_name` varchar(64) NOT NULL,
119 `prefs` text NOT NULL,
120 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
121 PRIMARY KEY (`username`,`db_name`,`table_name`)
123 COMMENT='Tables'' UI preferences'
126 -- --------------------------------------------------------
129 -- Table structure for table `pma__relation`
132 CREATE TABLE IF NOT EXISTS `pma__relation` (
133 `master_db` varchar(64) NOT NULL default '',
134 `master_table` varchar(64) NOT NULL default '',
135 `master_field` varchar(64) NOT NULL default '',
136 `foreign_db` varchar(64) NOT NULL default '',
137 `foreign_table` varchar(64) NOT NULL default '',
138 `foreign_field` varchar(64) NOT NULL default '',
139 PRIMARY KEY (`master_db`,`master_table`,`master_field`),
140 KEY `foreign_field` (`foreign_db`,`foreign_table`)
142 COMMENT='Relation table'
145 -- --------------------------------------------------------
148 -- Table structure for table `pma__table_coords`
151 CREATE TABLE IF NOT EXISTS `pma__table_coords` (
152 `db_name` varchar(64) NOT NULL default '',
153 `table_name` varchar(64) NOT NULL default '',
154 `pdf_page_number` int(11) NOT NULL default '0',
155 `x` float NOT NULL default '0',
156 `y` float NOT NULL default '0',
157 PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`)
159 COMMENT='Table coordinates for phpMyAdmin PDF output'
162 -- --------------------------------------------------------
165 -- Table structure for table `pma__table_info`
168 CREATE TABLE IF NOT EXISTS `pma__table_info` (
169 `db_name` varchar(64) NOT NULL default '',
170 `table_name` varchar(64) NOT NULL default '',
171 `display_field` varchar(64) NOT NULL default '',
172 PRIMARY KEY (`db_name`,`table_name`)
174 COMMENT='Table information for phpMyAdmin'
177 -- --------------------------------------------------------
180 -- Table structure for table `pma__tracking`
183 CREATE TABLE IF NOT EXISTS `pma__tracking` (
184 `db_name` varchar(64) NOT NULL,
185 `table_name` varchar(64) NOT NULL,
186 `version` int(10) NOT NULL,
187 `date_created` datetime NOT NULL,
188 `date_updated` datetime NOT NULL,
189 `schema_snapshot` text NOT NULL,
192 `tracking` varchar(15) default NULL,
193 `tracking_active` int(1) NOT NULL default '1',
194 PRIMARY KEY (`db_name`,`table_name`,`version`)
198 -- --------------------------------------------------------
201 -- Table structure for table `pma__userconfig`
204 CREATE TABLE IF NOT EXISTS `pma__userconfig` (
205 `username` varchar(64) NOT NULL,
206 `timevalue` timestamp NOT NULL,
207 `config_data` text NOT NULL,
208 PRIMARY KEY (`username`)
210 COMMENT='User preferences storage for phpMyAdmin'
213 -- --------------------------------------------------------
216 -- Table structure for table `pma__users`
219 CREATE TABLE IF NOT EXISTS `pma__users` (
220 `username` varchar(64) NOT NULL,
221 `usergroup` varchar(64) NOT NULL,
222 PRIMARY KEY (`username`,`usergroup`)
224 COMMENT='Users and their assignments to user groups'
227 -- --------------------------------------------------------
230 -- Table structure for table `pma__usergroups`
233 CREATE TABLE IF NOT EXISTS `pma__usergroups` (
234 `usergroup` varchar(64) NOT NULL,
235 `tab` varchar(64) NOT NULL,
236 `allowed` enum('Y','N') NOT NULL DEFAULT 'N',
237 PRIMARY KEY (`usergroup`,`tab`,`allowed`)
239 COMMENT='User groups with configured menu items'
242 -- --------------------------------------------------------
245 -- Table structure for table `pma__navigationhiding`
248 CREATE TABLE IF NOT EXISTS `pma__navigationhiding` (
249 `username` varchar(64) NOT NULL,
250 `item_name` varchar(64) NOT NULL,
251 `item_type` varchar(64) NOT NULL,
252 `db_name` varchar(64) NOT NULL,
253 `table_name` varchar(64) NOT NULL,
254 PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`)
256 COMMENT='Hidden items of navigation tree'
259 -- --------------------------------------------------------
262 -- Table structure for table `pma__savedsearches`
265 CREATE TABLE IF NOT EXISTS `pma__savedsearches` (
266 `id` int(5) unsigned NOT NULL auto_increment,
267 `username` varchar(64) NOT NULL default '',
268 `db_name` varchar(64) NOT NULL default '',
269 `search_name` varchar(64) NOT NULL default '',
270 `search_data` text NOT NULL,
272 UNIQUE KEY `u_savedsearches_username_dbname` (`username`,`db_name`,`search_name`)
274 COMMENT='Saved searches'
277 -- --------------------------------------------------------
280 -- Table structure for table `pma__designer_settings`
283 CREATE TABLE IF NOT EXISTS `pma__designer_settings` (
284 `username` varchar(64) NOT NULL,
285 `settings_data` text NOT NULL,
286 PRIMARY KEY (`username`)
288 COMMENT='Settings related to Designer'
291 -- --------------------------------------------------------
294 -- Table structure for table `pma__export_templates`
297 CREATE TABLE IF NOT EXISTS `pma__export_templates` (
298 `id` int(5) unsigned NOT NULL AUTO_INCREMENT,
299 `username` varchar(64) NOT NULL,
300 `export_type` varchar(10) NOT NULL,
301 `template_name` varchar(64) NOT NULL,
302 `template_data` text NOT NULL,
304 UNIQUE KEY `u_user_type_template` (`username`,`export_type`,`template_name`)
306 COMMENT='Saved export templates'