Topic: Uninstall Code For Extensions - Uninstall Instructions Dropping Table
I'm adding the following table creation code:
<install>
<![CDATA[
// Adding SQL statement / creating table /installation code
$schema = array(
'FIELDS' => array(
'id' => array(
'datatype' => 'SERIAL',
'allow_null' => false
),
'cat_name' => array(
'datatype' => 'VARCHAR(80)',
'allow_null' => false,
'default' => '\'New Category\''
),
'disp_position' => array(
'datatype' => 'INT(10)',
'allow_null' => false,
'default' => '0'
)
),
'PRIMARY KEY' => array('id')
);
$forum_db->create_table('categories', $schema);
]]>
</install>
How does the uninstall need to look like; I know one has to reverse everything above. But what does that specifically look like in my case. (Or maybe point me to a link or literature on the subject)
<uninstall><![CDATA[
// Uninstallation code
$query = array(
'DELETE' => '?????',
'WHERE' => '????? in (\'New Category\'')',
);
$forum_db->create_table('categories', $schema);
]]></uninstall>
Appreciate any pointers, as always.