X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-country.php;h=2b2db4e8a9ae8f2ab541f9e6d04c9b471cd58ac7;hb=f4d7dc336fde4cebc47701026a94d193f77854a1;hp=b6227f148d21c2853a3113c26465b684f02731aa;hpb=9725980ca9c052e5c1a9edb8b815e8506b876448;p=mailer.git diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index b6227f148d..2b2db4e8a9 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -43,24 +43,24 @@ 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 - addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_countries` ( + addDropTableSql('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"); +) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Country codes and their full-length descriptions'"); addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')"); // Admin menu @@ -73,7 +73,7 @@ PRIMARY KEY (`id`) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`'); + addDropTableSql('countries'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='country'"); break;