Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.41 diff -u -F^f -r1.41 install.php --- install.php 13 Apr 2007 08:56:57 -0000 1.41 +++ install.php 14 Apr 2007 22:47:35 -0000 @@ -39,12 +39,26 @@ function install_main() { } // Load module basics (needed for hook invokes). + // We load all modules that either are required during installation time + // or have models that need to be created include_once './includes/module.inc'; $module_list['system']['filename'] = 'modules/system/system.module'; $module_list['filter']['filename'] = 'modules/filter/filter.module'; + $module_list['block']['filename'] = 'modules/block/block.module'; + $module_list['user']['filename'] = 'modules/user/user.module'; + $module_list['node']['filename'] = 'modules/node/node.module'; + $module_list['comment']['filename'] = 'modules/comment/comment.module'; + $module_list['taxonomy']['filename'] = 'modules/taxonomy/taxonomy.module'; module_list(TRUE, FALSE, FALSE, $module_list); drupal_load('module', 'system'); drupal_load('module', 'filter'); + drupal_load('module', 'block'); + drupal_load('module', 'user'); + drupal_load('module', 'node'); + drupal_load('module', 'comment'); + drupal_load('module', 'taxonomy'); + drupal_load('module', 'system'); + drupal_load('module', 'filter'); // Decide which profile to use. if (!empty($_GET['profile'])) { Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.628 diff -u -F^f -r1.628 common.inc --- includes/common.inc 13 Apr 2007 08:56:57 -0000 1.628 +++ includes/common.inc 14 Apr 2007 22:47:36 -0000 @@ -2482,3 +2482,87 @@ function drupal_common_themes() { ), ); } + +/** + * Get the definition of a data model. + * A data model will be cached in a static variable once loaded the first time. + * + * @param $model_id The model to load. + */ +function drupal_get_model($model_id) { + static $models = array(); + + if (isset($models[$model_id])) + return $models[$model_id]; + + $model = _drupal_get_model($model_id); + + if (!empty($model)) { + $models[$model_id] = $model; + return $models[$model_id]; + } + return false; +} + +function _drupal_get_model($model_id) { + $modelinfo = drupal_get_model_info(); + if (!isset($modelinfo[$model_id])) + return false; + + $info = $modelinfo[$model_id]; + + if (function_exists($info['callback'])) { + $model = call_user_func_array($info['callback'], $info['callback arguments']); + } + // If the callback function is not existing, we try to include the module file. + elseif (file_exists(drupal_get_path('module', $info['module']) .'/'. $info['file'])) { + require_once drupal_get_path('module', $info['module']) .'/'. $info['file']; + if (function_exists($info['callback'])) { + $model = call_user_func_array($info['callback'], $info['callback arguments']); + } + } + // If the callback function is still not present, we return. + else { + return false; + } + + // set some default properties + $defaults = array('name' => $model_id, 'table' => $model_id); + $model = array_merge($defaults, $model); + + return $model; +} + +function drupal_get_model_info($refresh = false) { + static $info; + + // only build the model info once + if (!empty($info) && !$refresh) + return $info; + + $modules = module_implements('models'); + foreach ($modules as $module) { + $models = module_invoke($module, 'models'); + foreach ($models as $key => $value) { + + // if the value isn't an array, only default options are used. + if(!is_array($value)) + $value = array('name' => $value); + + $name = $value['name']; + + // the default options are only based on the model name and its module + $default_options = array( + 'module' => $module, + 'name' => $name, + 'file' => "models/$name.model", + 'callback' => "model_$name", + 'callback arguments' => array(), + ); + + // merge the default options with the specified ones + $info[$key] = array_merge($default_options, $value); + } + } + return $info; +} \ No newline at end of file Index: includes/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database.inc,v retrieving revision 1.67 diff -u -F^f -r1.67 database.inc --- includes/database.inc 13 Apr 2007 08:56:57 -0000 1.67 +++ includes/database.inc 14 Apr 2007 22:47:36 -0000 @@ -308,6 +308,41 @@ function db_escape_table($string) { return preg_replace('/[^A-Za-z0-9_]+/', '', $string); } + +/** + * Create a table from a drupal data model. + * + * A drupal data model is a representation of a data structure. + * It is always pulled from a callback function (similar to FAPI). + * This callback function, model_modelid(), should return an associative array that + * describes the data structure of the model (table). The following keys will be + * processed during table creation: + * - ['table']: The table name. Defaults to the model_id. + * - ['fields']: An associative array ('fieldname' => details) that describes the fields + * of the model. In the details array, the following options are available: + * - ['type']: The generic datatype. One of: + * 'string', 'number', 'float', 'text', 'blob' + * - ['size']: The data size. This decides which engine-specific datatype is used + * (e.g. TINYINT vs. INT). If not set, 'normal' is used (which would expand + * to INT resp. TEXT resp. BLOB). + * For number: 'tiny','small','medium','normal','big'. + * For text: 'small','medium','normal','long'. + * For blob: 'normal','long'. + * - ['length']: For chars the max. length, for numbers the display width (mysql only). + * - ['not null']: If true, no NULL values will be allowed. Defaults to false. + * - ['default']: The default value. + * - ['unsigned'], ['auto_increment'] + * All options apart from 'type' are optional. + * - ['primary key']: An array of (one or more) field names that shall form the primary key + * - ['unique key']: An array of the form 'key_name' => array('field1' [, 'field2' [, 'field3']]) + * - ['keys']: An array of the form 'key_name' => array('field1' [, 'field2' [, 'field3']]) + * - ['indexes']: An array of the form 'index_name' => array('field1' [, 'field2' [, 'field3']]) + * + * @param $model_id A valid data model id. + */ +/* +// Currently, all functions are located in database.foo.inc +* /** * @} End of "defgroup database". */ Index: includes/database.mysql.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database.mysql.inc,v retrieving revision 1.69 diff -u -F^f -r1.69 database.mysql.inc --- includes/database.mysql.inc 13 Apr 2007 08:56:57 -0000 1.69 +++ includes/database.mysql.inc 14 Apr 2007 22:47:37 -0000 @@ -438,6 +438,150 @@ function db_distinct_field($table, $fiel return preg_replace('/(SELECT.*)(?:'. $table .'\.|\s)(? $field) { + $query .= _db_create_field_sql($name, db_process_field($field)); + $query .= ", \n"; + } + + // Process keys. + if (isset($model['primary key'])) + $query .= " PRIMARY KEY (" . implode(', ', $model['primary key']) . "), \n"; + + if (isset($model['unique key'])) { + foreach ($model['unique key'] as $key => $fields) + $query .= " UNIQUE KEY $key (" . implode(', ', $fields) . "), \n"; + } + + if (isset($model['keys'])) { + foreach ($model['keys'] as $key => $fields) + $query .= " KEY $key (" . implode(', ', $fields) . "), \n"; + } + + if (isset($model['indexes'])) { + foreach ($model['indexes'] as $key => $fields) + $query .= " INDEX $key (" . implode(', ', $fields) . "), \n"; + } + + $query = substr($query, 0, strlen($query) - 3); + $query .= ");"; + // print $query; + return db_query($query); +} + +/** + * Set database-engine specific properties for a field. + * + * @param $field A field description array, as specified in the data model documentation. + */ +function db_process_field($field) { + // set default properties + if (!isset($field['not null'])) + $field['not null'] = false; + + switch ($field['type']) { + case 'string': + $field['dbtype'] = 'VARCHAR'; + break; + case 'number': + if (!isset($field['size'])) + $field['size'] = 'normal'; + switch ($field['size']) { + case 'tiny': + $field['dbtype'] = 'TINYINT'; + break; + case 'small': + $field['dbtype'] = 'SMALLINT'; + break; + case 'medium': + $field['dbtype'] = 'MEDIUMINT'; + break; + case 'big': + $field['dbtype'] = 'BIGINT'; + break; + case 'normal': + $field['dbtype'] = 'INT'; + break; + } + break; + case 'text': + if (!isset($field['size'])) + $field['size'] = 'normal'; + switch ($field['size']) { + case 'small': + $field['dbtype'] = 'SMALLTEXT'; + break; + case 'medium': + $field['dbtype'] = 'MEDIUMTEXT'; + break; + case 'normal': + $field['dbtype'] = 'TEXT'; + break; + case 'long': + $field['dbtype'] = 'LONGTEXT'; + break; + } + break; + case 'blob': + if (isset($field['size']) && $field['size'] == 'long') + $field['dbtype'] = 'LONGBLOB'; + else + $field['dbtype'] = 'BLOB'; + break; + case 'float': + $field['dbtype'] = 'FLOAT'; + break; + } + return $field; +} + + +/** +* Create a SQL string for a field to be used in table creation or alteration. +* +* Before passing a field out of a model definition into this function it has +* to be processed by db_process_field. +* +* @param $name +* Name of the field +* @param $details +* The field properties. At least $details['dbtype'] has to be set by now. +* Aditional properties are 'length', 'unsigned', 'not null', 'auto_increment', 'default' +*/ +function _db_create_field_sql($name, $details) { + $query = "`" . $name . "` " . $details['dbtype']; + + if (isset($details['length'])) + $query .= "(" . $details['length'] . ") "; + + if (!empty($details['unsigned'])) + $query .= " unsigned "; + + if (isset($details['not null']) && $details['not null']) + $query .= " NOT NULL "; + + if (isset($details['auto_increment']) && $details['auto_increment']) + $query .= " auto_increment "; + + if (isset($details['default']) && $details['default'] !== FALSE) + $query .= " DEFAULT '" . $details['default'] . "' "; + + if (!isset($details['default']) && $details['not null'] == FALSE) + $query .= " DEFAULT NULL "; + + return substr($query, 0, strlen($query) -1); +} + + /** * @} End of "ingroup database". */ Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.336 diff -u -F^f -r1.336 aggregator.module --- modules/aggregator/aggregator.module 13 Apr 2007 08:56:57 -0000 1.336 +++ modules/aggregator/aggregator.module 14 Apr 2007 22:47:37 -0000 @@ -1430,3 +1430,15 @@ function aggregator_filter_xss($value) { function _aggregator_items($count) { return format_plural($count, '1 item', '@count items'); } + + +function aggregator_models() { + $models = array( + 'aggregator_category' => 'aggregator_category', + 'aggregator_category_feed' => 'aggregator_category_feed', + 'aggregator_category_item' => 'aggregator_category_item', + 'aggregator_feed' => 'aggregator_feed', + 'aggregator_item' => 'aggregator_item', + ); + return $models; +} Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.256 diff -u -F^f -r1.256 block.module --- modules/block/block.module 9 Apr 2007 13:58:02 -0000 1.256 +++ modules/block/block.module 14 Apr 2007 22:47:38 -0000 @@ -749,3 +749,13 @@ function block_list($region) { } return $blocks[$region]; } + + +function block_models() { + $models = array( + 'blocks' => 'blocks', + 'boxes' => 'boxes', + 'blocks_roles' => 'blocks_roles', + ); + return $models; +} Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.417 diff -u -F^f -r1.417 book.module --- modules/book/book.module 13 Apr 2007 08:56:57 -0000 1.417 +++ modules/book/book.module 14 Apr 2007 22:47:38 -0000 @@ -1005,3 +1005,11 @@ function book_help($section) { } + + +function book_models() { + $models = array( + 'book' => 'book', + ); + return $models; +} Index: modules/color/color.module =================================================================== RCS file: /cvs/drupal/drupal/modules/color/color.module,v retrieving revision 1.18 diff -u -F^f -r1.18 color.module --- modules/color/color.module 6 Apr 2007 13:27:21 -0000 1.18 +++ modules/color/color.module 14 Apr 2007 22:47:39 -0000 @@ -572,3 +572,10 @@ function _color_rgb2hsl($rgb) { } return array($h, $s, $l); } + + +function color_models() { + $models = array( + ); + return $models; +} Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.538 diff -u -F^f -r1.538 comment.module --- modules/comment/comment.module 13 Apr 2007 08:56:58 -0000 1.538 +++ modules/comment/comment.module 14 Apr 2007 22:47:40 -0000 @@ -2057,3 +2057,12 @@ function vancode2int($c = '00') { return base_convert(substr($c, 1), 36, 10); } + + +function comment_models() { + $models = array( + 'comments' => 'comments', + 'node_comment_statistics' => 'node_comment_statistics', + ); + return $models; +} Index: modules/contact/contact.module =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v retrieving revision 1.80 diff -u -F^f -r1.80 contact.module --- modules/contact/contact.module 13 Apr 2007 08:56:58 -0000 1.80 +++ modules/contact/contact.module 14 Apr 2007 22:47:40 -0000 @@ -553,3 +553,11 @@ function contact_mail_page_submit($form_ return ''; } + + +function contact_models() { + $models = array( + 'contact' => 'contact', + ); + return $models; +} Index: modules/drupal/drupal.module =================================================================== RCS file: /cvs/drupal/drupal/modules/drupal/drupal.module,v retrieving revision 1.142 diff -u -F^f -r1.142 drupal.module --- modules/drupal/drupal.module 13 Apr 2007 08:56:58 -0000 1.142 +++ modules/drupal/drupal.module 14 Apr 2007 22:47:40 -0000 @@ -395,3 +395,12 @@ function drupal_login($username, $passwo } } } + + +function drupal_models() { + $models = array( + 'client' => 'client', + 'client_system' => 'client_system', + ); + return $models; +} Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.168 diff -u -F^f -r1.168 filter.module --- modules/filter/filter.module 13 Apr 2007 08:56:58 -0000 1.168 +++ modules/filter/filter.module 14 Apr 2007 22:47:41 -0000 @@ -1509,3 +1509,12 @@ function filter_xss_bad_protocol($string * @} End of "Standard filters". */ + + +function filter_models() { + $models = array( + 'filter_formats' => 'filter_formats', + 'filters' => 'filters', + ); + return $models; +} Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.393 diff -u -F^f -r1.393 forum.module --- modules/forum/forum.module 13 Apr 2007 08:56:58 -0000 1.393 +++ modules/forum/forum.module 14 Apr 2007 22:47:41 -0000 @@ -1185,3 +1185,11 @@ function _forum_get_topic_order_sql($sor } + + +function forum_models() { + $models = array( + 'forum' => 'forum', + ); + return $models; +} Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.165 diff -u -F^f -r1.165 locale.module --- modules/locale/locale.module 13 Apr 2007 08:56:58 -0000 1.165 +++ modules/locale/locale.module 14 Apr 2007 22:47:42 -0000 @@ -470,3 +470,13 @@ function locale_admin_string_delete($lid include_once './includes/locale.inc'; _locale_string_delete($lid); } + + +function locale_models() { + $models = array( + 'languages' => 'languages', + 'locales_source' => 'locales_source', + 'locales_target' => 'locales_target', + ); + return $models; +} Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.106 diff -u -F^f -r1.106 menu.module --- modules/menu/menu.module 6 Apr 2007 13:27:21 -0000 1.106 +++ modules/menu/menu.module 14 Apr 2007 22:47:42 -0000 @@ -737,3 +737,11 @@ function _menu_overview_tree() { } return $output; } + + +function menu_models() { + $models = array( + 'menu_edit' => 'menu_edit', + ); + return $models; +} Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.800 diff -u -F^f -r1.800 node.module --- modules/node/node.module 10 Apr 2007 12:11:42 -0000 1.800 +++ modules/node/node.module 14 Apr 2007 22:47:43 -0000 @@ -3050,3 +3050,15 @@ function node_forms() { } return $forms; } + + +function node_models() { + $models = array( + 'node' => 'node', + 'node_access' => 'node_access', + 'node_revisions' => 'node_revisions', + 'node_type' => 'node_type', + 'node_counter' => 'node_counter', + ); + return $models; +} Index: modules/poll/poll.module =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v retrieving revision 1.226 diff -u -F^f -r1.226 poll.module --- modules/poll/poll.module 6 Apr 2007 13:27:22 -0000 1.226 +++ modules/poll/poll.module 14 Apr 2007 22:47:44 -0000 @@ -660,3 +660,13 @@ function poll_user($op, &$edit, &$user) db_query('UPDATE {poll_votes} SET uid = 0 WHERE uid = %d', $user->uid); } } + + +function poll_models() { + $models = array( + 'poll' => 'poll', + 'poll_votes' => 'poll_votes', + 'poll_choices' => 'poll_choices', + ); + return $models; +} Index: modules/profile/profile.module =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v retrieving revision 1.197 diff -u -F^f -r1.197 profile.module --- modules/profile/profile.module 6 Apr 2007 13:27:22 -0000 1.197 +++ modules/profile/profile.module 14 Apr 2007 22:47:44 -0000 @@ -862,3 +862,12 @@ function profile_admin_settings_autocomp print drupal_to_js($matches); exit(); } + + +function profile_models() { + $models = array( + 'profile_fields' => 'profile_fields', + 'profile_values' => 'profile_values', + ); + return $models; +} Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.218 diff -u -F^f -r1.218 search.module --- modules/search/search.module 13 Apr 2007 08:56:59 -0000 1.218 +++ modules/search/search.module 14 Apr 2007 22:47:45 -0000 @@ -1316,3 +1316,13 @@ function search_forms() { ); return $forms; } + + +function search_models() { + $models = array( + 'search_dataset' => 'search_dataset', + 'search_index' => 'search_index', + 'search_total' => 'search_total', + ); + return $models; +} Index: modules/statistics/statistics.module =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v retrieving revision 1.256 diff -u -F^f -r1.256 statistics.module --- modules/statistics/statistics.module 13 Apr 2007 08:56:59 -0000 1.256 +++ modules/statistics/statistics.module 14 Apr 2007 22:47:45 -0000 @@ -535,3 +535,11 @@ function statistics_nodeapi(&$node, $op, } + + +function statistics_models() { + $models = array( + 'accesslog' => 'accesslog', + ); + return $models; +} Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.90 diff -u -F^f -r1.90 system.install --- modules/system/system.install 13 Apr 2007 08:53:24 -0000 1.90 +++ modules/system/system.install 14 Apr 2007 22:47:46 -0000 @@ -165,918 +165,27 @@ function system_requirements($phase) { return $requirements; } - /** * Implementation of hook_install(). */ function system_install() { - switch ($GLOBALS['db_type']) { - case 'mysql': - case 'mysqli': - db_query("CREATE TABLE {access} ( - aid int NOT NULL auto_increment, - mask varchar(255) NOT NULL default '', - type varchar(255) NOT NULL default '', - status tinyint NOT NULL default '0', - PRIMARY KEY (aid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {authmap} ( - aid int unsigned NOT NULL auto_increment, - uid int NOT NULL default '0', - authname varchar(128) NOT NULL default '', - module varchar(128) NOT NULL default '', - PRIMARY KEY (aid), - UNIQUE KEY authname (authname) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {blocks} ( - module varchar(64) DEFAULT '' NOT NULL, - delta varchar(32) NOT NULL default '0', - theme varchar(255) NOT NULL default '', - status tinyint DEFAULT '0' NOT NULL, - weight tinyint DEFAULT '0' NOT NULL, - region varchar(64) DEFAULT 'left' NOT NULL, - custom tinyint DEFAULT '0' NOT NULL, - throttle tinyint DEFAULT '0' NOT NULL, - visibility tinyint DEFAULT '0' NOT NULL, - pages text NOT NULL, - title varchar(64) DEFAULT '' NOT NULL - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {boxes} ( - bid int NOT NULL, - body longtext, - info varchar(128) NOT NULL default '', - format int NOT NULL default '0', - PRIMARY KEY (bid), - UNIQUE KEY info (info) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {cache} ( - cid varchar(255) NOT NULL default '', - data longblob, - expire int NOT NULL default '0', - created int NOT NULL default '0', - headers text, - PRIMARY KEY (cid), - INDEX expire (expire) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - db_query("CREATE TABLE {cache_filter} ( - cid varchar(255) NOT NULL default '', - data longblob, - expire int NOT NULL default '0', - created int NOT NULL default '0', - headers text, - PRIMARY KEY (cid), - INDEX expire (expire) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - db_query("CREATE TABLE {cache_page} ( - cid varchar(255) BINARY NOT NULL default '', - data longblob, - expire int NOT NULL default '0', - created int NOT NULL default '0', - headers text, - PRIMARY KEY (cid), - INDEX expire (expire) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {comments} ( - cid int NOT NULL auto_increment, - pid int NOT NULL default '0', - nid int NOT NULL default '0', - uid int NOT NULL default '0', - subject varchar(64) NOT NULL default '', - comment longtext NOT NULL, - hostname varchar(128) NOT NULL default '', - timestamp int NOT NULL default '0', - score mediumint NOT NULL default '0', - status tinyint unsigned NOT NULL default '0', - format int NOT NULL default '0', - thread varchar(255) NOT NULL, - users longtext, - name varchar(60) default NULL, - mail varchar(64) default NULL, - homepage varchar(255) default NULL, - PRIMARY KEY (cid), - KEY lid (nid), - KEY status (status) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {node_comment_statistics} ( - nid int unsigned NOT NULL auto_increment, - last_comment_timestamp int NOT NULL default '0', - last_comment_name varchar(60) default NULL, - last_comment_uid int NOT NULL default '0', - comment_count int unsigned NOT NULL default '0', - PRIMARY KEY (nid), - KEY node_comment_timestamp (last_comment_timestamp) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {files} ( - fid int unsigned NOT NULL default 0, - nid int unsigned NOT NULL default 0, - filename varchar(255) NOT NULL default '', - filepath varchar(255) NOT NULL default '', - filemime varchar(255) NOT NULL default '', - filesize int unsigned NOT NULL default 0, - PRIMARY KEY (fid), - KEY nid (nid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {file_revisions} ( - fid int unsigned NOT NULL default 0, - vid int unsigned NOT NULL default 0, - description varchar(255) NOT NULL default '', - list tinyint unsigned NOT NULL default 0, - PRIMARY KEY (fid, vid), - KEY (vid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {filter_formats} ( - format int NOT NULL auto_increment, - name varchar(255) NOT NULL default '', - roles varchar(255) NOT NULL default '', - cache tinyint NOT NULL default '0', - PRIMARY KEY (format), - UNIQUE KEY (name) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {filters} ( - format int NOT NULL default '0', - module varchar(64) NOT NULL default '', - delta tinyint DEFAULT '0' NOT NULL, - weight tinyint DEFAULT '0' NOT NULL, - INDEX (weight) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {flood} ( - event varchar(64) NOT NULL default '', - hostname varchar(128) NOT NULL default '', - timestamp int NOT NULL default '0' - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {history} ( - uid int NOT NULL default '0', - nid int NOT NULL default '0', - timestamp int NOT NULL default '0', - PRIMARY KEY (uid,nid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {menu} ( - mid int NOT NULL default 0, - pid int NOT NULL default 0, - path varchar(255) NOT NULL default '', - load_functions varchar(255) NOT NULL default '', - to_arg_functions varchar(255) NOT NULL default '', - access_callback varchar(255) NOT NULL default '', - access_arguments text, - page_callback varchar(255) NOT NULL default '', - page_arguments text, - fit int NOT NULL default 0, - number_parts int NOT NULL default 0, - mleft int NOT NULL default 0, - mright int NOT NULL default 0, - visible int NOT NULL default 0, - parents varchar(255) NOT NULL default '', - depth int NOT NULL default 0, - has_children int NOT NULL default 0, - tab int NOT NULL default 0, - title varchar(255) NOT NULL default '', - parent varchar(255) NOT NULL default '', - type int NOT NULL default 0, - block_callback varchar(255) NOT NULL default '', - description varchar(255) NOT NULL default '', - position varchar(255) NOT NULL default '', - link_path varchar(255) NOT NULL default '', - attributes varchar(255) NOT NULL default '', - query varchar(255) NOT NULL default '', - fragment varchar(255) NOT NULL default '', - absolute INT NOT NULL default 0, - html INT NOT NULL default 0, - PRIMARY KEY (path), - KEY fit (fit), - KEY visible (visible), - KEY pid (pid), - KEY parent (parent) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {node} ( - nid int unsigned NOT NULL auto_increment, - vid int unsigned NOT NULL default '0', - type varchar(32) NOT NULL default '', - title varchar(128) NOT NULL default '', - uid int NOT NULL default '0', - status int NOT NULL default '1', - created int NOT NULL default '0', - changed int NOT NULL default '0', - comment int NOT NULL default '0', - promote int NOT NULL default '0', - moderate int NOT NULL default '0', - sticky int NOT NULL default '0', - PRIMARY KEY (nid, vid), - UNIQUE KEY vid (vid), - KEY node_type (type(4)), - KEY node_title_type (title, type(4)), - KEY status (status), - KEY uid (uid), - KEY node_moderate (moderate), - KEY node_promote_status (promote, status), - KEY node_created (created), - KEY node_changed (changed), - KEY node_status_type (status, type, nid), - KEY nid (nid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {node_access} ( - nid int unsigned NOT NULL default '0', - gid int unsigned NOT NULL default '0', - realm varchar(255) NOT NULL default '', - grant_view tinyint unsigned NOT NULL default '0', - grant_update tinyint unsigned NOT NULL default '0', - grant_delete tinyint unsigned NOT NULL default '0', - PRIMARY KEY (nid,gid,realm) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {node_revisions} ( - nid int unsigned NOT NULL, - vid int unsigned NOT NULL, - uid int NOT NULL default '0', - title varchar(128) NOT NULL default '', - body longtext NOT NULL, - teaser longtext NOT NULL, - log longtext NOT NULL, - timestamp int NOT NULL default '0', - format int NOT NULL default '0', - PRIMARY KEY (vid), - KEY nid (nid), - KEY uid (uid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {node_type} ( - type varchar(32) NOT NULL, - name varchar(255) NOT NULL default '', - module varchar(255) NOT NULL, - description mediumtext NOT NULL, - help mediumtext NOT NULL, - has_title tinyint unsigned NOT NULL, - title_label varchar(255) NOT NULL default '', - has_body tinyint unsigned NOT NULL, - body_label varchar(255) NOT NULL default '', - min_word_count smallint unsigned NOT NULL, - custom tinyint NOT NULL DEFAULT '0', - modified tinyint NOT NULL DEFAULT '0', - locked tinyint NOT NULL DEFAULT '0', - orig_type varchar(255) NOT NULL default '', - PRIMARY KEY (type) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {url_alias} ( - pid int unsigned NOT NULL auto_increment, - src varchar(128) NOT NULL default '', - dst varchar(128) NOT NULL default '', - language varchar(12) NOT NULL default '', - PRIMARY KEY (pid), - UNIQUE KEY dst_language (dst, language), - KEY src (src) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {permission} ( - rid int unsigned NOT NULL default '0', - perm longtext, - tid int unsigned NOT NULL default '0', - KEY rid (rid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {role} ( - rid int unsigned NOT NULL auto_increment, - name varchar(64) NOT NULL default '', - PRIMARY KEY (rid), - UNIQUE KEY name (name) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {blocks_roles} ( - module varchar(64) NOT NULL, - delta varchar(32) NOT NULL, - rid int unsigned NOT NULL, - PRIMARY KEY (module, delta, rid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {sessions} ( - uid int unsigned NOT NULL, - sid varchar(64) NOT NULL default '', - hostname varchar(128) NOT NULL default '', - timestamp int NOT NULL default '0', - cache int NOT NULL default '0', - session longtext, - KEY uid (uid), - PRIMARY KEY (sid), - KEY timestamp (timestamp) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {sequences} ( - name varchar(255) NOT NULL default '', - id int unsigned NOT NULL default '0', - PRIMARY KEY (name) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {node_counter} ( - nid int NOT NULL default '0', - totalcount bigint unsigned NOT NULL default '0', - daycount mediumint unsigned NOT NULL default '0', - timestamp int unsigned NOT NULL default '0', - PRIMARY KEY (nid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {system} ( - filename varchar(255) NOT NULL default '', - name varchar(255) NOT NULL default '', - type varchar(255) NOT NULL default '', - description varchar(255) NOT NULL default '', - status int NOT NULL default '0', - throttle tinyint DEFAULT '0' NOT NULL, - bootstrap int NOT NULL default '0', - schema_version smallint NOT NULL default -1, - weight int NOT NULL default '0', - PRIMARY KEY (filename), - KEY (weight) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {term_data} ( - tid int unsigned NOT NULL auto_increment, - vid int unsigned NOT NULL default '0', - name varchar(255) NOT NULL default '', - description longtext, - weight tinyint NOT NULL default '0', - PRIMARY KEY (tid), - KEY vid (vid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {term_hierarchy} ( - tid int unsigned NOT NULL default '0', - parent int unsigned NOT NULL default '0', - KEY tid (tid), - KEY parent (parent), - PRIMARY KEY (tid, parent) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {term_node} ( - nid int unsigned NOT NULL default '0', - vid int unsigned NOT NULL default '0', - tid int unsigned NOT NULL default '0', - KEY nid (nid), - KEY vid (vid), - KEY tid (tid), - PRIMARY KEY (vid,tid,nid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {term_relation} ( - tid1 int unsigned NOT NULL default '0', - tid2 int unsigned NOT NULL default '0', - KEY tid1 (tid1), - KEY tid2 (tid2) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {term_synonym} ( - tid int unsigned NOT NULL default '0', - name varchar(255) NOT NULL default '', - KEY tid (tid), - KEY name (name(3)) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {users} ( - uid int unsigned NOT NULL default '0', - name varchar(60) NOT NULL default '', - pass varchar(32) NOT NULL default '', - mail varchar(64) default '', - mode tinyint NOT NULL default '0', - sort tinyint default '0', - threshold tinyint default '0', - theme varchar(255) NOT NULL default '', - signature varchar(255) NOT NULL default '', - created int NOT NULL default '0', - access int NOT NULL default '0', - login int NOT NULL default '0', - status tinyint NOT NULL default '0', - timezone varchar(8) default NULL, - language varchar(12) NOT NULL default '', - picture varchar(255) NOT NULL DEFAULT '', - init varchar(64) default '', - data longtext, - PRIMARY KEY (uid), - UNIQUE KEY name (name), - KEY created (created), - KEY access (access) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {users_roles} ( - uid int unsigned NOT NULL default '0', - rid int unsigned NOT NULL default '0', - PRIMARY KEY (uid, rid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {variable} ( - name varchar(128) NOT NULL default '', - value longtext NOT NULL, - language varchar(12) NOT NULL default '', - PRIMARY KEY (name, language) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {vocabulary} ( - vid int unsigned NOT NULL auto_increment, - name varchar(255) NOT NULL default '', - description longtext, - help varchar(255) NOT NULL default '', - relations tinyint unsigned NOT NULL default '0', - hierarchy tinyint unsigned NOT NULL default '0', - multiple tinyint unsigned NOT NULL default '0', - required tinyint unsigned NOT NULL default '0', - tags tinyint unsigned NOT NULL default '0', - module varchar(255) NOT NULL default '', - weight tinyint NOT NULL default '0', - PRIMARY KEY (vid) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - db_query("CREATE TABLE {vocabulary_node_types} ( - vid int unsigned NOT NULL DEFAULT '0', - type varchar(32) NOT NULL DEFAULT '', - PRIMARY KEY (vid, type) - ) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); - - break; - case 'pgsql': - /* create unsigned types */ - db_query("CREATE DOMAIN int_unsigned integer CHECK (VALUE >= 0)"); - db_query("CREATE DOMAIN smallint_unsigned smallint CHECK (VALUE >= 0)"); - db_query("CREATE DOMAIN bigint_unsigned bigint CHECK (VALUE >= 0)"); - - /* create functions */ - db_query('CREATE OR REPLACE FUNCTION "greatest"(numeric, numeric) RETURNS numeric AS - \'SELECT CASE WHEN (($1 > $2) OR ($2 IS NULL)) THEN $1 ELSE $2 END;\' - LANGUAGE \'sql\'' - ); - db_query('CREATE OR REPLACE FUNCTION "greatest"(numeric, numeric, numeric) RETURNS numeric AS - \'SELECT greatest($1, greatest($2, $3));\' - LANGUAGE \'sql\'' - ); - if (!db_result(db_query("SELECT COUNT(*) FROM pg_proc WHERE proname = 'rand'"))) { - db_query('CREATE OR REPLACE FUNCTION "rand"() RETURNS float AS - \'SELECT random();\' - LANGUAGE \'sql\'' - ); - } - - if (!db_result(db_query("SELECT COUNT(*) FROM pg_proc WHERE proname = 'concat'"))) { - db_query('CREATE OR REPLACE FUNCTION "concat"(text, text) RETURNS text AS - \'SELECT $1 || $2;\' - LANGUAGE \'sql\'' - ); - } - db_query('CREATE OR REPLACE FUNCTION "if"(boolean, text, text) RETURNS text AS - \'SELECT CASE WHEN $1 THEN $2 ELSE $3 END;\' - LANGUAGE \'sql\'' - ); - db_query('CREATE OR REPLACE FUNCTION "if"(boolean, integer, integer) RETURNS integer AS - \'SELECT CASE WHEN $1 THEN $2 ELSE $3 END;\' - LANGUAGE \'sql\'' - ); - - /* create tables */ - db_query("CREATE TABLE {access} ( - aid serial, - mask varchar(255) NOT NULL default '', - type varchar(255) NOT NULL default '', - status smallint NOT NULL default '0', - PRIMARY KEY (aid) - )"); - - db_query("CREATE TABLE {authmap} ( - aid serial CHECK (aid >= 0), - uid int NOT NULL default '0', - authname varchar(128) NOT NULL default '', - module varchar(128) NOT NULL default '', - PRIMARY KEY (aid), - UNIQUE (authname) - )"); - - db_query("CREATE TABLE {blocks} ( - module varchar(64) DEFAULT '' NOT NULL, - delta varchar(32) NOT NULL default '0', - theme varchar(255) NOT NULL default '', - status smallint DEFAULT '0' NOT NULL, - weight smallint DEFAULT '0' NOT NULL, - region varchar(64) DEFAULT 'left' NOT NULL, - custom smallint DEFAULT '0' NOT NULL, - throttle smallint DEFAULT '0' NOT NULL, - visibility smallint DEFAULT '0' NOT NULL, - pages text DEFAULT '' NOT NULL, - title varchar(64) DEFAULT '' NOT NULL - )"); - - db_query("CREATE TABLE {boxes} ( - bid serial, - body text, - info varchar(128) NOT NULL default '', - format smallint NOT NULL default '0', - PRIMARY KEY (bid), - UNIQUE (info) - )"); - - db_query("CREATE TABLE {cache} ( - cid varchar(255) NOT NULL default '', - data bytea, - expire int NOT NULL default '0', - created int NOT NULL default '0', - headers text, - PRIMARY KEY (cid) - )"); - db_query("CREATE TABLE {cache_filter} ( - cid varchar(255) NOT NULL default '', - data bytea, - expire int NOT NULL default '0', - created int NOT NULL default '0', - headers text, - PRIMARY KEY (cid) - )"); - db_query("CREATE TABLE {cache_page} ( - cid varchar(255) NOT NULL default '', - data bytea, - expire int NOT NULL default '0', - created int NOT NULL default '0', - headers text, - PRIMARY KEY (cid) - )"); - db_query("CREATE INDEX {cache}_expire_idx ON {cache} (expire)"); - db_query("CREATE INDEX {cache_filter}_expire_idx ON {cache_filter} (expire)"); - db_query("CREATE INDEX {cache_page}_expire_idx ON {cache_page} (expire)"); - - db_query("CREATE TABLE {comments} ( - cid serial, - pid int NOT NULL default '0', - nid int NOT NULL default '0', - uid int NOT NULL default '0', - subject varchar(64) NOT NULL default '', - comment text NOT NULL, - hostname varchar(128) NOT NULL default '', - timestamp int NOT NULL default '0', - score int NOT NULL default '0', - status smallint_unsigned NOT NULL default '0', - format smallint NOT NULL default '0', - thread varchar(255) NOT NULL, - users text, - name varchar(60) default NULL, - mail varchar(64) default NULL, - homepage varchar(255) default NULL, - PRIMARY KEY (cid) - )"); - db_query("CREATE INDEX {comments}_nid_idx ON {comments} (nid)"); - db_query("CREATE INDEX {comments}_status_idx ON {comments} (status)"); - - db_query("CREATE TABLE {node_comment_statistics} ( - nid serial CHECK (nid >= 0), - last_comment_timestamp int NOT NULL default '0', - last_comment_name varchar(60) default NULL, - last_comment_uid int NOT NULL default '0', - comment_count int_unsigned NOT NULL default '0', - PRIMARY KEY (nid) - )"); - db_query("CREATE INDEX {node_comment_statistics}_node_comment_timestamp_idx ON {node_comment_statistics} (last_comment_timestamp)"); - - db_query("CREATE TABLE {files} ( - fid serial CHECK (fid >= 0), - nid int_unsigned NOT NULL default 0, - filename varchar(255) NOT NULL default '', - filepath varchar(255) NOT NULL default '', - filemime varchar(255) NOT NULL default '', - filesize int_unsigned NOT NULL default 0, - PRIMARY KEY (fid) - )"); - db_query("CREATE INDEX {files}_nid_idx ON {files} (nid)"); - - db_query("CREATE TABLE {file_revisions} ( - fid int_unsigned NOT NULL default 0, - vid int_unsigned NOT NULL default 0, - description varchar(255) NOT NULL default '', - list smallint_unsigned NOT NULL default 0, - PRIMARY KEY (fid, vid) - )"); - db_query("CREATE INDEX {file_revisions}_vid_idx ON {file_revisions} (vid)"); - - db_query("CREATE TABLE {filter_formats} ( - format serial, - name varchar(255) NOT NULL default '', - roles varchar(255) NOT NULL default '', - cache smallint NOT NULL default '0', - PRIMARY KEY (format), - UNIQUE (name) - )"); - - db_query("CREATE TABLE {filters} ( - format int NOT NULL default '0', - module varchar(64) NOT NULL default '', - delta smallint DEFAULT '0' NOT NULL, - weight smallint DEFAULT '0' NOT NULL - )"); - db_query("CREATE INDEX {filters}_weight_idx ON {filters} (weight)"); - - db_query("CREATE TABLE {flood} ( - event varchar(64) NOT NULL default '', - hostname varchar(128) NOT NULL default '', - timestamp int NOT NULL default '0' - )"); - - db_query("CREATE TABLE {history} ( - uid int NOT NULL default '0', - nid int NOT NULL default '0', - timestamp int NOT NULL default '0', - PRIMARY KEY (uid,nid) - )"); - - db_query("CREATE TABLE {menu} ( - mid int NOT NULL default 0, - pid int NOT NULL default 0, - path varchar(255) NOT NULL default '', - load_functions varchar(255) NOT NULL default '', - to_arg_functions varchar(255) NOT NULL default '', - access_callback varchar(255) NOT NULL default '', - access_arguments text, - page_callback varchar(255) NOT NULL default '', - page_arguments text, - fit int NOT NULL default 0, - number_parts int NOT NULL default 0, - mleft int NOT NULL default 0, - mright int NOT NULL default 0, - visible int NOT NULL default 0, - parents varchar(255) NOT NULL default '', - depth int NOT NULL default 0, - has_children int NOT NULL default 0, - tab int NOT NULL default 0, - title varchar(255) NOT NULL default '', - parent varchar(255) NOT NULL default '', - type int NOT NULL default 0, - block_callback varchar(255) NOT NULL default '', - description varchar(255) NOT NULL default '', - position varchar(255) NOT NULL default '', - link_path varchar(255) NOT NULL default '', - attributes varchar(255) NOT NULL default '', - query varchar(255) NOT NULL default '', - fragment varchar(255) NOT NULL default '', - absolute INT NOT NULL default 0, - html INT NOT NULL default 0, - PRIMARY KEY (path) - )"); - - db_query("CREATE INDEX {menu}_fit_idx ON {menu} (fit)"); - db_query("CREATE INDEX {menu}_visible_idx ON {menu} (visible)"); - db_query("CREATE INDEX {menu}_parent_idx ON {menu} (parent)"); - db_query("CREATE INDEX {menu}_pid_idx ON {menu} (parent)"); - - db_query("CREATE TABLE {node} ( - nid serial CHECK (nid >= 0), - vid int_unsigned NOT NULL default '0', - type varchar(32) NOT NULL default '', - title varchar(128) NOT NULL default '', - uid int NOT NULL default '0', - status int NOT NULL default '1', - created int NOT NULL default '0', - changed int NOT NULL default '0', - comment int NOT NULL default '0', - promote int NOT NULL default '0', - moderate int NOT NULL default '0', - sticky int NOT NULL default '0', - PRIMARY KEY (nid, vid), - UNIQUE (vid) - )"); - db_query("CREATE INDEX {node}_node_type_idx ON {node} (substr (type, 1, 4))"); - db_query("CREATE INDEX {node}_node_title_type_idx ON {node} (title, substr(type, 1, 4))"); - db_query("CREATE INDEX {node}_status_idx ON {node} (status)"); - db_query("CREATE INDEX {node}_uid_idx ON {node} (uid)"); - db_query("CREATE INDEX {node}_node_moderate_idx ON {node} (moderate)"); - db_query("CREATE INDEX {node}_node_promote_status_idx ON {node} (promote, status)"); - db_query("CREATE INDEX {node}_node_created_idx ON {node} (created)"); - db_query("CREATE INDEX {node}_node_changed_idx ON {node} (changed)"); - db_query("CREATE INDEX {node}_node_status_type_idx ON {node} (status, type, nid)"); - db_query("CREATE INDEX {node}_nid_idx ON {node} (nid)"); - - db_query("CREATE TABLE {node_access} ( - nid int_unsigned NOT NULL default '0', - gid int_unsigned NOT NULL default '0', - realm varchar(255) NOT NULL default '', - grant_view smallint_unsigned NOT NULL default '0', - grant_update smallint_unsigned NOT NULL default '0', - grant_delete smallint_unsigned NOT NULL default '0', - PRIMARY KEY (nid,gid,realm) - )"); - - db_query("CREATE TABLE {node_revisions} ( - nid int_unsigned NOT NULL, - vid serial CHECK (vid >= 0), - uid int NOT NULL default '0', - title varchar(128) NOT NULL default '', - body text NOT NULL default '', - teaser text NOT NULL default '', - log text NOT NULL default '', - timestamp int NOT NULL default '0', - format int NOT NULL default '0', - PRIMARY KEY (vid) - )"); - db_query("CREATE INDEX {node_revisions}_nid_idx ON {node_revisions} (nid)"); - db_query("CREATE INDEX {node_revisions}_uid_idx ON {node_revisions} (uid)"); - - db_query("CREATE TABLE {node_type} ( - type varchar(32) NOT NULL, - name varchar(255) NOT NULL default '', - module varchar(255) NOT NULL, - description text NOT NULL, - help text NOT NULL, - has_title smallint_unsigned NOT NULL, - title_label varchar(255) NOT NULL default '', - has_body smallint_unsigned NOT NULL, - body_label varchar(255) NOT NULL default '', - min_word_count smallint_unsigned NOT NULL, - custom smallint NOT NULL DEFAULT '0', - modified smallint NOT NULL DEFAULT '0', - locked smallint NOT NULL DEFAULT '0', - orig_type varchar(255) NOT NULL default '', - PRIMARY KEY (type) - )"); - - db_query("CREATE TABLE {url_alias} ( - pid serial CHECK (pid >= 0), - src varchar(128) NOT NULL default '', - dst varchar(128) NOT NULL default '', - language varchar(12) NOT NULL default '', - PRIMARY KEY (pid) - )"); - db_query("CREATE INDEX {url_alias}_src_idx ON {url_alias} (src)"); - db_query("CREATE UNIQUE INDEX {url_alias}_dst_language_idx ON {url_alias} (dst, language)"); - - db_query("CREATE TABLE {permission} ( - rid int_unsigned NOT NULL default '0', - perm text, - tid int_unsigned NOT NULL default '0' - )"); - db_query("CREATE INDEX {permission}_rid_idx ON {permission} (rid)"); - - db_query("CREATE TABLE {role} ( - rid serial CHECK (rid >= 0), - name varchar(64) NOT NULL default '', - PRIMARY KEY (rid), - UNIQUE (name) - )"); - - db_query("CREATE TABLE {blocks_roles} ( - module varchar(64) NOT NULL, - delta varchar(32) NOT NULL, - rid int_unsigned NOT NULL, - PRIMARY KEY (module, delta, rid) - )"); - - db_query("CREATE TABLE {sessions} ( - uid int_unsigned NOT NULL, - sid varchar(64) NOT NULL default '', - hostname varchar(128) NOT NULL default '', - timestamp int NOT NULL default '0', - cache int NOT NULL default '0', - session text, - PRIMARY KEY (sid) - )"); - db_query("CREATE INDEX {sessions}_uid_idx ON {sessions} (uid)"); - db_query("CREATE INDEX {sessions}_timestamp_idx ON {sessions} (timestamp)"); - -/* Only used for MySQL - db_query("CREATE TABLE {sequences} ( - name varchar(255) NOT NULL default '', - id int_unsigned NOT NULL default '0', - PRIMARY KEY (name) - )"); */ - - db_query("CREATE TABLE {node_counter} ( - nid int NOT NULL default '0', - totalcount bigint_unsigned NOT NULL default '0', - daycount int_unsigned NOT NULL default '0', - timestamp int_unsigned NOT NULL default '0', - PRIMARY KEY (nid) - )"); - - db_query("CREATE TABLE {system} ( - filename varchar(255) NOT NULL default '', - name varchar(255) NOT NULL default '', - type varchar(255) NOT NULL default '', - description varchar(255) NOT NULL default '', - status int NOT NULL default '0', - throttle smallint DEFAULT '0' NOT NULL, - bootstrap int NOT NULL default '0', - schema_version smallint NOT NULL default -1, - weight int NOT NULL default '0', - PRIMARY KEY (filename) - )"); - db_query("CREATE INDEX {system}_weight_idx ON {system} (weight)"); - - db_query("CREATE TABLE {term_data} ( - tid serial CHECK (tid >= 0), - vid int_unsigned NOT NULL default '0', - name varchar(255) NOT NULL default '', - description text, - weight smallint NOT NULL default '0', - PRIMARY KEY (tid) - )"); - db_query("CREATE INDEX {term_data}_vid_idx ON {term_data} (vid)"); - - db_query("CREATE TABLE {term_hierarchy} ( - tid int_unsigned NOT NULL default '0', - parent int_unsigned NOT NULL default '0', - PRIMARY KEY (tid, parent) - )"); - db_query("CREATE INDEX {term_hierarchy}_tid_idx ON {term_hierarchy} (tid)"); - db_query("CREATE INDEX {term_hierarchy}_parent_idx ON {term_hierarchy} (parent)"); - - db_query("CREATE TABLE {term_node} ( - nid int_unsigned NOT NULL default '0', - vid int_unsigned NOT NULL default '0', - tid int_unsigned NOT NULL default '0', - PRIMARY KEY (tid,nid,vid) - )"); - db_query("CREATE INDEX {term_node}_nid_idx ON {term_node} (nid)"); - db_query("CREATE INDEX {term_node}_vid_idx ON {term_node} (vid)"); - db_query("CREATE INDEX {term_node}_tid_idx ON {term_node} (tid)"); - - db_query("CREATE TABLE {term_relation} ( - tid1 int_unsigned NOT NULL default '0', - tid2 int_unsigned NOT NULL default '0' - )"); - db_query("CREATE INDEX {term_relation}_tid1_idx ON {term_relation} (tid1)"); - db_query("CREATE INDEX {term_relation}_tid2_idx ON {term_relation} (tid2)"); - - db_query("CREATE TABLE {term_synonym} ( - tid int_unsigned NOT NULL default '0', - name varchar(255) NOT NULL default '' - )"); - db_query("CREATE INDEX {term_synonym}_tid_idx ON {term_synonym} (tid)"); - db_query("CREATE INDEX {term_synonym}_name_idx ON {term_synonym} (substr(name, 1, 3))"); - - db_query("CREATE TABLE {users} ( - uid serial CHECK (uid >= 0), - name varchar(60) NOT NULL default '', - pass varchar(32) NOT NULL default '', - mail varchar(64) default '', - mode smallint NOT NULL default '0', - sort smallint default '0', - threshold smallint default '0', - theme varchar(255) NOT NULL default '', - signature varchar(255) NOT NULL default '', - created int NOT NULL default '0', - access int NOT NULL default '0', - login int NOT NULL default '0', - status smallint NOT NULL default '0', - timezone varchar(8) default NULL, - language varchar(12) NOT NULL default '', - picture varchar(255) NOT NULL DEFAULT '', - init varchar(64) default '', - data text, - PRIMARY KEY (uid), - UNIQUE (name) - )"); - db_query("CREATE INDEX {users}_access_idx ON {users} (access)"); - db_query("CREATE INDEX {users}_created_idx ON {users} (created)"); - - db_query("CREATE TABLE {users_roles} ( - uid int_unsigned NOT NULL default '0', - rid int_unsigned NOT NULL default '0', - PRIMARY KEY (uid, rid) - )"); - - db_query("CREATE TABLE {variable} ( - name varchar(128) NOT NULL default '', - value text NOT NULL, - language varchar(12) NOT NULL default '', - PRIMARY KEY (name, language) - )"); - - db_query("CREATE TABLE {vocabulary} ( - vid serial CHECK (vid >= 0), - name varchar(255) NOT NULL default '', - description text, - help varchar(255) NOT NULL default '', - relations smallint_unsigned NOT NULL default '0', - hierarchy smallint_unsigned NOT NULL default '0', - multiple smallint_unsigned NOT NULL default '0', - required smallint_unsigned NOT NULL default '0', - tags smallint_unsigned NOT NULL default '0', - module varchar(255) NOT NULL default '', - weight smallint NOT NULL default '0', - PRIMARY KEY (vid) - )"); - - db_query("CREATE TABLE {vocabulary_node_types} ( - vid int_unsigned NOT NULL DEFAULT '0', - type varchar(32) NOT NULL DEFAULT '', - PRIMARY KEY (vid, type) - )"); - - break; + // Models for which tables shall be created + $model_ids = array( + 'access', 'authmap', 'blocks', 'boxes', 'cache', 'cache_filter', 'cache_page', + 'comments', 'node_comment_statistics', 'files', 'file_revisions', + 'filter_formats', 'filters', 'flood', 'history', 'menu', 'node', + 'node_access', 'node_revisions', 'node_type', 'url_alias', 'permission', + 'role', 'blocks_roles', 'sessions', 'sequences', 'node_counter', 'system', + 'term_data', 'term_hierarchy', 'term_node', 'term_relation', 'term_synonym', + 'users', 'users_roles', 'variable', 'vocabulary', 'vocabulary_node_types' + ); + + // Create tables. + foreach ($model_ids as $model_id) { + $model = drupal_get_model($model_id); + db_create_table($model); } - + db_query("INSERT INTO {system} (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0, 0)"); db_query("INSERT INTO {system} (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/garland/page.tpl.php', 'garland', 'theme', 'themes/engines/phptemplate/phptemplate.engine', 1, 0, 0, 0)"); Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.467 diff -u -F^f -r1.467 system.module --- modules/system/system.module 13 Apr 2007 08:56:59 -0000 1.467 +++ modules/system/system.module 14 Apr 2007 22:47:48 -0000 @@ -2448,3 +2448,24 @@ function system_cron() { db_query('DELETE FROM {flood} WHERE timestamp < %d', time() - 3600); } + + +function system_models() { + $models = array( + 'authmap' => 'authmap', + 'cache' => 'cache', + 'cache_filter' => 'cache_filter', + 'cache_page' => 'cache_page', + 'files' => 'files', + 'file_revisions' => 'file_revisions', + 'flood' => 'flood', + 'history' => 'history', + 'menu' => 'menu', + 'url_alias' => 'url_alias', + 'sessions' => 'sessions', + 'sequences' => 'sequences', + 'system' => 'system', + 'variable' => 'variable', + ); + return $models; +} Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.350 diff -u -F^f -r1.350 taxonomy.module --- modules/taxonomy/taxonomy.module 13 Apr 2007 08:56:59 -0000 1.350 +++ modules/taxonomy/taxonomy.module 14 Apr 2007 22:47:48 -0000 @@ -1558,3 +1558,17 @@ function taxonomy_implode_tags($tags, $v } return implode(', ', $typed_tags); } + + +function taxonomy_models() { + $models = array( + 'term_data' => 'term_data', + 'term_hierarchy' => 'term_hierarchy', + 'term_node' => 'term_node', + 'term_relation' => 'term_relation', + 'term_synonym' => 'term_synonym', + 'vocabulary' => 'vocabulary', + 'vocabulary_node_types' => 'vocabulary_node_types', + ); + return $models; +} Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.771 diff -u -F^f -r1.771 user.module --- modules/user/user.module 13 Apr 2007 08:56:59 -0000 1.771 +++ modules/user/user.module 14 Apr 2007 22:47:50 -0000 @@ -2849,3 +2849,13 @@ function theme_user_signature($signature return $output; } +function user_models() { + $models = array( + 'access' => 'access', + 'permission' => 'permission', + 'role' => 'role', + 'users' => 'users', + 'users_roles' => 'users_roles', + ); + return $models; +} Index: ./modules/aggregator/models/aggregator_category.model --- /dev/null +++ ./modules/aggregator/models/aggregator_category.model @@ -0,0 +1,15 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'title' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'description' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'block' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('cid'); + $model['unique key'] = array('title' => array('title')); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/aggregator/models/aggregator_category_feed.model --- /dev/null +++ ./modules/aggregator/models/aggregator_category_feed.model @@ -0,0 +1,12 @@ + array('type' => 'number', 'default' => 0, 'not null' => true), + 'cid' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('fid,cid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/aggregator/models/aggregator_category_item.model --- /dev/null +++ ./modules/aggregator/models/aggregator_category_item.model @@ -0,0 +1,12 @@ + array('type' => 'number', 'default' => 0, 'not null' => true), + 'cid' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('iid,cid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/aggregator/models/aggregator_feed.model --- /dev/null +++ ./modules/aggregator/models/aggregator_feed.model @@ -0,0 +1,22 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'title' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'url' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'refresh' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'checked' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'link' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'description' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'image' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'etag' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'modified' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'block' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('fid'); + $model['unique key'] = array('title' => array('title')); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/aggregator/models/aggregator_item.model --- /dev/null +++ ./modules/aggregator/models/aggregator_item.model @@ -0,0 +1,21 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'fid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'title' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'link' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'author' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'description' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'timestamp' => array('type' => 'number', 'not null' => false), + 'guid' => array('type' => 'string', 'length' => 255) + ); + $model['primary key'] = array('iid'); + $model['keys'] = array( + 'fid' => array('fid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/block/models/blocks.model --- /dev/null +++ ./modules/block/models/blocks.model @@ -0,0 +1,20 @@ + array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true), + 'delta' => array('type' => 'string', 'length' => 32, 'default' => 0, 'not null' => true), + 'theme' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'status' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'region' => array('type' => 'string', 'length' => 64, 'default' => 'left', 'not null' => true), + 'custom' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'throttle' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'visibility' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'pages' => array('type' => 'text', 'not null' => true), + 'title' => array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true) + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/block/models/boxes.model --- /dev/null +++ ./modules/block/models/boxes.model @@ -0,0 +1,15 @@ + array('type' => 'number', 'not null' => true), + 'body' => array('type' => 'text', 'size' => 'long'), + 'info' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'format' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('bid'); + $model['unique key'] = array('info' => array('info')); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/block/models/blocks_roles.model --- /dev/null +++ ./modules/block/models/blocks_roles.model @@ -0,0 +1,13 @@ + array('type' => 'string', 'length' => 64, 'not null' => true), + 'delta' => array('type' => 'string', 'length' => 32, 'not null' => true), + 'rid' => array('type' => 'number', 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('module', 'delta', 'rid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/book/models/book.model --- /dev/null +++ ./modules/book/models/book.model @@ -0,0 +1,18 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'nid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'parent' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('vid'); + $model['keys'] = array( + 'nid' => array('nid'), + 'parent' => array('parent') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/comment/models/comments.model --- /dev/null +++ ./modules/comment/models/comments.model @@ -0,0 +1,30 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'pid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'nid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'uid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'subject' => array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true), + 'comment' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'hostname' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'timestamp' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'score' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'medium'), + 'status' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'format' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'thread' => array('type' => 'string', 'length' => 255, 'not null' => true), + 'users' => array('type' => 'text', 'size' => 'long'), + 'name' => array('type' => 'string', 'length' => 60, 'not null' => false), + 'mail' => array('type' => 'string', 'length' => 64, 'not null' => false), + 'homepage' => array('type' => 'string', 'length' => 255, 'not null' => false) + ); + $model['primary key'] = array('cid'); + $model['keys'] = array( + 'lid' => array('nid'), + 'status' => array('status') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/comment/models/node_comment_statistics.model --- /dev/null +++ ./modules/comment/models/node_comment_statistics.model @@ -0,0 +1,18 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'last_comment_timestamp' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'last_comment_name' => array('type' => 'string', 'length' => 60, 'not null' => false), + 'last_comment_uid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'comment_count' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('nid'); + $model['keys'] = array( + 'node_comment_timestamp' => array('last_comment_timestamp') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/contact/models/contact.model --- /dev/null +++ ./modules/contact/models/contact.model @@ -0,0 +1,17 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'category' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'recipients' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'reply' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'selected' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('cid'); + $model['unique key'] = array('category' => array('category')); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/dblog/models/watchdog.model --- /dev/null +++ ./modules/dblog/models/watchdog.model @@ -0,0 +1,23 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'uid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'type' => array('type' => 'string', 'length' => 16, 'default' => '', 'not null' => true), + 'message' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'severity' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'link' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'location' => array('type' => 'text', 'not null' => true), + 'referer' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'hostname' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'timestamp' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('wid'); + $model['keys'] = array( + '' => array('type') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/drupal/models/client.model --- /dev/null +++ ./modules/drupal/models/client.model @@ -0,0 +1,21 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'link' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'name' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'mail' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'slogan' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'mission' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'users' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'nodes' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'version' => array('type' => 'string', 'length' => 35, 'not null' => true), + 'created' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'changed' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('cid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/drupal/models/client_system.model --- /dev/null +++ ./modules/drupal/models/client_system.model @@ -0,0 +1,13 @@ + array('type' => 'number', 'default' => 0, 'not null' => true), + 'name' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'type' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true) + ); + $model['primary key'] = array('cid,name'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/filter/models/filter_formats.model --- /dev/null +++ ./modules/filter/models/filter_formats.model @@ -0,0 +1,15 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'name' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'roles' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'cache' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('format'); + $model['unique key'] = array('' => array('name')); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/filter/models/filters.model --- /dev/null +++ ./modules/filter/models/filters.model @@ -0,0 +1,16 @@ + array('type' => 'number', 'default' => 0, 'not null' => true), + 'module' => array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true), + 'delta' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny') + ); + $model['indexes'] = array( + 'weight' => array('weight') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/forum/models/forum.model --- /dev/null +++ ./modules/forum/models/forum.model @@ -0,0 +1,17 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'vid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'tid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('vid'); + $model['keys'] = array( + 'nid' => array('nid'), + 'tid' => array('tid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/locale/models/languages.model --- /dev/null +++ ./modules/locale/models/languages.model @@ -0,0 +1,20 @@ + array('type' => 'string', 'length' => 12, 'default' => '', 'not null' => true), + 'name' => array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true), + 'native' => array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true), + 'direction' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'enabled' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'plurals' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'formula' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'domain' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'prefix' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('language'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/locale/models/locales_source.model --- /dev/null +++ ./modules/locale/models/locales_source.model @@ -0,0 +1,16 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'location' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'source' => array('type' => 'blob', 'not null' => true) + ); + $model['primary key'] = array('lid'); + $model['keys'] = array( + 'source' => array('source(30)') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/locale/models/locales_target.model --- /dev/null +++ ./modules/locale/models/locales_target.model @@ -0,0 +1,20 @@ + array('type' => 'number', 'default' => 0, 'not null' => true), + 'translation' => array('type' => 'blob', 'not null' => true), + 'language' => array('type' => 'string', 'length' => 12, 'default' => '', 'not null' => true), + 'plid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'plural' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['keys'] = array( + 'lid' => array('lid'), + 'lang' => array('language'), + 'plid' => array('plid'), + 'plural' => array('plural') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/menu/models/menu_edit.model --- /dev/null +++ ./modules/menu/models/menu_edit.model @@ -0,0 +1,18 @@ + array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'disabled' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'title' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'description' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'type' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'admin' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'parent' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true) + ); + $model['primary key'] = array('path'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/node/models/node.model --- /dev/null +++ ./modules/node/models/node.model @@ -0,0 +1,35 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'vid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'type' => array('type' => 'string', 'length' => 32, 'default' => '', 'not null' => true), + 'title' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'uid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'status' => array('type' => 'number', 'default' => 1, 'not null' => true), + 'created' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'changed' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'comment' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'promote' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'moderate' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'sticky' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('nid', 'vid'); + $model['unique key'] = array('vid' => array('vid')); + $model['keys'] = array( + 'node_type' => array('type(4)'), + 'node_title_type' => array('title', 'type(4)'), + 'status' => array('status'), + 'uid' => array('uid'), + 'node_moderate' => array('moderate'), + 'node_promote_status' => array('promote', 'status'), + 'node_created' => array('created'), + 'node_changed' => array('changed'), + 'node_status_type' => array('status', 'type', 'nid'), + 'nid' => array('nid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/node/models/node_access.model --- /dev/null +++ ./modules/node/models/node_access.model @@ -0,0 +1,16 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'gid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'realm' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'grant_view' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'grant_update' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'grant_delete' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('nid,gid,realm'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/node/models/node_revisions.model --- /dev/null +++ ./modules/node/models/node_revisions.model @@ -0,0 +1,23 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true), + 'vid' => array('type' => 'number', 'not null' => true, 'unsigned' => true), + 'uid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'title' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'body' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'teaser' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'log' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'timestamp' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'format' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('vid'); + $model['keys'] = array( + 'nid' => array('nid'), + 'uid' => array('uid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/node/models/node_type.model --- /dev/null +++ ./modules/node/models/node_type.model @@ -0,0 +1,24 @@ + array('type' => 'string', 'length' => 32, 'not null' => true), + 'name' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'module' => array('type' => 'string', 'length' => 255, 'not null' => true), + 'description' => array('type' => 'text', 'not null' => true, 'size' => 'medium'), + 'help' => array('type' => 'text', 'not null' => true, 'size' => 'medium'), + 'has_title' => array('type' => 'number', 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'title_label' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'has_body' => array('type' => 'number', 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'body_label' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'min_word_count' => array('type' => 'number', 'not null' => true, 'unsigned' => true, 'size' => 'small'), + 'custom' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'modified' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'locked' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'orig_type' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true) + ); + $model['primary key'] = array('type'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/node/models/node_counter.model --- /dev/null +++ ./modules/node/models/node_counter.model @@ -0,0 +1,14 @@ + array('type' => 'number', 'default' => 0, 'not null' => true), + 'totalcount' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'big'), + 'daycount' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'medium'), + 'timestamp' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('nid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/poll/models/poll.model --- /dev/null +++ ./modules/poll/models/poll.model @@ -0,0 +1,13 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'runtime' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'active' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('nid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/poll/models/poll_votes.model --- /dev/null +++ ./modules/poll/models/poll_votes.model @@ -0,0 +1,16 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true), + 'uid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'chorder' => array('type' => 'number', 'default' => -1, 'not null' => true), + 'hostname' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true) + ); + $model['indexes'] = array( + 'hostname' => array('hostname') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/poll/models/poll_choices.model --- /dev/null +++ ./modules/poll/models/poll_choices.model @@ -0,0 +1,18 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'nid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'chtext' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'chvotes' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'chorder' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('chid'); + $model['keys'] = array( + 'nid' => array('nid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/profile/models/profile_fields.model --- /dev/null +++ ./modules/profile/models/profile_fields.model @@ -0,0 +1,27 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'title' => array('type' => 'string', 'length' => 255, 'not null' => false), + 'name' => array('type' => 'string', 'length' => 128, 'not null' => false), + 'explanation' => array('type' => 'text'), + 'category' => array('type' => 'string', 'length' => 255, 'not null' => false), + 'page' => array('type' => 'string', 'length' => 255, 'not null' => false), + 'type' => array('type' => 'string', 'length' => 128, 'not null' => false), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'required' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'register' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'visibility' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'autocomplete' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'options' => array('type' => 'text') + ); + $model['primary key'] = array('fid'); + $model['unique key'] = array('name' => array('name')); + $model['keys'] = array( + 'category' => array('category') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/profile/models/profile_values.model --- /dev/null +++ ./modules/profile/models/profile_values.model @@ -0,0 +1,16 @@ + array('type' => 'number', 'default' => 0, 'unsigned' => true), + 'uid' => array('type' => 'number', 'default' => 0, 'unsigned' => true), + 'value' => array('type' => 'text') + ); + $model['keys'] = array( + 'uid' => array('uid'), + 'fid' => array('fid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/search/models/search_dataset.model --- /dev/null +++ ./modules/search/models/search_dataset.model @@ -0,0 +1,15 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'type' => array('type' => 'string', 'length' => 16, 'not null' => false), + 'data' => array('type' => 'text', 'not null' => true, 'size' => 'long') + ); + $model['keys'] = array( + 'sid_type' => array('sid', 'type') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/search/models/search_index.model --- /dev/null +++ ./modules/search/models/search_index.model @@ -0,0 +1,20 @@ + array('type' => 'string', 'length' => 50, 'default' => '', 'not null' => true), + 'sid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'type' => array('type' => 'string', 'length' => 16, 'not null' => false), + 'fromsid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'fromtype' => array('type' => 'string', 'length' => 16, 'not null' => false), + 'score' => array('type' => 'float', 'not null' => false) + ); + $model['keys'] = array( + 'sid_type' => array('sid', 'type'), + 'from_sid_type' => array('fromsid', 'fromtype'), + 'word' => array('word') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/search/models/search_total.model --- /dev/null +++ ./modules/search/models/search_total.model @@ -0,0 +1,12 @@ + array('type' => 'string', 'length' => 50, 'default' => '', 'not null' => true), + 'count' => array('type' => 'float', 'not null' => false) + ); + $model['primary key'] = array('word'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/statistics/models/accesslog.model --- /dev/null +++ ./modules/statistics/models/accesslog.model @@ -0,0 +1,22 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'sid' => array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true), + 'title' => array('type' => 'string', 'length' => 255, 'not null' => false), + 'path' => array('type' => 'string', 'length' => 255, 'not null' => false), + 'url' => array('type' => 'string', 'length' => 255, 'not null' => false), + 'hostname' => array('type' => 'string', 'length' => 128, 'not null' => false), + 'uid' => array('type' => 'number', 'default' => 0, 'unsigned' => true), + 'timer' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'timestamp' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('aid'); + $model['keys'] = array( + 'accesslog_timestamp' => array('timestamp') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/authmap.model --- /dev/null +++ ./modules/system/models/authmap.model @@ -0,0 +1,15 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'uid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'authname' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'module' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true) + ); + $model['primary key'] = array('aid'); + $model['unique key'] = array('authname' => array('authname')); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/cache.model --- /dev/null +++ ./modules/system/models/cache.model @@ -0,0 +1,18 @@ + array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'data' => array('type' => 'blob', 'size' => 'long'), + 'expire' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'created' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'headers' => array('type' => 'text') + ); + $model['primary key'] = array('cid'); + $model['indexes'] = array( + 'expire' => array('expire') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/cache_filter.model --- /dev/null +++ ./modules/system/models/cache_filter.model @@ -0,0 +1,18 @@ + array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'data' => array('type' => 'blob', 'size' => 'long'), + 'expire' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'created' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'headers' => array('type' => 'text') + ); + $model['primary key'] = array('cid'); + $model['indexes'] = array( + 'expire' => array('expire') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/cache_page.model --- /dev/null +++ ./modules/system/models/cache_page.model @@ -0,0 +1,18 @@ + array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'data' => array('type' => 'blob', 'size' => 'long'), + 'expire' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'created' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'headers' => array('type' => 'text') + ); + $model['primary key'] = array('cid'); + $model['indexes'] = array( + 'expire' => array('expire') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/files.model --- /dev/null +++ ./modules/system/models/files.model @@ -0,0 +1,19 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'nid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'filename' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'filepath' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'filemime' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'filesize' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('fid'); + $model['keys'] = array( + 'nid' => array('nid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/file_revisions.model --- /dev/null +++ ./modules/system/models/file_revisions.model @@ -0,0 +1,17 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'vid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'description' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'list' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('fid', 'vid'); + $model['keys'] = array( + '' => array('vid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/flood.model --- /dev/null +++ ./modules/system/models/flood.model @@ -0,0 +1,12 @@ + array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true), + 'hostname' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'timestamp' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/history.model --- /dev/null +++ ./modules/system/models/history.model @@ -0,0 +1,13 @@ + array('type' => 'number', 'default' => 0, 'not null' => true), + 'nid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'timestamp' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('uid,nid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/menu.model --- /dev/null +++ ./modules/system/models/menu.model @@ -0,0 +1,46 @@ + array('type' => 'number', 'default' => 0, 'not null' => true), + 'pid' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'path' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'load_functions' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'to_arg_functions' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'access_callback' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'access_arguments' => array('type' => 'text'), + 'page_callback' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'page_arguments' => array('type' => 'text'), + 'fit' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'number_parts' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'mleft' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'mright' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'visible' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'parents' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'depth' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'has_children' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'tab' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'title' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'parent' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'type' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'block_callback' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'description' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'position' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'link_path' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'attributes' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'query' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'fragment' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'absolute' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'html' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('path'); + $model['keys'] = array( + 'fit' => array('fit'), + 'visible' => array('visible'), + 'pid' => array('pid'), + 'parent' => array('parent') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/url_alias.model --- /dev/null +++ ./modules/system/models/url_alias.model @@ -0,0 +1,18 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'src' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'dst' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'language' => array('type' => 'string', 'length' => 12, 'default' => '', 'not null' => true) + ); + $model['primary key'] = array('pid'); + $model['unique key'] = array('dst_language' => array('dst', 'language')); + $model['keys'] = array( + 'src' => array('src') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/sessions.model --- /dev/null +++ ./modules/system/models/sessions.model @@ -0,0 +1,20 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true), + 'sid' => array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true), + 'hostname' => array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'timestamp' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'cache' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'session' => array('type' => 'text', 'size' => 'long') + ); + $model['primary key'] = array('sid'); + $model['keys'] = array( + 'uid' => array('uid'), + 'timestamp' => array('timestamp') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/sequences.model --- /dev/null +++ ./modules/system/models/sequences.model @@ -0,0 +1,12 @@ + array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'id' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('name'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/system.model --- /dev/null +++ ./modules/system/models/system.model @@ -0,0 +1,22 @@ + array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'name' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'type' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'description' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'status' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'throttle' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'bootstrap' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'schema_version' => array('type' => 'number', 'default' => -1, 'not null' => true, 'size' => 'small'), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true) + ); + $model['primary key'] = array('filename'); + $model['keys'] = array( + '' => array('weight') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/system/models/variable.model --- /dev/null +++ ./modules/system/models/variable.model @@ -0,0 +1,13 @@ + array('type' => 'string', 'length' => 128, 'default' => '', 'not null' => true), + 'value' => array('type' => 'text', 'not null' => true, 'size' => 'long'), + 'language' => array('type' => 'string', 'length' => 12, 'default' => '', 'not null' => true) + ); + $model['primary key'] = array('name', 'language'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/taxonomy/models/term_data.model --- /dev/null +++ ./modules/taxonomy/models/term_data.model @@ -0,0 +1,18 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'vid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'name' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'description' => array('type' => 'text', 'size' => 'long'), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('tid'); + $model['keys'] = array( + 'vid' => array('vid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/taxonomy/models/term_hierarchy.model --- /dev/null +++ ./modules/taxonomy/models/term_hierarchy.model @@ -0,0 +1,16 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'parent' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('tid', 'parent'); + $model['keys'] = array( + 'tid' => array('tid'), + 'parent' => array('parent') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/taxonomy/models/term_node.model --- /dev/null +++ ./modules/taxonomy/models/term_node.model @@ -0,0 +1,18 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'vid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'tid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('vid,tid,nid'); + $model['keys'] = array( + 'nid' => array('nid'), + 'vid' => array('vid'), + 'tid' => array('tid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/taxonomy/models/term_relation.model --- /dev/null +++ ./modules/taxonomy/models/term_relation.model @@ -0,0 +1,15 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'tid2' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['keys'] = array( + 'tid1' => array('tid1'), + 'tid2' => array('tid2') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/taxonomy/models/term_synonym.model --- /dev/null +++ ./modules/taxonomy/models/term_synonym.model @@ -0,0 +1,15 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'name' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true) + ); + $model['keys'] = array( + 'tid' => array('tid'), + 'name' => array('name(3)') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/taxonomy/models/vocabulary.model --- /dev/null +++ ./modules/taxonomy/models/vocabulary.model @@ -0,0 +1,21 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'name' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'description' => array('type' => 'text', 'size' => 'long'), + 'help' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'relations' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'hierarchy' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'multiple' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'required' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'tags' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true, 'size' => 'tiny'), + 'module' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'weight' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('vid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/taxonomy/models/vocabulary_node_types.model --- /dev/null +++ ./modules/taxonomy/models/vocabulary_node_types.model @@ -0,0 +1,12 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'type' => array('type' => 'string', 'length' => 32, 'default' => '', 'not null' => true) + ); + $model['primary key'] = array('vid', 'type'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/user/models/access.model --- /dev/null +++ ./modules/user/models/access.model @@ -0,0 +1,14 @@ + array('type' => 'number', 'not null' => true, 'auto_increment' => true), + 'mask' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'type' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'status' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny') + ); + $model['primary key'] = array('aid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/user/models/permission.model --- /dev/null +++ ./modules/user/models/permission.model @@ -0,0 +1,15 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'perm' => array('type' => 'text', 'size' => 'long'), + 'tid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['keys'] = array( + 'rid' => array('rid') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/user/models/role.model --- /dev/null +++ ./modules/user/models/role.model @@ -0,0 +1,13 @@ + array('type' => 'number', 'not null' => true, 'unsigned' => true, 'auto_increment' => true), + 'name' => array('type' => 'string', 'length' => 64, 'default' => '', 'not null' => true) + ); + $model['primary key'] = array('rid'); + $model['unique key'] = array('name' => array('name')); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/user/models/users.model --- /dev/null +++ ./modules/user/models/users.model @@ -0,0 +1,33 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'name' => array('type' => 'string', 'length' => 60, 'default' => '', 'not null' => true), + 'pass' => array('type' => 'string', 'length' => 32, 'default' => '', 'not null' => true), + 'mail' => array('type' => 'string', 'length' => 64, 'default' => ''), + 'mode' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'sort' => array('type' => 'number', 'default' => 0, 'size' => 'tiny'), + 'threshold' => array('type' => 'number', 'default' => 0, 'size' => 'tiny'), + 'theme' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'signature' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'created' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'access' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'login' => array('type' => 'number', 'default' => 0, 'not null' => true), + 'status' => array('type' => 'number', 'default' => 0, 'not null' => true, 'size' => 'tiny'), + 'timezone' => array('type' => 'string', 'length' => 8, 'not null' => false), + 'language' => array('type' => 'string', 'length' => 12, 'default' => '', 'not null' => true), + 'picture' => array('type' => 'string', 'length' => 255, 'default' => '', 'not null' => true), + 'init' => array('type' => 'string', 'length' => 64, 'default' => ''), + 'data' => array('type' => 'text', 'size' => 'long') + ); + $model['primary key'] = array('uid'); + $model['unique key'] = array('name' => array('name')); + $model['keys'] = array( + 'created' => array('created'), + 'access' => array('access') + ); + + return $model; +} \ Kein Zeilenumbruch am Dateiende. Index: ./modules/user/models/users_roles.model --- /dev/null +++ ./modules/user/models/users_roles.model @@ -0,0 +1,12 @@ + array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true), + 'rid' => array('type' => 'number', 'default' => 0, 'not null' => true, 'unsigned' => true) + ); + $model['primary key'] = array('uid', 'rid'); + + return $model; +} \ Kein Zeilenumbruch am Dateiende.