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
0
votes
1answer
20 views

Magento 2: Create a custom module to see admin viewed order details [on hold]

I want to create a module in Magento 2 where I can display the admin order activities. Like when user login in admin and go to the order history then the logged-in user click on the order that should ...
0
votes
2answers
29 views

Magento 2 - Create a log file in plugin that will print log when data is inserted in database

I have entered data in the database using object Manager in Model file itself. I want to print a log file from the plugin that will print the log of the last data that is inserted in the database.
0
votes
0answers
6 views

Magento 2 - add stored procedure via installer

There are lots of articles about how to add stored procedures / triggers in Magneto 1, but what is the best practice to do this in Magento 2?
0
votes
0answers
13 views

Issue with flat catalog table product collection in Magento 1.9

I am facing an issue regarding magento product collection as I have some additional product attribute and use general way to get product collection like: Mage::getModel('catalog/product')->...
0
votes
0answers
22 views

Magento 2 - Problem inserting Data in the Database using objectManager

I want to insert data in the table directly using object Manager from Model file. I am providing the code snippet but this isn't inserting the data. I want to know the correct syntax to perform the ...
0
votes
0answers
18 views

Mysql query INSERT INTO “search_tmp…” never ends after mass attribute update in Magento 2.3.0 Causes Server overload and site down

MySQL query INSERT INTO “search_tmp…” never ends after mass attribute update in Magento 2.3.0 Causes Server overload and site down my mysql found this query very sluggish and slow, which is as ...
1
vote
1answer
30 views

Magento 2: Order Increment Id not working

In our website, magento order increment id is not working as expected. We are getting difference of 3 between every two orders. Like for example,we have order 000005167 and next order we are getting ...
0
votes
2answers
22 views

product view count table in database magento 2?

