[development] Foreign keys in Drupal 6

Earnie Boyd earnie at users.sourceforge.net
Wed Jun 13 17:34:34 UTC 2007


Quoting Barry Jaspan <barry at jaspan.org>:

>
> Earnie Boyd <earnie at users.sourceforge.net> writes:
>> +1 Cascade.
>>
>> Better use by all modules for the uninstall API is needed.
>
> I cannot parse this sentence.
>

I'm just saying that the admin/build/modules/uninstall view hasn't had 
anything on it for any of the modules I've used.  If modules used the 
appropriate hook to uninstall its data the user could remove the tables 
at will.

>> I can see the points for not uninstalling when disabled but I am
>> upset that no Uninstall is available for any module enabled that
>> adds tables or columns to existing tables.
>
> We could certainly declare hook_uninstall() to be mandatory for any
> module that declares hook_install(); now that we have
> drupal_uninstall_schema(), hook_uninstall() is usually trivial
> (actually, it always was trivial).
>

This sounds good.

> For that matter, we could provide a default hook_uninstall() that
> drops all the module's tables.  I think the new variable patch also
> identifies variables by module so we could uninstall them
> automatically as well.
>

This sounds better.

> This has nothing really do to with foreign keys, though.
>

No but you had made statements about uninstalling tables.  The API 
exists, it currently isn't used by many.  I was just trying to point 
out what I've observed in regard to the statements you were making.

Earnie


More information about the development mailing list