summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-03-04 18:12:10 +0000
committerDries Buytaert <dries@buytaert.net>2006-03-04 18:12:10 +0000
commit650f22bc7f900699dd4cb133af507ac0d952745d (patch)
tree7a0207da4f1b77cd347f4a1ff456fe1d61520ed8 /database
parent1f39ad146a903c86b6e6f85a0a9fb3458546ff88 (diff)
downloadbrdo-650f22bc7f900699dd4cb133af507ac0d952745d.tar.gz
brdo-650f22bc7f900699dd4cb133af507ac0d952745d.tar.bz2
- Patch #52265 by Zen: converted filter.module to file API:
* Converts filter.module to the fapi model (besides filter_admin_overview which has already been done.) * On the format edit screen, updates to the roles fieldset were being mangled with the previous code. The previous code relied on only checked checkboxes being returned. Fapi for some reason decides to insert non-checked items as well with values 0. * Makes the name field a UNIQUE field. DB and update patches included. Having a duplicate format name completely b0rks things. * Adds check_plain to the format name in admin_overview. * Removes unnecessary #type => 'markup'. * Moves hook_menu to below hook_help. * drupal_goto -> return.
Diffstat (limited to 'database')
-rw-r--r--database/database.mysql3
-rw-r--r--database/database.pgsql3
-rw-r--r--database/updates.inc5
3 files changed, 9 insertions, 2 deletions
diff --git a/database/database.mysql b/database/database.mysql
index 3895fa336..78b7f5865 100644
--- a/database/database.mysql
+++ b/database/database.mysql
@@ -308,7 +308,8 @@ CREATE TABLE filter_formats (
name varchar(255) NOT NULL default '',
roles varchar(255) NOT NULL default '',
cache tinyint(2) NOT NULL default '0',
- PRIMARY KEY (format)
+ PRIMARY KEY (format),
+ UNIQUE KEY (name)
)
/*!40100 DEFAULT CHARACTER SET utf8 */ ;
diff --git a/database/database.pgsql b/database/database.pgsql
index a83393945..1628a4b74 100644
--- a/database/database.pgsql
+++ b/database/database.pgsql
@@ -293,7 +293,8 @@ CREATE TABLE filter_formats (
name varchar(255) NOT NULL default '',
roles varchar(255) NOT NULL default '',
cache smallint NOT NULL default '0',
- PRIMARY KEY (format)
+ PRIMARY KEY (format),
+ UNIQUE (name)
);
--
diff --git a/database/updates.inc b/database/updates.inc
index f43cf57e5..ddf3c4500 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -1669,3 +1669,8 @@ function system_update_175() {
}
return array();
}
+
+function system_update_176() {
+ $ret[] = update_sql('ALTER TABLE {filter_formats} ADD UNIQUE KEY (name)');
+ return $ret;
+}