1
我有這樣的實體:Drupal的,修改enity
$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,所以我手動修改它。但是現在當我嘗試保存新字段未填充的實體時。我已經安裝了devel模塊,並使用'drush cc all'清除緩存,取消激活並激活了模式但仍不起作用