mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
fix missing column (we should call the command and not only write it in the array)
This commit is contained in:
@@ -137,12 +137,10 @@ class Migration_adif_315 extends CI_Migration {
|
|||||||
* https://adif.org/315/ADIF_315_annotated.htm#Primary_Administrative_Subdivision
|
* https://adif.org/315/ADIF_315_annotated.htm#Primary_Administrative_Subdivision
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$prim_subdiv = [];
|
|
||||||
|
|
||||||
// Add a column to flag entries as deprecated
|
// Add a column to flag entries as deprecated
|
||||||
$col_check = $this->db->query("SHOW COLUMNS FROM `primary_subdivisions` LIKE 'deprecated';")->num_rows() > 0;
|
$col_check = $this->db->query("SHOW COLUMNS FROM `primary_subdivisions` LIKE 'deprecated';")->num_rows() > 0;
|
||||||
if (!$col_check) {
|
if (!$col_check) {
|
||||||
$prim_subdiv[] = "ALTER TABLE `primary_subdivisions` ADD COLUMN deprecated TINYINT(1) DEFAULT 0;";
|
$this->db->query("ALTER TABLE `primary_subdivisions` ADD COLUMN deprecated TINYINT(1) DEFAULT 0");
|
||||||
} else {
|
} else {
|
||||||
log_message('info', 'Column "deprecated" already exists, skipping ALTER TABLE.');
|
log_message('info', 'Column "deprecated" already exists, skipping ALTER TABLE.');
|
||||||
}
|
}
|
||||||
@@ -158,6 +156,7 @@ class Migration_adif_315 extends CI_Migration {
|
|||||||
// Add Unique IDX
|
// Add Unique IDX
|
||||||
$this->add_unique_ix('`primary_subdivisions`','IDX_UNIQ_SUBDIVISON#adif#state#deprecated','`adif`,`state`,`deprecated`');
|
$this->add_unique_ix('`primary_subdivisions`','IDX_UNIQ_SUBDIVISON#adif#state#deprecated','`adif`,`state`,`deprecated`');
|
||||||
|
|
||||||
|
$prim_subdiv = [];
|
||||||
|
|
||||||
// Mark 'Märket' as deprecated
|
// Mark 'Märket' as deprecated
|
||||||
$prim_subdiv[] = "UPDATE `primary_subdivisions` SET deprecated = 1 WHERE adif = '5' AND state = '051';";
|
$prim_subdiv[] = "UPDATE `primary_subdivisions` SET deprecated = 1 WHERE adif = '5' AND state = '051';";
|
||||||
|
|||||||
Reference in New Issue
Block a user