Db.xml doesn't work in block installation

Permalink
Hello everybody.

I don't understand a thing... when i install a block that i've customized, the db.xml doesn't work but the block installs itself.

This my db.xml :
<?xml version="1.0"?>
<schema version="0.3">
   <table name="btSurveyCustom">
      <field name="bID" type="I">
         <key />
         <unsigned />
      </field>
      <field name="requiresRegistration" type="I1">
         <default value="0"/>
      </field>
   </table>
   <table name="btSurveyCustomQuestionTypes">
      <field name="typeID" type="I1">
         <key/>
         <unsigned/>


I took a base for build the db.xml, the base is db.xml of the basic block "Survey" in C5. So why doesn't it ?

Do you have an idea ?

Taramis
 
bbeng89 replied on at Permalink Reply
bbeng89
Hm, what directory do you have your db.xml file in? Is it just in the root of your block directory?
JohntheFish replied on at Permalink Reply
JohntheFish
Another common reason is the table name not matching that specified in the block controller and conforming to the naming conventions for the block class. unless all 3 tie together .... :-(
Taramis replied on at Permalink Reply
Taramis
Yes in the block directory ;) I've found a solution. The problem came from my controller, i've forgot to define the protected variable of table name ($btTable) (as Johnthefish explains)