The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [database]

Questions related to Magento's MySQL database, for example, the table schema, plain SQL queries or database configuration. For questions about the Magento database access layer, use other tags, like: eav, model, resource-model, collections, install-script. For questions about SQL queries in particular, the SQL tag is appropriate too.

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

Find duplicates in many columns query builder [closed]

I have this code to find duplicates, but i compare All columns in same row, also it returns only one row $groupBy = explode(',',$request['fields']); $duplicates = DB::table($module) ->...
1
vote
1answer
147 views

Magento 2.3 introduced a view table which causes issue with import of mysql dump. What's it for?

If you mysql dump a magento 2.3 store and try to import it elsewhere you get an issue due the the format of the view import query. The problem part is this: CREATE ALGORITHM=UNDEFINED DEFINER=`...
0
votes
0answers
77 views

Magento 2.3: SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s)

I'm very new to magento 2.3, I'm facing some error maybe from DB side.... Here is my code: /app/code/EC/Customimport/Controller/Adminhtml/Index/Import.php <?php namespace EC\Customimport\...
1
vote
1answer
52 views

Upgrade 2.2.6 - 2.3.1 -> Table staging.queu doe not exist

I have followed all procedures to update correctly. After composer is updated and we run 'php bin/magento setup:upgrade' we get a strange error. Please see image attached. Error is Base Table or view ...
1
vote
1answer
33 views

How get products name magento 2 sql database

I am trying to get products name(value) and when i see my db table catalog_product_entity_varchar but in which in the column of value all base images are given so please tell accurate table or any ...
0
votes
1answer
67 views

Magento 2 Custom API: Need to create an API which gets the data from a table in database

I have a magento store for which I was using the Magestore Bannerslider module to show a simple carousel on the homepage. But now I am experimenting with a headless approach, and there's no API to ...
0
votes
1answer
22 views

Change Product Custom Attribute Id in Magento

I have mistakenly deleted custom product attribute. Now This attribute has been used on many places with attribute id value. I tried to create new attribute with same name but it is having auto ...
2
votes
0answers
18 views

What is the scope of source model extend and implement?

What is the scope of source model extend and implement between these two? \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource \Magento\Framework\Data\OptionSourceInterface Attribute options ...
0
votes
0answers
12 views

Edit quote qty but price incorrect for mutiple products

I would like to update quote from a order. When I update qty of a item from quotes it make correct subtotal and tax. However, when I update great than 2 items then subtotal and tax get last data ...
1
vote
3answers
89 views

Websites vs Categories

I'm currently managing a fairly large and complex Magento2 site. Admittedly, I'm more of a front-end guy. As such, I had a question. We have 82 stores (one for each corporate customer). Each store ...
0
votes
0answers
18 views

Magento2 Customer Session Issues

I am getting below error message in exception.log SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: UPDATE `customer_visitor` SET `customer_id` = ...
0
votes
1answer
93 views

Magento 2 - Add foreign key with Existing table using db_schema.xml

I try to add 2 foreign key to my table using db_schema.xml <table name="test_table" engine="innodb" resource="default" > <column xsi:type="smallint" name="entity_id" identity="true" ...
1
vote
2answers
63 views

How to save advance inventory custom field value in db in Magento 2

How to save advance inventory custom field value in DB on Magento 2 events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0
votes
0answers
24 views

How to search/filter for ONLY empty fields in the admin panel?

I'm looking for orders that specifically did not use a coupon code, and therefore have no visible value in the "coupon" field. Which value do I search for? I tried "NULL", ""(as in, two quotation ...
0
votes
0answers
30 views

Magento 1.9.2.2 - CCSaved - Button to delete credit card information

I'm running Magento 1.9.2.2 and collect Credit Cards offline. Needless to say, I do not want to keep the credit card information indefinitely on the database. After the order ships, I would like to ...
1
vote
0answers
27 views

Magento 2 Enterprise Edition - Need to run app:config:import every time in centralized database

I am working in centralized database in Magento 2 Enterprise Edition, Every time someone changes anything (even from admin configuration) I need to run app:config:import everytime if anythings ...
1
vote
1answer
163 views

Need help with ui component and change sorting order of columns in magento 2

Have listing but need to change view of one column: <column name="status"> <settings> <filter>text</filter> <label translate="true">...
1
vote
2answers
49 views

How to write Nested Query in Grid Collection _initSelect method

I want to Apply this Query using $this->getSelect() method SELECT * FROM (SELECT * FROM customer_grid_flat ORDER BY enroller_id, entity_id) customer_grid_flat, (SELECT @pv := '$id') ...
0
votes
2answers
18 views

when the searched product does not exist in database then how to show that searched product?

In the search engine i have searched one product.that product not in the database but product is moving to add to cart page and store in the database and it will show the message not in stock but in ...
0
votes
1answer
97 views

Magento 2.3.1 Base table or view not found

Magento 2.3.1 keep filling logs with these errors: system.log [2019-05-04 23:30:12] report.INFO: SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`...
0
votes
0answers
13 views

