我有这个实体:
$schema['apiuser'] = array(
'description' => 'The base table for api_user.',
'fields' => array(
'apiuser_id' => array(
'description' => 'The primary identifier for an artwork.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'public_key' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "Foreign key: {file_managed}.fid of user's picture.",
)
),
'unique keys' => array(
'id' => array('apiuser_id')
),
'primary key' => array('apiuser_id'),
);
后来我添加了一个新字段:
,
$schema['apiuser'] = array(
'description' => 'The base table for api_user.',
'fields' => array(
'apiuser_id' => array(
'description' => 'The primary identifier for an artwork.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'public_key' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "Foreign key: {file_managed}.fid of user's picture.",
),
'user_id' => array(
'description' => 'The primary identifier for an artwork.',
'type' => 'int',
'not null' => TRUE,
)
),
'unique keys' => array(
'id' => array('apiuser_id')
),
'primary key' => array('apiuser_id'),
);
Drupal 不会将相应的表更改为 mysql,因此我手动对其进行了修改。但是现在当我尝试保存未填充新字段的实体时。我已经安装了开发模块并使用“drush cc all”清除缓存,停用并激活了模块,但仍然无法正常工作