first commit
This commit is contained in:
30
upgrade/list/upgrade.2009-09-14.php
Normal file
30
upgrade/list/upgrade.2009-09-14.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
class Upgrade3 extends UpgradeNew
|
||||
{
|
||||
// overi, jestli je opravnene provest upgrade
|
||||
public function checkRightfulness_1()
|
||||
{
|
||||
$change = true;
|
||||
|
||||
$SQL = sqlQuery('SHOW FIELDS FROM '.getTableName('products_variations_choices_values'));
|
||||
while ($row = sqlFetchArray($SQL)) {
|
||||
if ($row['Field'] == 'code') {
|
||||
$change = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $change;
|
||||
}
|
||||
|
||||
// provest samotny upgrade
|
||||
public function makeChanges_1()
|
||||
{
|
||||
sqlQuery('ALTER TABLE '.getTableName('products_variations_choices_values').' ADD `code` VARCHAR(32) NOT NULL;');
|
||||
|
||||
sqlQuery('UPDATE '.getTableName('products_variations_choices_values').' SET code=value;');
|
||||
|
||||
$this->upgradeOK();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user