core.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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_location',
  41. 'Notice_source',
  42. 'Notice_prefs',
  43. 'Reply',
  44. 'Consumer',
  45. 'Token',
  46. 'Nonce',
  47. 'Oauth_application',
  48. 'Oauth_application_user',
  49. 'Confirm_address',
  50. 'Remember_me',
  51. 'Queue_item',
  52. 'Notice_tag',
  53. 'Foreign_service',
  54. 'Foreign_user',
  55. 'Foreign_link',
  56. 'Foreign_subscription',
  57. 'Invitation',
  58. 'Profile_prefs',
  59. 'Profile_tag',
  60. 'Profile_list',
  61. 'Profile_tag_subscription',
  62. 'Profile_block',
  63. 'User_group',
  64. 'Related_group',
  65. 'Group_inbox',
  66. 'Group_member',
  67. 'File',
  68. 'File_redirection',
  69. 'File_thumbnail',
  70. 'File_to_post',
  71. 'Group_block',
  72. 'Group_alias',
  73. 'Session',
  74. 'Config',
  75. 'Profile_role',
  76. 'Location_namespace',
  77. 'Login_token',
  78. 'User_location_prefs',
  79. 'User_im_prefs',
  80. 'Conversation',
  81. 'Local_group',
  82. 'User_urlshortener_prefs',
  83. 'Old_school_prefs',
  84. 'User_username',
  85. 'Attention',
  86. );
  87. foreach ($classes as $cls) {
  88. $schema[strtolower($cls)] = call_user_func(array($cls, 'schemaDef'));
  89. }