2010-08-14 09:10:01 +09:00
|
|
|
<?php
|
|
|
|
|
2010-08-14 09:32:25 +09:00
|
|
|
/**
|
2010-10-19 09:08:23 +09:00
|
|
|
*
|
|
|
|
* 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
|
2010-10-30 07:28:48 +09:00
|
|
|
* 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.
|
2010-10-19 09:08:23 +09:00
|
|
|
*
|
|
|
|
* 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?
|
|
|
|
*/
|
2010-08-14 09:10:01 +09:00
|
|
|
|
2011-09-28 00:27:14 +09:00
|
|
|
$classes = array('Schema_version',
|
|
|
|
'Profile',
|
2011-08-23 06:52:02 +09:00
|
|
|
'Avatar',
|
|
|
|
'Sms_carrier',
|
|
|
|
'User',
|
|
|
|
'Subscription',
|
|
|
|
'Group_join_queue',
|
|
|
|
'Subscription_queue',
|
|
|
|
'Oauth_token_association',
|
|
|
|
'Notice',
|
2015-09-05 06:12:23 +09:00
|
|
|
'Notice_location',
|
2011-08-23 06:52:02 +09:00
|
|
|
'Notice_source',
|
2017-05-06 20:54:42 +09:00
|
|
|
'Notice_prefs',
|
2011-08-23 06:52:02 +09:00
|
|
|
'Reply',
|
|
|
|
'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',
|
2013-10-06 20:40:53 +09:00
|
|
|
'Profile_prefs',
|
2011-08-23 06:52:02 +09:00
|
|
|
'Profile_tag',
|
|
|
|
'Profile_list',
|
|
|
|
'Profile_tag_subscription',
|
|
|
|
'Profile_block',
|
|
|
|
'User_group',
|
|
|
|
'Related_group',
|
|
|
|
'Group_inbox',
|
2011-08-23 07:02:29 +09:00
|
|
|
'Group_member',
|
2011-08-23 06:52:02 +09:00
|
|
|
'File',
|
|
|
|
'File_redirection',
|
|
|
|
'File_thumbnail',
|
|
|
|
'File_to_post',
|
|
|
|
'Group_block',
|
|
|
|
'Group_alias',
|
|
|
|
'Session',
|
|
|
|
'Config',
|
|
|
|
'Profile_role',
|
|
|
|
'Location_namespace',
|
|
|
|
'Login_token',
|
|
|
|
'User_location_prefs',
|
|
|
|
'User_im_prefs',
|
|
|
|
'Conversation',
|
|
|
|
'Local_group',
|
|
|
|
'User_urlshortener_prefs',
|
2011-09-24 20:12:34 +09:00
|
|
|
'Old_school_prefs',
|
2012-07-30 23:10:36 +09:00
|
|
|
'User_username',
|
2014-03-06 22:22:26 +09:00
|
|
|
'Attention',
|
2011-08-23 06:52:02 +09:00
|
|
|
);
|
|
|
|
|
|
|
|
foreach ($classes as $cls) {
|
|
|
|
$schema[strtolower($cls)] = call_user_func(array($cls, 'schemaDef'));
|
|
|
|
}
|