How to apply Foreign key to customer EAV in magento 2?

I have inserted the eav attribute using InstallData.php for customers like this, it's working fine but now i need to connect this attribute to school table in the database using foreign key. Can i ...
0
votes
1answer
15 views

EntityManager is trying to insert an existing row instead of updating the row

I have an extension property on Magento's Invoice class, and I'm trying to make an API method that sets the value of my extension attribute for a specific invoice. I'm using my class as an extension ...
2
votes
1answer
39 views

Unable to access the PUT API service of Magento 2 through Python

I'm trying to update a particular product in Magento through PUT using python. I'm using OAuth1Service for authentication to Magento 2. GET products is actually giving me all the products in Magento ...
1
vote
2answers
316 views

When updating to Magento 2.3.1 db_schema.xml is invalid: Element 'schema': No matching global declaration available for the validation root

While updating Magento 2.2.8 to 2.3.1 I'm facing issue when running bin/magento setup:upgrade I get error: The XML in file "/var/www/html/vendor/magento/module-store/etc/db_schema.xml" is invalid:...
0
votes
0answers
56 views

Category page not working Magento 2 with more than 13 million products

I am stuck in an issue with Magento 2 has more than 13 million products. We have managed to upload 13 million products although is slow and it works like indexing, product page, and search page. My ...
1
vote
0answers
83 views

SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support Magento 2

I am facing below error while run setup upgrade commands. SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support 'multiple triggers with the same action ...
0
votes
0answers
69 views

Magento2: Cardinality violation: 1241 Operand should contain 1 column(s)

