first commit
This commit is contained in:
30
upgrade/list/upgrade.2011-05-03.php
Normal file
30
upgrade/list/upgrade.2011-05-03.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
class Upgrade7 extends UpgradeNew
|
||||
{
|
||||
// overi, jestli je opravnene provest upgrade
|
||||
public function checkRightfulness_1()
|
||||
{
|
||||
$change = true;
|
||||
|
||||
$SQL = sqlQuery('SHOW FIELDS FROM '.getTableName('products'));
|
||||
while ($row = sqlFetchArray($SQL)) {
|
||||
if ($row['Field'] == 'ean') {
|
||||
$change = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $change;
|
||||
}
|
||||
|
||||
// provest samotny upgrade
|
||||
public function makeChanges_1()
|
||||
{
|
||||
sqlQuery('ALTER TABLE '.getTableName('products').' ADD ean BIGINT NULL AFTER code;');
|
||||
|
||||
sqlQuery('ALTER TABLE '.getTableName('products_variations').' ADD ean BIGINT NULL AFTER id_product;');
|
||||
|
||||
$this->upgradeOK();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user