2011年2月22日 星期二

Add a field to Module Database

  1. Site administration -> Development -> XMLDB editor
  2. Find your module and click [Load]
  3. Click [Edit]
  4. At the Tables section, click the table you want to add field
  5. Click [New field] and fill in the detail
  6. [View PHP code]
  7. Select action: add field
  8. Select field/key/index: your_new_field_name
  9. Click "View"
  10. Copy the code to mod/your_mod/db/upgrade.php
  11. Change XXXXXXXXXX to new version number (e.g. 2011022301)
  12. Open mod/your_mod/version.php, change $module->version to the new version number
  13. Notification 
  14. Done

2 則留言:

  1. Why in PHPMYADMIN in table mdl_mymodule the new fields are not available?

    回覆刪除
  2. Can You change blogger language to english? Regards :)

    回覆刪除