core.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. /**
  3. *
  4. * Some notes...
  5. *
  6. * Drupal docs don't list a bool type, but it might be nice to use rather than 'tinyint'
  7. * Note however that we use bitfields and things as well in tinyints, and PG's
  8. * "bool" type isn't 100% compatible with 0/1 checks. Just keeping tinyints. :)
  9. *
  10. * decimal <-> numeric
  11. *
  12. * MySQL 'timestamp' columns were formerly used for 'modified' files for their
  13. * auto-updating properties. This didn't play well with changes to cache usage
  14. * in 0.9.x, as we don't know the timestamp value at INSERT time and never
  15. * have a chance to load it up again before caching. For now I'm leaving them
  16. * in, but we may want to clean them up later.
  17. *
  18. * Current code should be setting 'created' and 'modified' fields explicitly;
  19. * this also avoids mismatches between server and client timezone settings.
  20. *
  21. *
  22. * fulltext indexes?
  23. * got one or two things wanting a custom charset setting on a field?
  24. *
  25. * foreign keys are kinda funky...
  26. * those specified in inline syntax (as all in the original .sql) are NEVER ENFORCED on mysql
  27. * those made with an explicit 'foreign key' WITHIN INNODB and IF there's a proper index, do get enforced
  28. * double-check what we've been doing on postgres?
  29. */
  30. $classes = array('Schema_version',
  31. 'Profile',
  32. 'Avatar',
  33. 'Sms_carrier',
  34. 'User',
  35. 'Subscription',
  36. 'Group_join_queue',
  37. 'Subscription_queue',
  38. 'Oauth_token_association',
  39. 'Notice',
  40. 'Notice_source',
  41. 'Reply',
  42. 'Consumer',
  43. 'Token',
  44. 'Nonce',
  45. 'Oauth_application',
  46. 'Oauth_application_user',
  47. 'Confirm_address',
  48. 'Remember_me',
  49. 'Queue_item',
  50. 'Notice_tag',
  51. 'Foreign_service',
  52. 'Foreign_user',
  53. 'Foreign_link',
  54. 'Foreign_subscription',
  55. 'Invitation',
  56. 'Profile_prefs',
  57. 'Profile_tag',
  58. 'Profile_list',
  59. 'Profile_tag_subscription',
  60. 'Profile_block',
  61. 'User_group',
  62. 'Related_group',
  63. 'Group_inbox',
  64. 'Group_member',
  65. 'File',
  66. 'File_redirection',
  67. 'File_thumbnail',
  68. 'File_to_post',
  69. 'Group_block',
  70. 'Group_alias',
  71. 'Session',
  72. 'Deleted_notice',
  73. 'Config',
  74. 'Profile_role',
  75. 'Location_namespace',
  76. 'Login_token',
  77. 'User_location_prefs',
  78. 'User_im_prefs',
  79. 'Conversation',
  80. 'Local_group',
  81. 'User_urlshortener_prefs',
  82. 'Old_school_prefs',
  83. 'User_username',
  84. 'Attention',
  85. );
  86. foreach ($classes as $cls) {
  87. $schema[strtolower($cls)] = call_user_func(array($cls, 'schemaDef'));
  88. }