SF.net SVN: postfixadmin: [374] trunk/upgrade.php
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2008-05-26 21:05:47
|
Revision: 374 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=374&view=rev Author: christian_boltz Date: 2008-05-26 14:05:51 -0700 (Mon, 26 May 2008) Log Message: ----------- upgrade.php - upgrade_373_mysql: change domain.description and mailbox.name to utf-8 https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1972703&group_id=191583 Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2008-05-25 21:19:58 UTC (rev 373) +++ trunk/upgrade.php 2008-05-26 21:05:51 UTC (rev 374) @@ -953,3 +953,22 @@ db_query_parsed("CREATE INDEX alias_domain_active ON $table_alias_domain(alias_domain,active)"); db_query_parsed("COMMENT ON TABLE $table_alias_domain IS 'Postfix Admin - Domain Aliases'"); } + +/** + * Change description fields to UTF-8 + */ +function upgrade_373_mysql() { # MySQL only + $table_domain = table_by_key ('domain'); + $table_mailbox = table_by_key('mailbox'); + + $all_sql = split("\n", trim(" + ALTER TABLE `$table_domain` CHANGE `description` `description` VARCHAR( 255 ) {UTF-8} NOT NULL + ALTER TABLE `$table_mailbox` CHANGE `name` `name` VARCHAR( 255 ) {UTF-8} NOT NULL + ")); + + foreach ($all_sql as $sql) { + $result = db_query_parsed($sql); + } +} + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |