Drupal如何更新模块数据库



我有一个模块和他的.install,在这个模块中我放了我的更新:

function ga_crm_update_7135() {
$table = 'ga_historique_commande';
$schema = drupal_get_schema_unprocessed('ga_historique_commande', $table);
db_add_field($table, 'historique_filemaker', $schema['fields']['historique_filemaker']);
}

但是数据库在重新加载和刷新缓存后不会改变,有什么办法可以重新启动.install吗?

DB更新是通过YOURSITE/update.php触发的,而不是通过刷新缓存或重新加载。

在那里,你会看到DB上列出的所有待更新,如果你没有看到你的更新,请查看文档:

https://www.drupal.org/docs/7/api/schema-api/updating-tables-hook_update_n-functions

最新更新