Questions tagged [setup-script]

Installer/Update script

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

Why my google map is not showing at contact us page? [closed]

My google map is not displaying and due to script problem. How to resolve this? my script code is as follows function initialize() { var pos = new google.maps.LatLng(, ); var ...
4
votes
3answers
12k views

Magento 2 - setup:install & setup:upgrade

I have updated the code in my custom module and run setup:install already. Do I still need to run setup:upgrade?
1
vote
4answers
10k 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', [ //...
1
vote
4answers
4k 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
1
vote
1answer
1k views

Magento2 setup not creating table

I have used setup to create table but script is not creating the table. I have also removed the entry from setup_module table but still, it didn't work. InstallSchema.php <?php namespace Vendor\...
1
vote
1answer
32 views

How to avoid huge setup scripts?

The approach I've seen so far to handle setup scripts is the version_compare: namespace My\Module\Setup; class UpgradeSchema implements \Magento\Framework\Setup\UpgradeSchemaInterface; { public ...
2
votes
3answers
3k views

Magento2 not executing InstallSchema.php or UpgradeSchema.php

I've created a custom module, and I see the row in the setup_module table. When I change my version and run magento setup:upgrade, the version number updates as well. However, the table I defined is ...
0
votes
1answer
1k views

Change Maximum Qty Allowed in Shopping Cart programmaticaly

When I go to System -> Configuration -> Catalog -> Inventory -> Product Stock Options, I can change Maximum Qty Allowed in Shopping Cart. I need to do that in setup script. How to do that via setup ...
7
votes
6answers
3k 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 ...
2
votes
3answers
2k views

Start with clean database

When I want to start over with a clean database in a local/dev environment, is it enough to delete all tables and let the setup/update/data scripts (Mage, custom modules, own modules...) build up ...
1
vote
1answer
1k views

Problem in creating a table via custom module ( UpdateSchema.php )

I am trying to create a new table via my module Ved_Mymodule This module is active and when I change its setup_version in module.xml file then it is reflecting in setup_module table in the database. ...
4
votes
2answers
762 views

Difference between position and sort_order in customer install script

I'm trying to understand how the install works for EAV entities in Magento2. I see that in the installEntities method from the Magento\Customer\Setup\CustomerSetup class, the attributes have 2 fields ...
0
votes
1answer
86 views

Setup resources - Run only manually

Is it possible to prevent new setup resources (e.g. acme/somemodule/sql/install-0.1.0.php) running during the end user page execution flow in Magento 1.7? What I plan to do is copy across the new ...
1
vote
3answers
4k views

Adding attribute - all possible options

I was searching throughout net i have not found complete tutorial. The case is I need complete configuration for newly added attribute (for product) and explantation of use of each one, adding it with ...
0
votes
1answer
1k views

Magento EE 1.14.2.2 Upgrade Script add multiple Columns

Hello I'm struggling to get an upgrade script working. Here is my script: $installer = $this; $installer->startSetup(); // Update table $installer->getConnection() ->addColumn($installer-&...
5
votes
2answers
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 ...
1
vote
1answer
2k views

Magento 2 module “data_version - not upgrading"?

In Magento 2.0 I have written UpgradeData and UpgradeSchema and I have changed the setup_version in module.xml. After that I run php bin/magento setup:upgrade After this in the database, ...
1
vote
2answers
941 views

Rename website, store group, and store in setup script

Is it possible to have a setup script do: Rename the default website Rename the default store group Rename the default store view Add another store view to a store group Add another store group to a ...
0
votes
2answers
2k views

Update backend model of product attribute with setup script

I need to add the backend_model value of an attribute where wasn't specified in the install setup script. The missing line is: 'backend' => 'eav/entity_attribute_backend_datetime' But so far ...
5
votes
1answer
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?
5
votes
2answers
8k 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. ...
8
votes
5answers
7k views

Magento 2: Create customer group programatically

I'd like to know if it's possible (if so, how) to programmatically create a new customer group using the Magento 2 framework. Ideally I'd like to do this in a setup class. Looking at the ...
6
votes
5answers
15k views

Magento 2 module install error “data: current version - none, required version 2.0.0”

I'm getting the following error when I try to install my extension. Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory. The following modules are outdated: ...
13
votes
3answers
22k views

Magento 2 Add “VARCHAR” type field into custom table

Please look at the current core database adapter file(Table.php) located at: magento-2/vendor/magento/framework/DB/Ddl: <?php /** * Copyright © 2015 Magento. All rights reserved. * See COPYING....
10
votes
1answer
21k 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 ...
0
votes
2answers
1k views

Magento 2 InstallSchema : Is my assumption correct?

I'm creating table with reference key of catalog_product_entity, here I'm little bit of confusing while converting Magento 1.0 to Magento 2.0. Can you clarify it. In magento 1.0 simply I can run the ...
28
votes
2answers
44k 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 ...
1
vote
1answer
2k views

Trying to set configuration values with setConfigData() setup script

I'm trying to add values for each store using an configuration setup script but for some reason the script runs but doesn't set any values and I'm running out of ideas why?? Here's my config scrip $...
1
vote
1answer
335 views

Add subscriber status to flat order grid

I'm trying to add subscriber status to sales_flat_order_grid. I already got postcode working, but now I'm kind of stuck. This is what I've tried so far: startSetup(); // Add column to grid table $...
2
votes
2answers
510 views

Data install script not adding data

I'm trying to add an entry to a custom table with a data-install script but it isn't setting the data when I call ->save() method it just add an empty value in the field. I have updated the config....
1
vote
1answer
341 views

Category Attributes, Setup Script and Flat Tables

I have created a setup script that creates new category attributes. It works quite well, however after the setup did run, the flat tables are missing the columns and when the Magento API creates the ...
0
votes
1answer
50 views

How to safely alter Magento category attributes

I understand how to write setup scripts through a custom module. However, if you directly alter something like catalog_category by adding a new attribute, is there a way to then safely remove it in ...
2
votes
1answer
30 views

Table to clean on setup script test

Does anyone know what table or tables to clean when testing setup script? I don't want to add an upgrade script, this is only for testing purposes. Thanks!
0
votes
1answer
459 views

Proper method of adding column to table? [duplicate]

I am extending promo coupon labels so that I can define a failed label that would display when coupons fail to apply. So far I have been able to add the fields using: class ...
3
votes
1answer
903 views

How can I programmatically create a RESTful api role and consumer?

How can I create a RESTful role and consumer during the installation of an extension (module) using a data-install script located at: app/code/community/Namespace/Module/data/namespace_module_setup/...
2
votes
1answer
1k views

Using Multiple Database Resources [closed]

I've been trying to get Magento connecting to two different databases within one module, and I'm running into some trouble. The reason I'm using a second database is to pull in Wordpress content. The ...
0
votes
2answers
2k views

Category saveAttribute only saves on store scope

I'm making a setupscript in Magento 1.7 CE to move some category data from one attribute to another. The script is working, but somehow it only saves on store view scope (just store view id 1), ...
4
votes
2answers
4k views

Unable to save custom order attribute

I've created a custom order attribute in my extension's setup script like this: $setup->addAttribute('order', 'my_custom_attribute', array( 'type' => 'varchar', 'input' => 'text', ...
0
votes
1answer
464 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 ...
6
votes
2answers
8k views

How can I add customer attribute in Magento 2?

Note: The question was referring to magento2-dev-beta and the code for setup scripts is not the same anymore in Magento 2.x. I'm playing with Magento 2 and I'm stuck in adding attribute for customer ...
0
votes
1answer
336 views

Adding a new column to flat table for “file upload” [duplicate]

I have a flat table that I would like to add a column to, and upload an image file in the admin. How would I achieve this via installer/upgrade script? Also as a side note, does it make more sense to ...
1
vote
1answer
850 views

Programmatically create site categories using an install script

Using Magento 1.9.0.1 I am trying to script my entire sites config and settings using install scripts so I can keep the whole site under version control. I am now at the point of creating my ...
1
vote
2answers
644 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 ...
1
vote
1answer
1k views

Mage_Core_Model_Resource_Setup vs Mage_Eav_Model_Entity_Setup?

What;s the difference between these two? Can't find an answers anywhere.
2
votes
1answer
2k views

addColumn() in setup script TYPE_MEDIUMTEXT how? or text size?

in Mage setup sql scripts how do you add a column with text size medium? I'm not sure the 64kb limit of TYPE_TEXT will be long enough. ->addColumn('comments',Varien_Db_Ddl_Table::TYPE_TEXT,null,...
0
votes
1answer
22 views

Using references in setup scripts

Setup scripts are versioned. It is known. As a result, any time you use a reference from an external object or class, you run the risk of the setup script itself changing ex post facto. For example, ...
4
votes
2answers
1k views

How installer script extends `Mage_Core_Model_Resource_Setup`?

Lot of time, I heard that installer script, upgrade script, and data script files are extending Mage_Core_Model_Resource_Setup (default case). When we make a look on any of these file, there is no ...
1
vote
2answers
55 views

Is it possible to set the e-mail logo from update script?

Does anybody know a way to set the e-mail logo (design/email/logo) from a data upgrade script? The config value takes the file path, but where do I have to put the file?
1
vote
1answer
865 views

How to populate one column in a table from another table column [Magento OOP way]

I am new to magento. I have to perform a db task in magento upgrade script which should be done using magento OOP db way. But i cannot figure it out how to do it. I can do it in plain sql query but ...
1
vote
1answer
2k views

cannot add new field to sales flat table in magento CE 1.9.0.1

I wrote module which will create a new varchar field in sales_flat_order. For this we create seutp set but it not working ,where the issue: app/code/local/Bh/Affiliate/etc/config.xml <?xml ...