Skip to content

Commit

Permalink
Merge pull request #36 from mageplaza/develop
Browse files Browse the repository at this point in the history
Performance improvement
  • Loading branch information
imsamthomas authored Dec 28, 2017
2 parents 1a42a40 + 312ca9a commit efc92c1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 44 deletions.
99 changes: 57 additions & 42 deletions Setup/UpgradeSchema.php
Original file line number Diff line number Diff line change
@@ -1,65 +1,80 @@
<?php
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_Smtp
* @copyright Copyright (c) 2017 Mageplaza (https://www.mageplaza.com/)
* @license http://mageplaza.com/LICENSE.txt
*/

namespace Mageplaza\Smtp\Setup;

use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UpgradeSchemaInterface;

/**
* Class UpgradeSchema
* @package Mageplaza\SeoRule\Setup
* @package Mageplaza\Smtp\Setup
*/
class UpgradeSchema implements UpgradeSchemaInterface
{
/**
* @param \Magento\Framework\Setup\SchemaSetupInterface $setup
* @param \Magento\Framework\Setup\ModuleContextInterface $context
*/
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();

/**
* @param \Magento\Framework\Setup\SchemaSetupInterface $setup
* @param \Magento\Framework\Setup\ModuleContextInterface $context
*/
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();

if( version_compare($context->getVersion(), '1.1.0', '<' )){
if (version_compare($context->getVersion(), '1.1.0', '<')) {
$setup->getConnection()
->addColumn($setup->getTable('mageplaza_smtp_log'), 'from', [
'type' => Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'comment' => 'Sender'
]
);
'type' => Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'comment' => 'Sender'
]
);
$setup->getConnection()
->addColumn($setup->getTable('mageplaza_smtp_log'), 'to', [
'type' => Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'comment' => 'Recipient'
]
);
'type' => Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'comment' => 'Recipient'
]
);
$setup->getConnection()
->addColumn($setup->getTable('mageplaza_smtp_log'), 'cc', [
'type' => Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'comment' => 'Cc'
]
);
'type' => Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'comment' => 'Cc'
]
);
$setup->getConnection()
->addColumn($setup->getTable('mageplaza_smtp_log'), 'bcc', [
'type' => Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'comment' => 'Bcc'
]
);
}

$setup->endSetup();
}


'type' => Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'comment' => 'Bcc'
]
);
}

$setup->endSetup();
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "SMTP Extension for Magento 2 helps the owner of store simply install SMTP (Simple Mail Transfer Protocol) server which transmits the messages into codes or numbers",
"license": "Mageplaza License",
"type": "magento2-module",
"version": "1.1.0",
"version": "1.1.1",
"authors": [
{
"email": "[email protected]",
Expand All @@ -14,7 +14,7 @@
],
"minimum-stability": "dev",
"require": {
"mageplaza/module-core": "*"
"mageplaza/module-core": "^1.3.7"
},
"keywords": [
"magento 2",
Expand Down
3 changes: 3 additions & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<smtp>
<module>
<type>1</type>
</module>
<developer>
<clean_email>10</clean_email>
</developer>
Expand Down

0 comments on commit efc92c1

Please sign in to comment.