core.php 3.18 KB
Newer Older
1 2
<?php

Brion Vibber's avatar
Brion Vibber committed
3
/**
4 5 6 7 8 9 10 11 12 13 14 15
 *
 * Some notes...
 *
 * Drupal docs don't list a bool type, but it might be nice to use rather than 'tinyint'
 * Note however that we use bitfields and things as well in tinyints, and PG's
 * "bool" type isn't 100% compatible with 0/1 checks. Just keeping tinyints. :)
 *
 * decimal <-> numeric
 *
 * MySQL 'timestamp' columns were formerly used for 'modified' files for their
 * auto-updating properties. This didn't play well with changes to cache usage
 * in 0.9.x, as we don't know the timestamp value at INSERT time and never
16 17
 * have a chance to load it up again before caching. For now I'm leaving them
 * in, but we may want to clean them up later.
18 19 20 21 22 23 24 25 26 27 28 29 30
 *
 * Current code should be setting 'created' and 'modified' fields explicitly;
 * this also avoids mismatches between server and client timezone settings.
 *
 *
 * fulltext indexes?
 * got one or two things wanting a custom charset setting on a field?
 *
 * foreign keys are kinda funky...
 *     those specified in inline syntax (as all in the original .sql) are NEVER ENFORCED on mysql
 *     those made with an explicit 'foreign key' WITHIN INNODB and IF there's a proper index, do get enforced
 *     double-check what we've been doing on postgres?
 */
31

32 33
$classes = array('Schema_version',
                 'Profile',
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
                 'Avatar',
                 'Sms_carrier',
                 'User',
                 'Remote_profile',
                 'Subscription',
                 'Group_join_queue',
                 'Subscription_queue',
                 'Oauth_token_association',
                 'Notice',
                 'Notice_source',
                 'Reply',
                 'Fave',
                 'Consumer',
                 'Token',
                 'Nonce',
                 'Oauth_application',
                 'Oauth_application_user',
                 'Confirm_address',
                 'Remember_me',
                 'Queue_item',
                 'Notice_tag',
                 'Foreign_service',
                 'Foreign_user',
                 'Foreign_link',
                 'Foreign_subscription',
                 'Invitation',
                 'Message',
                 // 'Notice_inbox',
                 'Profile_tag',
                 'Profile_list',
                 'Profile_tag_subscription',
                 'Profile_block',
                 'User_group',
                 'Related_group',
                 'Group_inbox',
69
                 'Group_member',
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
                 'File',
                 'File_oembed',
                 'File_redirection',
                 'File_thumbnail',
                 'File_to_post',
                 'Group_block',
                 'Group_alias',
                 'Session',
                 'Deleted_notice',
                 'Config',
                 'Profile_role',
                 'Location_namespace',
                 'Login_token',
                 'User_location_prefs',
                 'Inbox',
                 'User_im_prefs',
                 'Conversation',
                 'Local_group',
                 'User_urlshortener_prefs',
89
                 'Old_school_prefs',
90 91 92 93 94
);

foreach ($classes as $cls) {
    $schema[strtolower($cls)] = call_user_func(array($cls, 'schemaDef'));
}