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_location',
  41. 'Notice_source',
  42. 'Reply',
  43. 'Consumer',
  44. 'Token',
  45. 'Nonce',
  46. 'Oauth_application',
  47. 'Oauth_application_user',
  48. 'Confirm_address',
  49. 'Remember_me',
  50. 'Queue_item',
  51. 'Notice_tag',
  52. 'Foreign_service',
  53. 'Foreign_user',
  54. 'Foreign_link',
  55. 'Foreign_subscription',
  56. 'Invitation',
  57. 'Profile_prefs',
  58. 'Profile_tag',
  59. 'Profile_list',
  60. 'Profile_tag_subscription',
  61. 'Profile_block',
  62. 'User_group',
  63. 'Related_group',
  64. 'Group_inbox',
  65. 'Group_member',
  66. 'File',
  67. 'File_redirection',
  68. 'File_thumbnail',
  69. 'File_to_post',
  70. 'Group_block',
  71. 'Group_alias',
  72. 'Session',
  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. }