Magento Forum

   
Magento Category Flat Tables Error
 
Zertalx
Jr. Member
 
Total Posts:  22
Joined:  2012-02-23
 

HI I have added to the category entity a lot of custom attributes, now when I try to reindex I get the error

SQLSTATE[42000]Syntax error or access violation1118 Row size too largeThe maximum row size for the used table typenot counting BLOBsis 65535. You have to change some columns to TEXT or BLOBs

I Know that means that the flat tables are too large and indeed there are a lot of columns there. I don’t need my custom attributes in that table so I can remove them, but how can i do that? I found that if I set the filterable and comparable to false they shouldn’t be in the flat table.

public function getDefaultEntities()
    
{
        
return array(
            
'catalog_category' => array(
                
'entity_model'      => 'catalog/category',
                
'attribute_model'   => 'catalog/resource_eav_attribute',
                
'additional_attribute_table' => 'catalog/eav_attribute',
                
'entity_attribute_collection' => 'catalog/category_attribute_collection',
                
'table'             => 'catalog/category',
                
'attributes'        => array(
                    
'cat_type' => array(
                        
'group'             => 'General',
                        
'label'             => 'Category Type',
                        
'type'              => 'int',
                        
'input'             => 'select',
                        
'default'           => '0',
                        
'class'             => '',
                        
'backend'           => '',
                        
'frontend'          => '',
                        
'source'            => 'eav/entity_attribute_source_cattype',
                        
'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
                        
'visible'           => true,
                        
'required'          => false,
                        
'user_defined'      => false,
                        
'searchable'        => false,
                        
'filterable'        => false,
                        
'comparable'        => false,
                        
'visible_on_front'  => false,
                        
'visible_in_advanced_search' => false,
                        
'unique'            => false
                    
),

I have deleted the attributes and it works then I ran the install script again, all of them have the filterable and comparable set to false as the example I posted below, It shows me the error again, What I’m missing?

Any help will be appreciated

 
Magento Community Magento Community
Magento Community
Magento Community
 
Zertalx
Jr. Member
 
Total Posts:  22
Joined:  2012-02-23
 

I checked the flat category table and I see that all the attributes are added them.
So the filterable and comparable just works for product attributes? I thought that they will be the same values for category products.
Is there anyway to exclude my attributes from that table?
I can exclude them modifying the file that create the table, obviously in my local folder but I want to know which is the clean way to do this?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top