dxcc tables: extend prefix/call field to 32 characters

While importing the clublog data, I noticed there's an entry
with a 11 character callsign. This is longer than the 10 characters
allowed for the field, causing a problem. This commit extends it to
32 characters, which should be more than enough, while also being a
power of 2.

fixes #272
这个提交包含在:
Michael Cullen 2019-05-17 02:00:11 +01:00
父节点 2f85b199be
当前提交 fb1e949acf
共有 3 个文件被更改,包括 26 次插入7 次删除

查看文件

@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to. | be upgraded / downgraded to.
| |
*/ */
$config['migration_version'] = 14; $config['migration_version'] = 15;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

查看文件

@ -0,0 +1,19 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_extenddxccprefix extends CI_Migration {
public function up()
{
$this->db->query("ALTER TABLE dxcc CHANGE COLUMN `prefix` `prefix` varchar(32) NOT NULL; # was varchar(10) NOT NULL");
$this->db->query("ALTER TABLE dxcc_entities CHANGE COLUMN `prefix` `prefix` varchar(32) NOT NULL; # was varchar(10) NOT NULL");
$this->db->query("ALTER TABLE dxcc_exceptions CHANGE COLUMN `call` `call` varchar(32) NOT NULL; # was varchar(10) NOT NULL");
$this->db->query("ALTER TABLE dxcc_prefixes CHANGE COLUMN `call` `call` varchar(32) NOT NULL; # was varchar(10) NOT NULL");
}
public function down(){
$this->db->query("ALTER TABLE dxcc CHANGE COLUMN `prefix` `prefix` varchar(10) NOT NULL; # was varchar(10) NOT NULL");
$this->db->query("ALTER TABLE dxcc_entities CHANGE COLUMN `prefix` `prefix` varchar(10) NOT NULL; # was varchar(10) NOT NULL");
$this->db->query("ALTER TABLE dxcc_exceptions CHANGE COLUMN `call` `call` varchar(10) NOT NULL; # was varchar(10) NOT NULL");
$this->db->query("ALTER TABLE dxcc_prefixes CHANGE COLUMN `call` `call` varchar(10) NOT NULL; # was varchar(10) NOT NULL");
}
}

查看文件

@ -115,7 +115,7 @@ CREATE TABLE `contests` (
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `dxcc`; DROP TABLE IF EXISTS `dxcc`;
CREATE TABLE `dxcc` ( CREATE TABLE `dxcc` (
`prefix` varchar(10) NOT NULL, `prefix` varchar(32) NOT NULL,
`name` varchar(150) DEFAULT NULL, `name` varchar(150) DEFAULT NULL,
`cqz` float NOT NULL, `cqz` float NOT NULL,
`ituz` float NOT NULL, `ituz` float NOT NULL,
@ -3555,7 +3555,7 @@ CREATE TABLE `migrations` (
-- ---------------------------- -- ----------------------------
-- Records of migrations -- Records of migrations
-- ---------------------------- -- ----------------------------
INSERT INTO `migrations` VALUES ('14'); INSERT INTO `migrations` VALUES ('15');
-- ---------------------------- -- ----------------------------
-- Table structure for notes -- Table structure for notes
@ -3909,7 +3909,7 @@ INSERT INTO `users` VALUES ('4', 'm0abc', '$2a$08$r9UF3YhipAY6htSQoZRjeOFDx3Yuh7
CREATE TABLE `dxcc_entities` ( CREATE TABLE `dxcc_entities` (
`adif` smallint(6) NOT NULL, `adif` smallint(6) NOT NULL,
`name` varchar(150) DEFAULT NULL, `name` varchar(150) DEFAULT NULL,
`prefix` varchar(10) NOT NULL, `prefix` varchar(32) NOT NULL,
`cqz` smallint(6) NOT NULL, `cqz` smallint(6) NOT NULL,
`ituz` smallint(6) NOT NULL, `ituz` smallint(6) NOT NULL,
`cont` varchar(5) NOT NULL, `cont` varchar(5) NOT NULL,
@ -3921,7 +3921,7 @@ CREATE TABLE `dxcc_entities` (
CREATE TABLE `dxcc_exceptions` ( CREATE TABLE `dxcc_exceptions` (
`record` int(11) NOT NULL, `record` int(11) NOT NULL,
`call` varchar(10) DEFAULT NULL, `call` varchar(32) DEFAULT NULL,
`entity` varchar(255) NOT NULL, `entity` varchar(255) NOT NULL,
`adif` smallint(6) NOT NULL, `adif` smallint(6) NOT NULL,
`cqz` smallint(6) NOT NULL, `cqz` smallint(6) NOT NULL,
@ -3934,7 +3934,7 @@ CREATE TABLE `dxcc_exceptions` (
CREATE TABLE `dxcc_prefixes` ( CREATE TABLE `dxcc_prefixes` (
`record` int(11) NOT NULL, `record` int(11) NOT NULL,
`call` varchar(10) DEFAULT NULL, `call` varchar(32) DEFAULT NULL,
`entity` varchar(255) NOT NULL, `entity` varchar(255) NOT NULL,
`adif` smallint(6) NOT NULL, `adif` smallint(6) NOT NULL,
`cqz` smallint(6) NOT NULL, `cqz` smallint(6) NOT NULL,
@ -3961,4 +3961,4 @@ ALTER TABLE `dxcc_exceptions`
-- Indexes for table `dxcc_prefixes` -- Indexes for table `dxcc_prefixes`
-- --
ALTER TABLE `dxcc_prefixes` ALTER TABLE `dxcc_prefixes`
ADD PRIMARY KEY (`record`); ADD PRIMARY KEY (`record`);