countries_api.install in Country codes API 5
File
countries_api.install
View source
<?php
function countries_api_install() {
switch ($GLOBALS['db_type']) {
case 'mysqli':
case 'mysql':
db_query("CREATE TABLE {countries_api_countries} (\n iso2 char(2) NOT NULL DEFAULT '',\n iso3 char(3) NOT NULL,\n name varchar(80) NOT NULL,\n printable_name varchar(80) NOT NULL,\n numcode smallint(6),\n PRIMARY KEY (iso2)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break;
}
require_once dirname(__FILE__) . '/countries_api.module';
countries_api_csv_import_countries();
}
function countries_api_uninstall() {
db_query('DROP TABLE {countries_api_countries}');
}
function countries_api_update_5101() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysqli':
case 'mysql':
db_query("DROP TABLE IF EXISTS {countries_api_countries}");
$ret[] = update_sql("CREATE TABLE {countries_api_countries} (\n iso2 char(2) NOT NULL DEFAULT '',\n iso3 char(3) NOT NULL,\n name varchar(80) NOT NULL,\n printable_name varchar(80) NOT NULL,\n numcode smallint(6),\n PRIMARY KEY (iso2)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break;
}
require_once dirname(__FILE__) . '/countries_api.module';
countries_api_csv_import_countries();
return $ret;
}