I'm writing a module that will enable an editor to determine whether a script is available on a specific node, in order to improve page load times.
I need to create a database table to hold an indicator showing, for each node ID, whether the script is available. My code is this.
function script_show_schema() {
$schema['script_show_enabled'] = array(
'description' => 'Tracks whether Script Show is enabled for a given node',
'fields' => array(
'nid' => array(
'description' => 'The {node}.nid that has Script Show enabled',
'type' => 'int',
} 'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('nid'),
);
return $schema;
}
I've disabled, then uninstalled, then re-enabled my module through the admin UI, (as opposed to using Drush), but I still don't seem to be able to see my database tables.
I know this question has been asked a couple of times before, but usually the solution seems to be the uninstall thing.
Does anyone have any idea on what is going wrong? I wonder if it's a DB permissions thing. But then, I guess Drupal has root access to the DB in order to create its tables in the first place.
Updates:
I am using version 7.23 of the core.
Here's my .info file:
; $Id$
name = Script Show
description = "Allows the user to specify that the Maxymiser script will only execute on specific pages"
package = JD Dev Modules
core = 7.x
files[] = script_show.module
flag
My entire module is here: github.com/jamesdesq/script_show.
serial
type field (just for experiment) and changenid
primary key to that field...info
file contains,.module
file exists or not and so on.. Because, I tried you code and I can see it's creatingscript_show_enabled
table..