Questions tagged [setup-script]
Installer/Update script
146 questions
0 votes
2 answers
101 views
Create custom attribute for specifi product
i'm tring to create a custom attribute only for a specific product. Into apply_to field i have setted a list "configurable, grouped" , a array('configurable', 'grouped') or single type, but ...
2 votes
0 answers
420 views
Magento 2 - How To Generate Custom Data Fixture For Integration Testing
I'm required to generate 1000+ orders to test an integration + address verification. I've come across this data generation technique in my search and wish to create my own data fixture based off: ...
0 votes
2 answers
168 views
Magento 1.9: Sql setup Stripe module not execute
I'm installing throught composer the Stripe module, the problem is that when I installed the site, where the module work, crash because can't find the table in Database. I don't know why the setup sql ...
0 votes
0 answers
157 views
boolean order attribute won't save correctly in Magento 1.9
I have created my boolean order attribute /* @var $installer \Mage_Sales_Model_Resource_Setup */ $installer = $this; $installer->startSetup(); $smsAttribute = [ 'type' => 'int', 'label'...
0 votes
1 answer
797 views
Customer custom attribute value did not save using rest api in magento 2.3?
Customer custom attribute value did not save using rest API in Magento 2.3? API URL: http://127.0.0.1/magento2/rest/V1/customers Method: POST My POST JSON request data is : { "customer": ...
0 votes
0 answers
296 views
Database not creating tables for new extensions on bin/magento setup:upgrade. Declarative Schema is not up to date
I installed Magento 2.3 successfully, with custom style sheet and Mageplaza Blog ext which all works fine. I wanted to install a slider module and I have done this through ssh. Composer installs the ...
0 votes
1 answer
34 views
Why do the Magento 1 setup scripts still have to be prefixed with 'mysql4'?
MySQL4 is largely obsolete now, even Magento 1 latest versions send a warning if you use Mysql4 prefixed classes. I searched if the setup file names also had this deprecation but couldn't find a thing....
1 vote
1 answer
83 views
Magento 2 - Customer Attribute not being saved
Below is code for creating customer attribute. namespace Namespace\Modulename\Setup; use Magento\Customer\Model\Customer; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\...
4 votes
2 answers
12k views
Error: DDL statements are not allowed in transactions while running setup:upgrade. Running Data Patch
Magento 2.3.1 After making the data patch @ following location vendor/ModuleName/Setup/Patch/Data/AddMyColumnPatch.php code given below for AddMyColumnPatch.php. When I run bin/magento setup:...
1 vote
3 answers
166 views
Update module to run alter command
I have created a module Vendor/Module I have added sql setup script in it. The module is working fine. Now I need to alter table and add come more columns in the table. To do this I need to add new ...
2 votes
2 answers
391 views
Magento 2.3 What are the profits of using db_schema.xml instead of using setup script?
Magento 2.3 used db_schema.xml instead of setup script. What are the benefits of using db_schema.xml over setup script?
2 votes
1 answer
2k views
Insert multiple records to multiple custom tables through install script in magento2
I have created multiple table schema using setup script like below. Setup/InstallSchema.php namespace Vendor\Module\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\...
2 votes
1 answer
1k views
How to save input value to database magento2
I am absolutely new in magento. I have made new input called 'name' under email input in app/design/frontend/NewVendor/NewTheme/Magento_Newsletter/templates/subscribe.phtml <div class="block ...
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\...
0 votes
0 answers
356 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 ...