Thanks, guys; I've successfully solved that using hook_update_N now.<br><br>Best regards,<br><br>Tomáš (Vacilando)<br><br>
<br><br><div class="gmail_quote">On Fri, Jan 9, 2009 at 10:22, andrew morton <span dir="ltr"><<a href="mailto:drewish@katherinehouse.com">drewish@katherinehouse.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Fri, Jan 9, 2009 at 12:51 AM, Tomáš Fülöpp <<a href="mailto:tjfulopp@gmail.com">tjfulopp@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> Probably a simple problem but I don't find solution on d.o.<br>
><br>
> I have a D6 contrib module that did not use database before, but now it<br>
> does. The problem is that even though a .install file has been added, the<br>
> database is not created in case the older version of the module is enabled<br>
> already, not even after running /update.php.<br>
><br>
> <a href="http://drupal.org/node/323314" target="_blank">http://drupal.org/node/323314</a> explains that ".install file is run the first<br>
> time a module is enabled" -- but how to make sure the initial database is<br>
> installed on an existing module? Is the only solution to solve it via<br>
> hook_update_N, detecting whether the table exists, and installing it -- even<br>
> though in fact we are installing, not updating?<br>
<br>
</div></div>If you're addin a database to an existing module then you need to<br>
define it in hook_install() for new sites and also in hook_update_N()<br>
for sites that have already installed. If you think that they might<br>
have the table installed for some reason then by all means call<br>
db_table_exists() and check first. Also be aware that implementations<br>
of hook_update_N() should *not* call hook_schema(). You need to have a<br>
copy of the schema in the update function.<br>
<font color="#888888"><br>
andrew<br>
</font></blockquote></div><br>