When i delete the item from cart then got the SQLError below: SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s), query was: SELECT `catalog_category_entity`.* FROM `...
1
vote
1answer
138 views

Magento 2 : Delete all Catalog Price Rules Programmatically

I know we have Delete Rule option when we edit any Catalog Price Rule. But I need to delete all Calalog Price Rules programmatically because there is no option to delete all rules. Solutions may be : ...
1
vote
1answer
58 views

echo my sql query in magento

here is some minor question but it always bother me while doing the code with magento. $resource = Mage::getSingleton('core/resource'); $write = $resource->getConnection('core_write'); $table = $...
0
votes
1answer
45 views

SQL STATE Error while setup:upgrade in magento 2.3

Getting this error when adding the new module, i don't have this table in database but i am getting this error, anyone can help?
0
votes
0answers
29 views

Magento 2 : Error when importing customers

When trying to import Customers from the backend, Data validation is OK but when I click on import button, the page gets stuck on please wait for loader and I get the error : See the logs below ...
0
votes
0answers
26 views

Magento 2 data not fetching from table for special content

I am developing a custom module where I create a column in database and saving the below content data <?xml version="1.0"?> <rss version="2.0" xmlns:g="http://base.google.com/ns/1.0"> ...
1
vote
1answer
23 views

Multiple Database Records with Same Primary Key

I need to store relationships where a single attribute_id may be visible in multiple store_id and I was trying to use attribute_id as the primary key. It would be something like this: +--------------+...
0
votes
0answers
20 views

Add Customer Attributes through Admin Form

I'm trying to build a extension where I can dynamically add new Customer Attributes just like I would do with Product Attributes. The thing is that I'm new to Admin Grid and I'm not finding the a few ...
0
votes
2answers
195 views

how to update data in database table

I am sending data to the database by checking duplicate data. But I can't be inserting/updating data in the database. protected function saveEntityFinish(array $entityData, $table) { $...
0
votes
0answers
37 views

What is best way to move database from Magento 2 to Magento 1

I wanna move product category order from Magento 2 to Magento 1. what is the best way for this? I create export from product and import to Magento 1 by default tools on manage but I get some error ...
1
vote
0answers
40 views

Insert order data from csv programatically in Magento 2.2

I have 2 different CSV files 1st has orders and 2nd have order details. I am trying to insert data into magento2 DB using Magento Models. so that my data will insert into all different tables and will ...
1
vote
1answer
28 views

Magento 1.9 MIME ENABLE

My Website is not show product slider missing due to MIME enable please help me how to fix this issue please check attachment screenshot images www.hafeezpk.com
2
votes
2answers
365 views

Save Button Redirecting to Same Admin Form in Magento 2

I am working on a custom module in magneto 2. i am creating an admin form using UI Component, when i click on save button Page redirects to its self Vendor\Module\Block\Adminhtml\ProductSliders\...
0
votes
2answers
195 views

magento product flat tables row size too large

When I re-index data in magento 1.x with large attribute set about 200 attributes. The got me followin MySQL error. Product Flat Data index process unknown error: exception 'PDOException' with ...
0
votes
0answers
10 views

Bundle label display

How do I display a label overlay for thumbnails, on bundle products? Is this difficult or should I find a extension. Thanks for help. Best regards Martin
1
vote
0answers
20 views

how to use walk method to join two tables in magento 2

friends, how to use the walk() method to join two tables in Magento 2 I have 2 tables and I want to join them based on some conditioning. my present code looks like this $result = array(); $...
6
votes
2answers
226 views

Empty Collection :: CollectionFactory Approach and getCollection approach both give empty result

Magento 2.3.1 Php7.2 Ubuntu 18.04 I have created a table in my database using db_schema.xml and then populated that table with sql insert commands directly in mysql workbench. My model code is &...
0
votes
1answer
133 views

add new column to catalog product entity table

I add new column to catalog_product_entity. so when i want to add new filter to collection i get this error The "user_id" attribute name is invalid. Reset the name and try again. $subject->...
0
votes
0answers
28 views

Crud module for parent and children table

i'm created crud plugin for children and parent table. Can anyone suggest how to get the data from parent table.PLease Help me. Many thanks here are may table <?php namespace ThuyNT\Crud\...
1
vote
1answer
25 views

how can we access customer session in checkout

I have one special field called some_id in customer data and I want to save the some_id and quote_id in database. I am using sales_quote_save_afterevent to save both ids. But my customer session is ...
0
votes
0answers
21 views

Return PHP values inside JS file

I have an module that I need to load some informations when the user clicks at the sync button (backend). The problem is, how to retrieve the values from the js file and put them in the form. view/...
2
votes
1answer
195 views

How to fix the related product issue in admin after migrated to magento 1 to magento 2.3

I am using Magento 2.3.0 I have migrated products from Magento 1 to Magento 2. I can see related products in product detail page in the front end and it is proper and also I can find related products ...
1
vote
1answer
85 views

How do I query on an extension attribute through the API?

I added an extension attribute to the Invoice class, and I want to be able to query the Invoice database data by my extension attribute. My extension attribute (ExportedFlag) has these properties ...
0
votes
0answers
159 views

before plugin parameter magento 2

I am writing a before plugin for below public method. public function setup($user,$pass,$url = null){ $this->username = $user; $this->password = $pass; if ($url) { ...