Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed value of columns not updating in ui_bookmark table #18699

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions app/code/Magento/Ui/Setup/UpgradeSchema.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Ui\Setup;

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

/**
* Upgrade the UI module DB scheme
*/
class UpgradeSchema implements UpgradeSchemaInterface
{
/**
* {@inheritdoc}
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();

if (version_compare($context->getVersion(), '2.0.1', '<')) {
$tableName = $setup->getTable('ui_bookmark');
if ($setup->getConnection()->isTableExists($tableName) == true) {
$columns = [
'created_at' => [
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
'nullable' => false,
'comment' => 'Bookmark created at',
'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT
],
'updated_at' => [
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
'nullable' => false,
'comment' => 'Bookmark updated at',
'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE
]
];
$connection = $setup->getConnection();

foreach ($columns as $name => $definition) {
$connection->modifyColumn($tableName, $name, $definition);
}
}
}

$setup->endSetup();
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Ui/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_Ui" setup_version="2.0.0">
<module name="Magento_Ui" setup_version="2.0.1">
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Directory"/>
Expand Down