Skip to content

Commit

Permalink
Use migrate() in setup task because mysql() isn't supported any more
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Nov 8, 2017
1 parent 0bfde0c commit 9140311
Show file tree
Hide file tree
Showing 71 changed files with 85 additions and 85 deletions.
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/AttributeChangeTypeidNotNull.php
Expand Up @@ -51,7 +51,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/CatalogAddCode.php
Expand Up @@ -46,7 +46,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/CatalogIndexRenameDomainTables.php
Expand Up @@ -47,7 +47,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/CatalogRemoveSuggest.php
Expand Up @@ -55,7 +55,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/CatalogTreeToCatalog.php
Expand Up @@ -60,7 +60,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/ColumnDomainChangeLength.php
Expand Up @@ -145,7 +145,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/CouponAddMtimeCtimeEditor.php
Expand Up @@ -80,7 +80,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/CouponMigrateConfigKeys.php
Expand Up @@ -71,7 +71,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
Expand Up @@ -120,7 +120,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/GlobalMoveTablesToLocale.php
Expand Up @@ -63,7 +63,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/JobRenameUser.php
Expand Up @@ -42,7 +42,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/JobTableConvertToInnoDB.php
Expand Up @@ -43,7 +43,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/ListsAddStatus.php
Expand Up @@ -84,7 +84,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/ListsAddTypeid.php
Expand Up @@ -84,7 +84,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/ListsChangeTypeidNotNull.php
Expand Up @@ -99,7 +99,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->msg( 'Changing typeid to not allow NULL values', 0 );
$this->status( '' );
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/LocaleChangeSitesToTree.php
Expand Up @@ -60,7 +60,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysqlColumns, $this->mysqlMigrate );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/MShopAddCodeData.php
Expand Up @@ -40,7 +40,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
// executed by tasks in sub-directories for specific sites
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/MShopAddDataAbstract.php
Expand Up @@ -62,7 +62,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
// executed by tasks in sub-directories for specific sites
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/MShopAddPluginData.php
Expand Up @@ -40,7 +40,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
// executed by tasks in sub-directories for specific sites
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/MShopAddTypeData.php
Expand Up @@ -44,7 +44,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
// executed by tasks in sub-directories for specific sites
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/MediaChangeTypeidNotNull.php
Expand Up @@ -50,7 +50,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderAddBaseProductProductid.php
Expand Up @@ -46,7 +46,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderAddBaseProductWarehouse.php
Expand Up @@ -45,7 +45,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderAddBaseServiceServiceid.php
Expand Up @@ -46,7 +46,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderAddSiteId.php
Expand Up @@ -102,7 +102,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderAddTax.php
Expand Up @@ -56,7 +56,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderAddressMigrateSalutation.php
Expand Up @@ -49,7 +49,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderFixEmailStatus.php
Expand Up @@ -55,7 +55,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderMigrateEmailflag.php
Expand Up @@ -54,7 +54,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderMigrateFlag.php
Expand Up @@ -54,7 +54,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderMigrateType.php
Expand Up @@ -47,7 +47,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
6 changes: 3 additions & 3 deletions lib/mshoplib/setup/OrderRenameBaseCustomerCodeToId.php
Expand Up @@ -16,7 +16,7 @@
class OrderRenameBaseCustomerCodeToId extends \Aimeos\MW\Setup\Task\Base
{
private $mysql = array(
'mshop_order_base' =>
'mshop_order_base' =>
'ALTER TABLE "mshop_order_base" CHANGE "customercode" "customerid" VARCHAR(32) NOT NULL'
);

Expand Down Expand Up @@ -46,7 +46,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down Expand Up @@ -75,5 +75,5 @@ protected function process( array $stmts )
$this->status( 'OK' );
}
}
}
}
}
26 changes: 13 additions & 13 deletions lib/mshoplib/setup/OrderRenameBaseProductAmountToQuantity.php
Expand Up @@ -16,11 +16,11 @@
class OrderRenameBaseProductAmountToQuantity extends \Aimeos\MW\Setup\Task\Base
{
private $mysql = array(
'mshop_order_base_product' =>
'mshop_order_base_product' =>
'ALTER TABLE "mshop_order_base_product" CHANGE "amount" "quantity" INTEGER NOT NULL'
);


/**
* Returns the list of task names which this task depends on.
*
Expand All @@ -30,8 +30,8 @@ public function getPreDependencies()
{
return array( 'OrderRenameTables' );
}


/**
* Returns the list of task names which depends on this task.
*
Expand All @@ -41,17 +41,17 @@ public function getPostDependencies()
{
return array( 'TablesCreateMShop' );
}


/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}


/**
* Renames column amount to quantity if amount exists.
*
Expand All @@ -60,11 +60,11 @@ protected function mysql()
protected function process( array $stmts )
{
$this->msg( 'Renaming order base product amount to quantity', 0 ); $this->status( '' );

foreach( $stmts as $table => $stmt )
{
$this->msg( sprintf( 'Checking table "%1$s": ', $table ), 1 );

if( $this->schema->tableExists( $table ) && $this->schema->columnExists( $table, 'amount' ) === true )
{
$this->execute( $stmt );
Expand All @@ -75,5 +75,5 @@ protected function process( array $stmts )
$this->status( 'OK' );
}
}
}
}
}
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderRenameColumns.php
Expand Up @@ -48,7 +48,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/mshoplib/setup/OrderRenameDomainToType.php
Expand Up @@ -55,7 +55,7 @@ public function getPostDependencies()
/**
* Executes the task for MySQL databases.
*/
protected function mysql()
public function migrate()
{
$this->process( $this->mysql );
}
Expand Down

0 comments on commit 9140311

Please sign in to comment.