0

Can any body tell me where is category attribute stored in magento database ? And how could I remove it from MySQL?

asked Dec 17, 2014 at 12:20

3 Answers 3

4

All category attributes (and products and customer and customer address) are kept in the table eav_attribute.
You can identify it by this query:

SELECT * FROM `eav_attribute` WHERE `attribute_code` = 'Your code here';

If you get only one record as a result then you are save. That's it.
If you get 2 or more it means that the attribute with that code exists for more entities (for example url_key will show 2 results).

In this case the difference is made by entity_type_id field.
That's the one that determines the entity (category, product, ...)

To get the entity_type_id for the category, run this query:

SELECT * FROM `eav_entity_type` where `entity_type_code` = 'catalog_category';

To merge the 2 queries above and always get the result you need you can use this:

SELECT 
 * 
FROM 
 `eav_entity`
WHERE
 `attribute_code` = 'YOUR CODE HERE' AND
 `entity_type_id` = (SELECT
 `entity_type_id`
 FROM
 `eav_entity_type`
 WHERE
 `entity_type_code` = 'catalog_category'
 )
answered Dec 17, 2014 at 12:28
0
4

Simply Run this Query:- For Disable the category from Database

First Method

For setting is_active = Yes

UPDATE `catalog_category_entity_int` SET `value` = '1' WHERE `catalog_category_entity_int`.`entity_id` =5 AND `catalog_category_entity_int`.`attribute_id` = 62;

For setting is_active = No

UPDATE `catalog_category_entity_int` SET `value` = '0' WHERE `catalog_category_entity_int`.`entity_id` =5 AND `catalog_category_entity_int`.`attribute_id` = 62;

NOTE:- Here 62 is an 'attribute_id' of is_active attribute (that you can find in 'eav_attribute table'), so we are using catalog_category_entity_int.attribute_id = 62 in this sql query.

Second Method

First of all Find attribute_id in eav_attribute table thats associated with is_active and then look for the attribute_id value in catalog_category_entity_int there you'll find a value (Column in Table) boolean, set value = 1 for Active and set value =0 for Deactive.

enter image description here

answered Dec 27, 2016 at 6:23
0
 DELETE FROM eav_attribute where attribute_code='ryman_tuner_radio'
 DELETE FROM eav_attribute_group where attribute_group_name='Company'; 
 # DELETE FROM `core_resource` where `code` = 'customcatattrcompany_setup'; 

The following will remove the Attribute from php.

 $setup->removeAttribute('catalog_category','custom_company_department');
answered Dec 17, 2014 at 12:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.