Questions tagged [setup-script]

Installer/Update script

Filter by
Sorted by
Tagged with
29 votes
2 answers
51k views

Magento2 : How to database schema upgrade

I am working on magento custom module, in module have Setup\InstallSchema.php file which is installed before. i have added some more database fields in InstallSchema.php so i want to update table ...
Suresh Chikani's user avatar
10 votes
1 answer
23k views

Create Magento 2 Upgrade Script to add/update new field into custom module table

Anybody have any idea/suggestion about creating Magento 2(CE Stable version) Upgrade Script(in custom-module) for adding/updating new field into custom table ? I know about "InstallSchema" but is ...
Vicky Dev's user avatar
  • 1,992
3 votes
1 answer
1k views

What is the order of execution of setup scripts in a module?

1) Can there be multiple install scripts in the custom module? For example: data-install-1.0.0.php data-install-1.0.1.php 2) Assuming I have the following scripts inside app/code/local/Company/...
zitix's user avatar
  • 2,192
4 votes
1 answer
6k views

Add a column to quote item table

I want to add a column to the sales_flat_quote_item (and ..._order_item) table through an install script, but when I go to the table sales_flat_quote_item (or ..._order_item) in my database - the ...
Syspect's user avatar
  • 1,283
2 votes
4 answers
5k views

How to assign a theme in Magento 2 using a setup script?

How can we assign a theme in Magento 2.1 to a store using setup scripts? Thank you
Bhargav Mehta's user avatar
9 votes
6 answers
4k views

Magento2: Setup Script not loaded

I've been banging my head for a few hours now. I have setup a small Magento 2 module. It is enabled everything is working except the Setup scripts never run. Actually from my diagnosis right now, they ...
Michaël St-Georges's user avatar
6 votes
3 answers
857 views

Avoid conflicts in setup scripts with multiple developers

We are using Magento setup scripts located in the sql and data directories to propagate data changes to all working copies and environments. This includes configuration settings, creation of new ...
Matthias Zeis's user avatar
5 votes
2 answers
9k views

Add Field to Customer Registation Form Magento 2

I want to add a field/attribute to Customer Registration Form on frontend. And I create a folder in my module , the folder is "Setup" and I put inside a file "InstallData.php" but this doesn't work. ...
Riccardo Amadio's user avatar
5 votes
1 answer
1k views

Can I use a .sql file in my Magento module installer?

I have a large SQL file. Can I use this in my module installer?
Kurdt94's user avatar
  • 149
5 votes
2 answers
2k views

How to export/import configs in Magento?

We want switch to an integration system with our Magento installations. But I do not know how to export/import settings for deployment process. I know in Drupal you use modules like Features and ...
Jurik's user avatar
  • 213
3 votes
2 answers
2k views

Magento 2 new order attribute

I have been trying to create a new order attribute in Magento 2, but not successful yet. I have created a new module and this is already showing. I added the different codes available in my setup ...
Geethika Antony's user avatar
3 votes
4 answers
13k views

assign attribute to attribute set

How to assign particular attribute set to newly created attribute? My code is eavSetup->addAttribute( \Magento\Catalog\Model\Product::ENTITY, 'test_demo221', [ //...
jagriti joshi's user avatar
2 votes
1 answer
2k views

Add custom drop-down in Shipping Method

Basically I am trying to add new custom drop-down option with values in Shipping Method option, in one page checkout. I am following this tutorial to create attributes and confused about some issues. ...
Lazar's user avatar
  • 163
2 votes
3 answers
313 views

2 module setup scripts dependence

I have 2 modules: ModuleA and ModuleB. ModuleA creates some categories in a data install script. ModuleB creates a new category attribute in a data install script. (the modules do other things, but ...
Marty Wallace's user avatar
1 vote
2 answers
3k views

Recurring.php and RecurringData.php

Can anybody explain the purpose of this two files in Setup folder? When should I use it? I know, that it fires every time when I run setup:upgrade But I want to know at least one example of usage. ...
Stepan Furman's user avatar
1 vote
0 answers
44 views

Problems While Creating Product Attribute With InstallData

I've created InstallData for creating product attribute with default options to be set yes like, used_in_product_listing and is_used_for_promo_rules Probelm is only used_in_product_listing is ...
anonymous's user avatar
  • 3,722
1 vote
2 answers
1k views

Create Column in Quote Payment Table in magento2

i want to add new column in Quote payment table i tried script but not working <?php namespace Ibnab\Additional\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\...
3434's user avatar
  • 213
1 vote
1 answer
105 views

Multiple setup types in same module

I have a module which adds some catalog attributes and some sales attributes. Usually i would extend the correct setup type for which i want to add attributes for but obviously cannot do this here ...
Marty Wallace's user avatar
1 vote
2 answers
2k views

Can we call model methods in Magento setup scripts?

Can we call model methods in Magento setup scripts? I tried this, setup script is executed (new entry appears in the database table core_resource) but model methods are not executed (I added Mage:log('...
zitix's user avatar
  • 2,192
1 vote
2 answers
674 views

Add new option to existing product attribute

I am trying to use the function addAttributeOption to add a new option to an attribute. I do not want to change the current option order or defaults but simply want to append a new option to the end ...
David Manners's user avatar
0 votes
1 answer
501 views

updateAttribute() function is not working on order attribute

i am trying to update an sales order attribute default using updateAttribute() function But it is not working. code is here: $installer = $this; /* @var $installer ...
Amit Bera's user avatar
  • 77.5k
0 votes
0 answers
319 views

How to add a Megamenu programmatically in Magento 2?

I need to add Megamenu via an install/upgrade script. I've added my megamenu. I've figured out which tables get updated when I add Megamenu. The table which gets updated is mgs_megamenu ...
summu's user avatar
  • 847