Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Peccatte <hugues.peccatte@gmail.com>2014-02-23 17:52:48 +0400
committerHugues Peccatte <hugues.peccatte@gmail.com>2014-02-23 17:52:48 +0400
commit8b84cf0d91669b4a359b2f20bb014a95d7b64013 (patch)
treec06a07397d770855df4eb869177b3371abc536d4 /examples
parentb7f5acff6b5c7bcc61cea2808a0bedc0bc317aa5 (diff)
Feature #569 Load/Save Query By Example
Implement possibility to save/load/delete a QBE on a DB. Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/config.manyhosts.inc.php1
-rw-r--r--examples/create_tables.sql84
-rw-r--r--examples/create_tables_drizzle.sql72
3 files changed, 97 insertions, 60 deletions
diff --git a/examples/config.manyhosts.inc.php b/examples/config.manyhosts.inc.php
index b188aa8b86..bced1fca2c 100644
--- a/examples/config.manyhosts.inc.php
+++ b/examples/config.manyhosts.inc.php
@@ -47,4 +47,5 @@ foreach ($hosts as $host) {
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
+ $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
}
diff --git a/examples/create_tables.sql b/examples/create_tables.sql
index 0ac5654dc4..8ffbf5ef84 100644
--- a/examples/create_tables.sql
+++ b/examples/create_tables.sql
@@ -1,40 +1,40 @@
-- --------------------------------------------------------
-- SQL Commands to set up the pmadb as described in the documentation.
---
+--
-- This file is meant for use with MySQL 5 and above!
---
+--
-- This script expects the user pma to already be existing. If we would put a
-- line here to create him too many users might just use this script and end
-- up with having the same password for the controluser.
---
--- This user "pma" must be defined in config.inc.php (controluser/controlpass)
---
--- Please don't forget to set up the tablenames in config.inc.php
---
+--
+-- This user "pma" must be defined in config.inc.php (controluser/controlpass)
+--
+-- Please don't forget to set up the tablenames in config.inc.php
+--
-- --------------------------------------------------------
---
+--
-- Database : `phpmyadmin`
---
+--
CREATE DATABASE IF NOT EXISTS `phpmyadmin`
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
USE phpmyadmin;
-- --------------------------------------------------------
---
+--
-- Privileges
---
+--
-- (activate this statement if necessary)
-- GRANT SELECT, INSERT, DELETE, UPDATE ON `phpmyadmin`.* TO
-- 'pma'@localhost;
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__bookmark`
---
+--
CREATE TABLE IF NOT EXISTS `pma__bookmark` (
`id` int(11) NOT NULL auto_increment,
@@ -49,9 +49,9 @@ CREATE TABLE IF NOT EXISTS `pma__bookmark` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__column_info`
---
+--
CREATE TABLE IF NOT EXISTS `pma__column_info` (
`id` int(5) unsigned NOT NULL auto_increment,
@@ -70,9 +70,9 @@ CREATE TABLE IF NOT EXISTS `pma__column_info` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__history`
---
+--
CREATE TABLE IF NOT EXISTS `pma__history` (
`id` bigint(20) unsigned NOT NULL auto_increment,
@@ -89,9 +89,9 @@ CREATE TABLE IF NOT EXISTS `pma__history` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__pdf_pages`
---
+--
CREATE TABLE IF NOT EXISTS `pma__pdf_pages` (
`db_name` varchar(64) NOT NULL default '',
@@ -136,9 +136,9 @@ CREATE TABLE IF NOT EXISTS `pma__table_uiprefs` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__relation`
---
+--
CREATE TABLE IF NOT EXISTS `pma__relation` (
`master_db` varchar(64) NOT NULL default '',
@@ -155,9 +155,9 @@ CREATE TABLE IF NOT EXISTS `pma__relation` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__table_coords`
---
+--
CREATE TABLE IF NOT EXISTS `pma__table_coords` (
`db_name` varchar(64) NOT NULL default '',
@@ -172,9 +172,9 @@ CREATE TABLE IF NOT EXISTS `pma__table_coords` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__table_info`
---
+--
CREATE TABLE IF NOT EXISTS `pma__table_info` (
`db_name` varchar(64) NOT NULL default '',
@@ -187,9 +187,9 @@ CREATE TABLE IF NOT EXISTS `pma__table_info` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__designer_coords`
---
+--
CREATE TABLE IF NOT EXISTS `pma__designer_coords` (
`db_name` varchar(64) NOT NULL default '',
@@ -205,9 +205,9 @@ CREATE TABLE IF NOT EXISTS `pma__designer_coords` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__tracking`
---
+--
CREATE TABLE IF NOT EXISTS `pma__tracking` (
`db_name` varchar(64) NOT NULL,
@@ -250,7 +250,7 @@ CREATE TABLE IF NOT EXISTS `pma__users` (
`username` varchar(64) NOT NULL,
`usergroup` varchar(64) NOT NULL,
PRIMARY KEY (`username`,`usergroup`)
-)
+)
COMMENT='Users and their assignments to user groups'
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
@@ -265,10 +265,10 @@ CREATE TABLE IF NOT EXISTS `pma__usergroups` (
`tab` varchar(64) NOT NULL,
`allowed` enum('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`usergroup`,`tab`,`allowed`)
-)
+)
COMMENT='User groups with configured menu items'
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
-
+
-- --------------------------------------------------------
--
@@ -282,6 +282,24 @@ CREATE TABLE IF NOT EXISTS `pma__navigationhiding` (
`db_name` varchar(64) NOT NULL,
`table_name` varchar(64) NOT NULL,
PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`)
-)
+)
COMMENT='Hidden items of navigation tree'
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `pma__savedsearches`
+--
+
+CREATE TABLE IF NOT EXISTS `pma__savedsearches` (
+ `id` int(5) unsigned NOT NULL auto_increment,
+ `username` varchar(64) NOT NULL default '',
+ `db_name` varchar(64) NOT NULL default '',
+ `search_name` varchar(64) NOT NULL default '',
+ `search_data` text NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `u_savedsearches_username_dbname` (`username`,`db_name`,`search_name`)
+)
+ COMMENT='Saved searches'
+ DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
diff --git a/examples/create_tables_drizzle.sql b/examples/create_tables_drizzle.sql
index 698a15949d..71318caf77 100644
--- a/examples/create_tables_drizzle.sql
+++ b/examples/create_tables_drizzle.sql
@@ -1,27 +1,27 @@
-- --------------------------------------------------------
-- SQL Commands to set up the pmadb as described in the documentation.
---
+--
-- This file is meant for use with Drizzle 2011.03.13 and above!
---
+--
-- This script expects that you take care of database permissions.
--
-- Please don't forget to set up the tablenames in config.inc.php
---
+--
-- --------------------------------------------------------
---
+--
-- Database : `phpmyadmin`
---
+--
CREATE DATABASE IF NOT EXISTS `phpmyadmin`
COLLATE utf8_bin;
USE phpmyadmin;
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__bookmark`
---
+--
CREATE TABLE IF NOT EXISTS `pma__bookmark` (
`id` int(11) NOT NULL auto_increment,
@@ -36,9 +36,9 @@ CREATE TABLE IF NOT EXISTS `pma__bookmark` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__column_info`
---
+--
CREATE TABLE IF NOT EXISTS `pma__column_info` (
`id` int(5) NOT NULL auto_increment,
@@ -57,9 +57,9 @@ CREATE TABLE IF NOT EXISTS `pma__column_info` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__history`
---
+--
CREATE TABLE IF NOT EXISTS `pma__history` (
`id` bigint(20) NOT NULL auto_increment,
@@ -76,9 +76,9 @@ CREATE TABLE IF NOT EXISTS `pma__history` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__pdf_pages`
---
+--
CREATE TABLE IF NOT EXISTS `pma__pdf_pages` (
`db_name` varchar(64) NOT NULL default '',
@@ -123,9 +123,9 @@ CREATE TABLE IF NOT EXISTS `pma__table_uiprefs` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__relation`
---
+--
CREATE TABLE IF NOT EXISTS `pma__relation` (
`master_db` varchar(64) NOT NULL default '',
@@ -142,9 +142,9 @@ CREATE TABLE IF NOT EXISTS `pma__relation` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__table_coords`
---
+--
CREATE TABLE IF NOT EXISTS `pma__table_coords` (
`db_name` varchar(64) NOT NULL default '',
@@ -159,9 +159,9 @@ CREATE TABLE IF NOT EXISTS `pma__table_coords` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__table_info`
---
+--
CREATE TABLE IF NOT EXISTS `pma__table_info` (
`db_name` varchar(64) NOT NULL default '',
@@ -174,9 +174,9 @@ CREATE TABLE IF NOT EXISTS `pma__table_info` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__designer_coords`
---
+--
CREATE TABLE IF NOT EXISTS `pma__designer_coords` (
`db_name` varchar(64) NOT NULL default '',
@@ -192,9 +192,9 @@ CREATE TABLE IF NOT EXISTS `pma__designer_coords` (
-- --------------------------------------------------------
---
+--
-- Table structure for table `pma__tracking`
---
+--
CREATE TABLE IF NOT EXISTS `pma__tracking` (
`db_name` varchar(64) NOT NULL,
@@ -236,7 +236,7 @@ CREATE TABLE IF NOT EXISTS `pma__users` (
`username` varchar(64) NOT NULL,
`usergroup` varchar(64) NOT NULL,
PRIMARY KEY (`username`,`usergroup`)
-)
+)
COMMENT='Users and their assignments to user groups'
COLLATE utf8_bin;
@@ -251,10 +251,10 @@ CREATE TABLE IF NOT EXISTS `pma__usergroups` (
`tab` varchar(64) NOT NULL,
`allowed` enum('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`usergroup`,`tab`,`allowed`)
-)
+)
COMMENT='User groups with configured menu items'
COLLATE utf8_bin;
-
+
-- --------------------------------------------------------
--
@@ -268,6 +268,24 @@ CREATE TABLE IF NOT EXISTS `pma__navigationhiding` (
`db_name` varchar(64) NOT NULL,
`table_name` varchar(64) NOT NULL,
PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`)
-)
+)
COMMENT='Hidden items of navigation tree'
COLLATE utf8_bin;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `pma__savedsearches`
+--
+
+CREATE TABLE IF NOT EXISTS `pma__savedsearches` (
+ `id` int(5) unsigned NOT NULL auto_increment,
+ `username` varchar(64) NOT NULL default '',
+ `db_name` varchar(64) NOT NULL default '',
+ `search_name` varchar(64) NOT NULL default '',
+ `search_data` text NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `u_savedsearches_username_dbname` (`username`,`db_name`,`search_name`)
+)
+ COMMENT='Saved searches'
+ DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;