drupal - 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 ?
解决方案
数据库更新是通过 YOURSITE/update.php 触发的,而不是通过刷新缓存或重新加载。
在那里,您将看到 DB 上列出的所有待处理更新,如果您没有看到您的更新,请查看文档:
https://www.drupal.org/docs/7/api/schema-api/updating-tables-hook_update_n-functions
推荐阅读
- c# - 我怎样才能解决在空中跳跃的问题?
- html - 如何使用 CSS 不断淡入淡出 HTML 按钮?
- javascript - 通过复选框选择更改 svg 元素背景颜色
- c - 这是我大学 c 课上的一个练习,我似乎无法解决它,有人帮帮我
- python - 无法加载原生 TensorFlow 运行时。?
- r - 如何将一个图的边添加到 R 中的另一个图(两个图的顶点相同)?
- postgresql - 如何在 Entity Framework 6 和 PostgreSQL 而不是 EF CORE 中使用自动增量 ID?
- ios - Xcode CoreData:尝试从获取请求中加载空数组时出错
- ios - 当 UIScrollView 滚动第一响应者以查看时,如何修复 iOS 14 中的错误行为?
- sql - 错误:“FROM”附近:语法错误 - SQL 代码