kopia lustrzana https://github.com/magicbug/Cloudlog
Only alter COL_AWARD_SUMMITED if it exists in the qso table
rodzic
3daeff714b
commit
c10fadebeb
|
@ -12,11 +12,20 @@ class Migration_award_submitted_typo extends CI_Migration {
|
|||
|
||||
public function up()
|
||||
{
|
||||
$this->db->query(
|
||||
'ALTER TABLE ' .
|
||||
$this->db->escape_identifiers($this->config->item('table_name')) .
|
||||
' CHANGE COL_AWARD_SUMMITED COL_AWARD_SUBMITTED VARCHAR(255)'
|
||||
);
|
||||
// if COL_AWARD_SUMMITED column exists, change it to COL_AWARD_SUBMITTED
|
||||
$fields = $this->db->field_data($this->config->item('table_name'));
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
if ($field->name == 'COL_AWARD_SUMMITED')
|
||||
{
|
||||
$this->db->query(
|
||||
'ALTER TABLE ' .
|
||||
$this->db->escape_identifiers($this->config->item('table_name')) .
|
||||
' CHANGE COL_AWARD_SUMMITED COL_AWARD_SUBMITTED VARCHAR(255)'
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
|
|
Ładowanie…
Reference in New Issue