I am trying to set up a custom entity, following along alan storms article about it, but with this simple install script, it tells me that Can't create table: extended_categories_text
. When i look in the database, i can actually see the following tables:
extended_categories
extended_categories_datetime
extended_categories_decimal
extended_categories_int
My install script is deadsimple and looks like this:
<?php
$installer = $this;
$installer->addEntityType('csvengine_extendedcategories',Array(
'entity_model' =>'csvengine/extendedcategories',
'attribute_model' =>'',
'table' =>'csvengine/extendedcategories',
'increment_model' =>'eav/entity_increment_numeric',
'increment_per_store' =>'0'
));
$installer->createEntityTables(
$this->getTable('csvengine/extendedcategories')
);
How can i get my install script working? Is this a known magento bug?
After my previous post, I got a little farther in the same tutorial, but I still ran into issues. Finally, I was lead to these two posts which allowed me to complete the tutorial:
http://www.magentocommerce.com/bug-tracking/issue/?issue=12336
http://www.magentocommerce.com/bug-tracking/issue/?issue=12126
The last one points out an error in the version of Magento I was using.
Mage_Eav_Model_Entity_Setup , Line 1341:
->addForeignKey($this->getFkName($eavTableName, 'entity_id', 'eav/entity', 'entity_id'), 'entity_id', $this->getTable('eav/entity'), 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
Should be:
->addForeignKey($this->getFkName($eavTableName, 'entity_id', 'eav/entity', 'entity_id'), 'entity_id', $baseTableName, 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)