I have to write code for getting product count.it is working fine but i want to know where the count record comes? public function getProductCount($id) { $prodData = $this->_prodCollection-&...
1
vote
2answers
35 views

How to output and filter collection using “->where” filter?

I trying to get output from collection using 'where' filter but no result. This is my code: $collection = Mage::getModel('my_work/datanews') ->getCollection() ->...
0
votes
1answer
24 views

can't edit product in magento 2. redirect to 504 connection error

In magneto 2, after editing product its shows please wait loader and redirect to 504 connection timeout error.
0
votes
2answers
37 views

SQL error when run command line upgrade Magento 2

When I run the following commmand: php bin/magento s:up; It throws the following error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'admin_magen34.mg7a_sm_products_filter' doesn't ...
0
votes
1answer
22 views

all product page showing 404 and i could not access admin pages magento 2

I have copied my Magento 2 backup to my new server now I am getting all product page showing 404 and I could not access admin pages magento 2 exception.log main.CRITICAL: Unique constraint ...
1
vote
1answer
31 views

InstallSchema.php fails to execute

I've read various posts here but none of them have been helpful. Steps I have taken: Remove My_Module from setup_module in DB Add Setup/InstallSchema.php Clear generated/* directory Clear cache ...
0
votes
1answer
30 views

Error reindex catalog_product_attribute magento 2

After running reindex catalog_product_attribute, I get an error - (General error: 1114 The table 'catalog_product_index_eav_temp' is full, query was: INSERT IGNORE INTO catalog_product_index_eav_temp ...
0
votes
2answers
188 views

In magento 2, how to edit the uploaded image field

In magento 2, how to edit the uploaded image field I follow this blog https://blog.qaisarsatti.com/magento_2/magento-2-ui-component-image-upload/ ui-component <field name="promo_image"> ...
1
vote
1answer
18 views

How can I fetch value from serialize product_options faster

I am using following query to load data SELECT `main_table`.*, `sales_order_item`.`product_options` FROM `magento_giftcardaccount` AS `main_table` LEFT JOIN `sales_order_item` ON sales_order_item....
0
votes
0answers
17 views

Magento 2: tmp_catalog_category_entity__sales_order_1 doesn't exist

While running php bin/magento s:up We get the following error: SQLSTATE[42S02]: Base table or view not found: 1146 Table '[DATABASENAME].[PREFIX]tmp_catalog_category_entity__sales_order_1' doesn't ...
1
vote
1answer
24 views

Magento 2 Can't Convert Data Convert From quote_item to order_item Table Using Field-set

Can Anyone Please Help me to data convert quote_item to order_item Table Using Field-set. First I am Create file etc/extension_attributes.xml and use code <?xml version="1.0"?> <config ...
0
votes
0answers
28 views

Magento 2 - Data Migration needs to ignore a custom table

Need to ignore a table from data migration, the table name is "store" where its a default table in Magento 2. Even updated the map.xml to ignore the store table by below code under document_rules ...
1
vote
1answer
35 views

How can I update all products names via sql query in magento2?

Hi I have a list of sku's of all products at my store , I want to update all the names of products I have on store via sql query with respect to it's sku . There is a table name : ...
0
votes
1answer
23 views

Magento 2 Product collection AddAttributeToFilter with AND/OR and !findinset and is null

How can i add " AND (at_product_userclass.value IS NULL) OR !FIND_IN_SET('1', at_product_userclass.value)" filter condition using addAttributeToFilter in product collection. Thanks
0
votes
0answers
11 views

Add configurable product page pricing to all 'non-visible' associated products?

I want to 'add' the configurable prices that are calculated on product pages to the 'non-visible' associated products of all configurables. I am having to do this for a data migration project. What is ...
0
votes
0answers
16 views

Cannot get autoincrement value, Magento 2

I getting this error inside /var/log/system.log on instalation succesfully finished, but with error. My admin site not function, sample data either: [2019-08-05 16:41:20] main.ERROR: Error: ...
0
votes
2answers
38 views

Magento 2 upgrade 2.1.7 to 2.3.2 give error Foreign key constraint is incorrectly formed modify column customer_group_id in table of customer_group

Can anyone please explain about this type of error Like http://prntscr.com/oow1oz Also, I refer to this link Magento 2 failed database rollback cannot add foreign key constraints but not working for ...
0
votes
1answer
14 views

Could someone please help with some questions related to using Magento 1 database backup functionality?

I want to get a Magento 1 backup using Magento's backup functionality. (Reference:https://docs.magento.com/m1/ee/user_guide/system-operations/server-backup-create.html) I'm are running Magento ver. ...
0
votes
0answers
51 views

Magento 2 data migration errors how to solve

We have installed migration tool in the Magento 2.3.1 EE (composer require magento/data-migration-tool:2.3.1 ) would like migrate M1 commerce edition (1.14.3.1) to Magento 2.3.1 EE. When we execute ...
0
votes
0answers
22 views

What to do in order to allow hyperinflationary currencies? (How to increase decimals limit)

We have to allow in our multi-currency site currency that's very hyperinflationary. Base price for products are set in USD but We have some products shown in VEF that are very close to Magento 2 ...
1
vote
1answer
41 views

Explanation about getSelect() join() joinLeft()

I don't understand these functions of Magento 1: getSelect() join() joinLeft() Where can I find a complete doc with all functions documentation ? Thanks..
0
votes
0answers
21 views

Automatic price change on daily basis in magento 2

We have a client site who is having gold jewellery magento shop. In that the jewellery prices are daily changing,so he have to update each jewellery items price often. (The logic we have here is 1 ...
0
votes
0answers
17 views

Key search displays sql in magento 1

I know that there is an extension showing this text. Can someone show me 1 keyword to search for? I tried searching toString();, but all code comment.
0
votes
1answer
24 views

Our system detected a lock condition in our database

We are getting an issue with the database. Below is the message we are getting from the server. Our system detected a lock condition in your database. Multiple queries were running too long. The ...
0
votes
0answers
19 views

MySQL error 1153 flooding exception.log with always the same entity_id

I am struggling with a strange error in my Magento exception.log at this time. Every few minutes, Magento logs the following weird message: [2019-07-29 08:17:24] main.CRITICAL: SQLSTATE[08S01]: ...
0
votes
1answer
24 views

Magento 2.3.1 Merge products from one database to another?

I have a staging and a production server for my Magento 2.3.1 project. The two databases have different data and configurations, so I can not just dump the mysql db and restore it. Is there a way to ...
0
votes
0answers
16 views

Categories not showing in Admin Product Edit Page in magento 2

I deleted all the products and categories via SQL queries (i used this answer https://magento.stackexchange.com/a/283404/73525 ) after i have recreated all i have categories in the ...
0
votes
1answer
34 views

How to create simple product using direct SQL queries?

I know direct SQL query is not good practice, but I need to insert product using direct SQL query.Also they do not want to use REST API for that.Anyone has SQL queries to create a simple product with ...
0
votes
1answer
37 views

Magento 2.3.1 Search Bar Error - Unknown column 'search_result.score'

Relatively new to Magento. Helped a friend migrate a site from M1 to M2. Using Porto Theme. Search Bar seems to work (does auto querying as you type and makes suggestions) until you hit 'Enter' at ...
0
votes
1answer
38 views

Magento 2 How to add all country regions in database?

I checked directory_country_region in the database there is no region of the United Kingdom, I need all region of United Kingdom. Is Magento provide the sheet of all country regions or from where I ...
0
votes
0answers
21 views

Magento 2 custom module select query doesn't work

I have the following query: SELECT `main_table`.*, `secondTable`.* FROM `table_one` AS `main_table` LEFT JOIN `table_two` AS `secondTable` ON main_table.blog_id = secondTable.blog_id WHERE (...
2
votes
2answers
45 views

Magento cloud hosted M2 EE site compromised and got malware attack

Today i noticed in my client's magento 2 cloud hosted enterprise edition site is compromised. In footer hacker added some link along with following url: <script src="http://write-cdn.com/...
0
votes
2answers
43 views

Magento 2: Undefined variable: installer

I'm too new to Magento: i'm getting an error when setup:upgrade, here is my code: app/code/Adamsmage/Checkoutattribute/Setup/InstallData.php <?php namespace Adamsmage\Checkoutattribute\Setup; use ...
2
votes
2answers
43 views

using sql queries is good practice in magento 2

using SQL queries is good practice in Magento 2 over ORM which is best one to while customizing 1)Security 2)Speed ORM vs SQL queries which one giving Security and speed while ...
2
votes
1answer
37 views

Set expiry date and save value in table magento 2?

I want to set expiry date for let say store credit, I have created custom column by installschema in table as: { $table = $setup->getConnection()->addColumn( $setup->...
0
votes
1answer
39 views

Integrity constraint violation: 1062 Duplicate entry '3-2-9' for key 'PRIMARY', query was: ALTER TABLE `catalog_category_product_index_tmp`

Integrity constraint violation: 1062 Duplicate entry '3-2-9' for key 'PRIMARY', query was: ALTER TABLE catalog_category_product_index_tmp ADD CONSTRAINT PRIMARY KEY (category_id,product_id,store_id), ...
0
votes
1answer
32 views

can we have multiple branch with one database on magento2 cloud?

on Magento cloud when we create a new branch we have to have new database and instance but it is not efficient, we should be able to have different branches using same database, is it possible? I know ...
0
votes
0answers
18 views

After upgrade to 2.3 Version order Number is always set to 000000000

After Magento upgrade to 2.3.0 Version I have a problem with the checkout. I get an error Rolled back transaction has not been completed correctly I can see in the database that the increment_id ...
0
votes
0answers
20 views

Can insertMultiple method return all inserted auto-increment ids?

I have to insert rows in two custom tables (which have a many-to-many relation). I want to use batch insert (i.e. insertMultiple method in Magento 2) for the parent and child table both. The issue ...
1
vote
1answer
34 views

Exception Error: Invalid Method on Product Pages in Magento 2

I recently installed the Porto Magento 2 Theme, it works however when a product is clicked on the below error occurs: 1 exception(s): Exception #0 (Magento\Framework\Exception\LocalizedException): ...
0
votes
0answers
18 views

magento2 Mysql count number customers who ordered more then once in a specific date range

I have a Magento 2.2.5 based website and I want to get a list of emails of customers who have made more than 2 orders within a specific date range. I know I can do the below MySQL query to list ...
0
votes
0answers
16 views

php code or mysql query to 'bundle' 2 attributes into 1

I would like to know if it's possible to update a text attribute by appending the content of another text attribute. i.e. For all my products, I would like that the new content of attribute1 becomes ...
0
votes
0answers
10 views

Magento 2 Categories SQL Import statement just placing meta data

I am trying to place meta data on already existing categories. I received the names of categories and the new meta data that is all. I was wondering if there is fast sql statement that will find ...