0

だから、これは2日間私を夢中にさせてきました.3つのDBテーブルを使用するモジュールを書いており、そのうち2つは完全にインストールされ、これは3番目のものです:

$schema['tags_twistal'] = array(
    'description' => t('Taxonomy for videos (tags)'),
    'fields' => array(
        'vid' => array(
            'description' => t('The video ID'),
            'type' => 'varchar',
            'length' => 255,
            'not null' => TRUE,
        ),
        'tag' => array(
            'description' => t('The tag name'),
            'type' => 'varchar',
            'length' => 255,
            'not null' => TRUE,
        ),
    ),
    'primary key' => array('tag','vid'),
);

私が考えることができるのは、設定した主キーと関係があるということだけです。私も試しました:

'unique keys' => array(
    'tag_vid' => array('tag', 'vid'),
),
'primary key' => array('tag_vid'),

何か案は?髪を引っ張るつもりです!

4

1 に答える 1

0

I'm having a similar issue in Drupal 7.

The tables of mine that install correctly are those which have a matching entry in the array returned by hook_node_info().

It looks as though Drupal will not create any tables that are not referenced in hook_node_info(), even if they are explicitly enumerated in hook_scheme(). I can't find this documented anywhere, but it matches my experience, and is a pain in the butt.

于 2012-10-08T04:28:50.497 に答える