1 -- --------------------------------------------------------
2 -- SQL Commands to set up the pmadb as described in Documentation.html.
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,
34 ENGINE=InnoDB COMMENT='Bookmarks'
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 '',
53 UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`)
55 ENGINE=InnoDB COMMENT='Column information for phpMyAdmin'
58 -- --------------------------------------------------------
61 -- Table structure for table `pma_history`
64 CREATE TABLE IF NOT EXISTS `pma_history` (
65 `id` bigint(20) NOT NULL auto_increment,
66 `username` varchar(64) NOT NULL default '',
67 `db` varchar(64) NOT NULL default '',
68 `table` varchar(64) NOT NULL default '',
69 `timevalue` timestamp NOT NULL,
70 `sqlquery` text NOT NULL,
72 KEY `username` (`username`,`db`,`table`,`timevalue`)
74 ENGINE=InnoDB COMMENT='SQL history for phpMyAdmin'
77 -- --------------------------------------------------------
80 -- Table structure for table `pma_pdf_pages`
83 CREATE TABLE IF NOT EXISTS `pma_pdf_pages` (
84 `db_name` varchar(64) NOT NULL default '',
85 `page_nr` int(10) NOT NULL auto_increment,
86 `page_descr` varchar(50) COLLATE utf8_general_ci NOT NULL default '',
87 PRIMARY KEY (`page_nr`),
88 KEY `db_name` (`db_name`)
90 ENGINE=InnoDB COMMENT='PDF relation pages for phpMyAdmin'
93 -- --------------------------------------------------------
96 -- Table structure for table `pma_recent`
99 CREATE TABLE IF NOT EXISTS `pma_recent` (
100 `username` varchar(64) NOT NULL,
101 `tables` text NOT NULL,
102 PRIMARY KEY (`username`)
104 ENGINE=InnoDB COMMENT='Recently accessed tables'
107 -- --------------------------------------------------------
110 -- Table structure for table `pma_table_uiprefs`
113 CREATE TABLE IF NOT EXISTS `pma_table_uiprefs` (
114 `username` varchar(64) NOT NULL,
115 `db_name` varchar(64) NOT NULL,
116 `table_name` varchar(64) NOT NULL,
117 `prefs` text NOT NULL,
118 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
119 PRIMARY KEY (`username`,`db_name`,`table_name`)
121 ENGINE=InnoDB COMMENT='Tables'' UI preferences'
124 -- --------------------------------------------------------
127 -- Table structure for table `pma_relation`
130 CREATE TABLE IF NOT EXISTS `pma_relation` (
131 `master_db` varchar(64) NOT NULL default '',
132 `master_table` varchar(64) NOT NULL default '',
133 `master_field` varchar(64) NOT NULL default '',
134 `foreign_db` varchar(64) NOT NULL default '',
135 `foreign_table` varchar(64) NOT NULL default '',
136 `foreign_field` varchar(64) NOT NULL default '',
137 PRIMARY KEY (`master_db`,`master_table`,`master_field`),
138 KEY `foreign_field` (`foreign_db`,`foreign_table`)
140 ENGINE=InnoDB COMMENT='Relation table'
143 -- --------------------------------------------------------
146 -- Table structure for table `pma_table_coords`
149 CREATE TABLE IF NOT EXISTS `pma_table_coords` (
150 `db_name` varchar(64) NOT NULL default '',
151 `table_name` varchar(64) NOT NULL default '',
152 `pdf_page_number` int(11) NOT NULL default '0',
153 `x` float NOT NULL default '0',
154 `y` float NOT NULL default '0',
155 PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`)
157 ENGINE=InnoDB COMMENT='Table coordinates for phpMyAdmin PDF output'
160 -- --------------------------------------------------------
163 -- Table structure for table `pma_table_info`
166 CREATE TABLE IF NOT EXISTS `pma_table_info` (
167 `db_name` varchar(64) NOT NULL default '',
168 `table_name` varchar(64) NOT NULL default '',
169 `display_field` varchar(64) NOT NULL default '',
170 PRIMARY KEY (`db_name`,`table_name`)
172 ENGINE=InnoDB COMMENT='Table information for phpMyAdmin'
175 -- --------------------------------------------------------
178 -- Table structure for table `pma_designer_coords`
181 CREATE TABLE IF NOT EXISTS `pma_designer_coords` (
182 `db_name` varchar(64) NOT NULL default '',
183 `table_name` varchar(64) NOT NULL default '',
188 PRIMARY KEY (`db_name`,`table_name`)
190 ENGINE=InnoDB COMMENT='Table coordinates for Designer'
193 -- --------------------------------------------------------
196 -- Table structure for table `pma_tracking`
199 CREATE TABLE IF NOT EXISTS `pma_tracking` (
200 `db_name` varchar(64) NOT NULL,
201 `table_name` varchar(64) NOT NULL,
202 `version` int(10) NOT NULL,
203 `date_created` datetime NOT NULL,
204 `date_updated` datetime NOT NULL,
205 `schema_snapshot` text NOT NULL,
208 `tracking` varchar(15) default NULL,
209 `tracking_active` int(1) NOT NULL default '1',
210 PRIMARY KEY (`db_name`,`table_name`,`version`)
215 -- --------------------------------------------------------
218 -- Table structure for table `pma_userconfig`
221 CREATE TABLE IF NOT EXISTS `pma_userconfig` (
222 `username` varchar(64) NOT NULL,
223 `timevalue` timestamp NOT NULL,
224 `config_data` text NOT NULL,
225 PRIMARY KEY (`username`)
227 ENGINE=InnoDB COMMENT='User preferences storage for phpMyAdmin'