Questions tagged «upgrade-script»

2
Magento2:如何升级数据库架构
我正在magento自定义模块上工作,在模块已Setup\InstallSchema.php安装文件之前。我在中添加了更多数据库字段,InstallSchema.php因此我想更新表结构,但表未应用任何更改。 我如何将架构更改应用于数据库表? 我有流程cli命令来更新架构,但没有成功。 php bin/magento setup:db-schema:upgrade 和 php bin/magento setup:upgrade


3
如何在Magento 2中以编程方式添加CMS块?
我需要通过安装/升级脚本添加CMS块。我已经弄清楚了如何添加“普通” CMS页面,如下面的脚本所示。但是,由于我找不到在Magento 2的代码中添加CMS块的任何方法,因此无论是在Google还是在这里,我都很困惑。 namespace [Vendor]\[Module]\Setup; use Magento\Cms\Model\Page; use Magento\Cms\Model\PageFactory; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Framework\Setup\UpgradeDataInterface; class UpgradeData implements UpgradeDataInterface { /** * Page factory. * * @var PageFactory */ private $pageFactory; /** * Init. * * @param PageFactory $pageFactory */ public function __construct(PageFactory $pageFactory) { $this->pageFactory = $pageFactory; } /** …



3
Magento 2将“ VARCHAR”类型字段添加到自定义表中
请查看位于以下位置的当前核心数据库适配器文件(Table.php): magento-2 /供应商/ magento /框架/ DB / Ddl: <?php /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ /** * Data Definition for table * * @author Magento Core Team <core@magentocommerce.com> */ namespace Magento\Framework\DB\Ddl; use Magento\Framework\DB\Adapter\AdapterInterface; class Table { /** * Types of …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.