Таблица в БД не добавляется

Главные вкладки

Аватар пользователя ciberlex404 ciberlex404 18 декабря 2010 в 0:37

Пишу модуль с использованием БД

написал .install

включаю модуль, а таблицы в бд не появляется

Что делать? где грабли??

<?php

function ecomanor_install() {
  
drupal_install_schema('ecomanor');
}

function 

ecomanor_uninstall() {
  
// Remove tables.
  
drupal_uninstall_schema('ecomanor');
}

function 

ecomanor_schema() {
  
$schema['ecomanor'] = array(
    
'description' => 'The base table for ecomanors.',
    
'fields' => array(
      
'nid' => array(
        
'description' => 'The primary identifier for a ecomanor.',
        
'type' => 'serial',
        
'unsigned' => TRUE,
        
'not null' => TRUE),
      
'vid' => array(
        
'description' => 'The current {ecomanor_revisions}.vid version identifier.',
        
'type' => 'int',
        
'unsigned' => TRUE,
        
'not null' => TRUE,
        
'default' => 0),
      
'type' => array(
        
'description' => 'The {ecomanor_type}.type of this ecomanor.',
        
'type' => 'varchar',
        
'length' => 32,
        
'not null' => TRUE,
        
'default' => ''),
      
'language' => array(
        
'description' => 'The {languages}.language of this ecomanor.',
        
'type' => 'varchar',
        
'length' => 12,
        
'not null' => TRUE,
        
'default' => ''),
      
'title' => array(
        
'description' => 'The title of this ecomanor, always treated as non-markup plain text.',
        
'type' => 'varchar',
        
'length' => 255,
        
'not null' => TRUE,
        
'default' => ''),
      
'uid' => array(
        
'description' => 'The {users}.uid that owns this ecomanor; initially, this is the user that created it.',
        
'type' => 'int',
        
'not null' => TRUE,
        
'default' => 0),
      
'status' => array(
        
'description' => 'Boolean indicating whether the ecomanor is published (visible to non-administrators).',
        
'type' => 'int',
        
'not null' => TRUE,
        
'default' => 1),
      
'created' => array(
        
'description' => 'The Unix timestamp when the ecomanor was created.',
        
'type' => 'int',
        
'not null' => TRUE,
        
'default' => 0),
      
'changed' => array(
        
'description' => 'The Unix timestamp when the ecomanor was most recently saved.',
        
'type' => 'int',
        
'not null' => TRUE,
        
'default' => 0),
      
'comment' => array(
        
'description' => 'Whether comments are allowed on this ecomanor: 0 = no, 1 = read only, 2 = read/write.',
        
'type' => 'int',
        
'not null' => TRUE,
        
'default' => 0),
      
'promote' => array(
        
'description' => 'Boolean indicating whether the ecomanor should be displayed on the front page.',
        
'type' => 'int',
        
'not null' => TRUE,
        
'default' => 0),
      
'moderate' => array(
        
'description' => 'Previously, a boolean indicating whether the ecomanor was "in moderation"; mostly no longer used.',
        
'type' => 'int',
        
'not null' => TRUE,
        
'default' => 0),
      
'sticky' => array(
        
'description' => 'Boolean indicating whether the ecomanor should be displayed at the top of lists in which it appears.',
        
'type' => 'int',
        
'not null' => TRUE,
        
'default' => 0),
      
'tnid' => array(
        
'description' => 'The translation set id for this ecomanor, which equals the ecomanor id of the source post in each set.',
        
'type' => 'int',
        
'unsigned' => TRUE,
        
'not null' => TRUE,
        
'default' => 0),
      
'translate' => array(
        
'description' => 'A boolean indicating whether this translation page needs to be updated.',
        
'type' => 'int',
        
'not null' => TRUE,
        
'default' => 0),
      ),
    
'indexes' => array(
      
'ecomanor_changed'        => array('changed'),
      
'ecomanor_created'        => array('created'),
      
'ecomanor_moderate'       => array('moderate'),
      
'ecomanor_promote_status' => array('promote''status'),
      
'ecomanor_status_type'    => array('status''type''nid'),
      
'ecomanor_title_type'     => array('title', array('type'4)),
      
'ecomanor_type'           => array(array('type'4)),
      
'uid'                 => array('uid'),
      
'tnid'                => array('tnid'),
      
'translate'           => array('translate'),
      ),
    
'unique keys' => array(
      
'vid'     => array('vid')
      ),
    
'primary key' => array('nid'),
    );
      return 
$schema;
}

?>

Комментарии