X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-country.php;h=1f3466aa979b383c0bd5b233e039451554719e33;hb=3c1445d229281a0c3e13e9d823236a95ef6ff2db;hp=5ed4b84c997ceb8ea075be5075294271a09bef6e;hpb=5cbe0f6707ac473dc2ba431236bc4a6e2600a699;p=mailer.git diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index 5ed4b84c99..1f3466aa97 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -17,7 +17,7 @@ * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -43,24 +43,26 @@ if (!defined('__SECURITY')) { // Version number setThisExtensionVersion('0.0.4'); -// Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4')); +// Version history array (add more with , '0.0.1' and so on) +setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4')); // Keep this extension always active! setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'register': // Do stuff when installation is running // SQL commands to run addDropTableSql('countries'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_countries` ( + addCreateTableSql('countries', " `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `code` CHAR(2) NOT NULL DEFAULT 'DE', `descr` VARCHAR(255) NOT NULL DEFAULT 'Deutschland', `is_active` ENUM('Y','N') NOT NULL DEFAULT 'N', -KEY (`code`), -PRIMARY KEY (`id`) -) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci"); +PRIMARY KEY (`id`), +UNIQUE (`code`)", + 'Country codes and their full-length descriptions'); + + // Insert first (Germany) country addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')"); // Admin menu