diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-10-05 14:43:26 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-10-05 14:43:26 +0000 |
commit | 39706e3c51cf206ca6669bbb7a090d2f7d394591 (patch) | |
tree | 9286ccd302d526ea8a1de799081356fcc77c28a3 | |
parent | d568128b9f7a0181b31e9baa087022e892352ea7 (diff) | |
download | brdo-39706e3c51cf206ca6669bbb7a090d2f7d394591.tar.gz brdo-39706e3c51cf206ca6669bbb7a090d2f7d394591.tar.bz2 |
- Patch #150245 by webchick, bjaspan, ralf, Arancaytar et al: move the .schema files into .install files to prevent mistakes.
44 files changed, 768 insertions, 1119 deletions
@@ -3,7 +3,7 @@ # # Protect files and directories from prying eyes. -<FilesMatch "\.(engine|inc|info|install|module|profile|po|schema|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$"> +<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$"> Order allow,deny </FilesMatch> diff --git a/includes/common.inc b/includes/common.inc index 5baafa8b3..1d53d8736 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2869,8 +2869,8 @@ function drupal_get_schema($name = NULL, $rebuild = FALSE) { } // Otherwise, rebuild the schema cache. else { - // Load the .schema files. - module_load_all_includes('schema'); + // Load the .install files to get hook_schema. + module_load_all_includes('install'); // Invoke hook_schema for all modules. foreach (module_implements('schema') as $module) { @@ -2960,8 +2960,8 @@ function drupal_uninstall_schema($module) { * is returned. */ function drupal_get_schema_unprocessed($module, $table = NULL) { - // Load the .schema file. - module_load_include('schema', $module); + // Load the .install file to get hook_schema. + module_load_include('install', $module); $schema = module_invoke($module, 'schema'); if (!is_null($table) && isset($schema[$table])) { diff --git a/includes/database.inc b/includes/database.inc index 95e09feb5..8b19e8de4 100644 --- a/includes/database.inc +++ b/includes/database.inc @@ -331,7 +331,7 @@ function db_escape_table($string) { * * A Drupal schema definition is an array structure representing one or * more tables and their related keys and indexes. A schema is defined by - * hook_schema(), which usually lives in a modulename.schema file. + * hook_schema(), which usually lives in a modulename.install file. * * By implementing hook_schema() and specifying the tables your module * declares, you can easily create and drop these tables on all diff --git a/modules/aggregator/aggregator.install b/modules/aggregator/aggregator.install index 8c44c33a7..84593d647 100644 --- a/modules/aggregator/aggregator.install +++ b/modules/aggregator/aggregator.install @@ -21,3 +21,74 @@ function aggregator_uninstall() { variable_del('aggregator_clear'); variable_del('aggregator_category_selector'); } + +/** + * Implementation of hook_schema(). + */ +function aggregator_schema() { + $schema['aggregator_category'] = array( + 'fields' => array( + 'cid' => array('type' => 'serial', 'not null' => TRUE), + 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'block' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') + ), + 'primary key' => array('cid'), + 'unique keys' => array('title' => array('title')), + ); + + $schema['aggregator_category_feed'] = array( + 'fields' => array( + 'fid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'cid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) + ), + 'primary key' => array('fid', 'cid'), + ); + + $schema['aggregator_category_item'] = array( + 'fields' => array( + 'iid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'cid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) + ), + 'primary key' => array('iid', 'cid'), + ); + + $schema['aggregator_feed'] = array( + 'fields' => array( + 'fid' => array('type' => 'serial', 'not null' => TRUE), + 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'url' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'refresh' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'checked' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'image' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'etag' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'modified' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'block' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') + ), + 'unique keys' => array( + 'url' => array('url'), + 'title' => array('title') + ), + 'primary key' => array('fid'), + ); + + $schema['aggregator_item'] = array( + 'fields' => array( + 'iid' => array('type' => 'serial', 'not null' => TRUE), + 'fid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'author' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'timestamp' => array('type' => 'int', 'not null' => FALSE), + 'guid' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE) + ), + 'indexes' => array('fid' => array('fid')), + 'primary key' => array('iid'), + ); + + return $schema; +} + diff --git a/modules/aggregator/aggregator.schema b/modules/aggregator/aggregator.schema deleted file mode 100644 index ed0c146e9..000000000 --- a/modules/aggregator/aggregator.schema +++ /dev/null @@ -1,70 +0,0 @@ -<?php -// $Id$ - -function aggregator_schema() { - $schema['aggregator_category'] = array( - 'fields' => array( - 'cid' => array('type' => 'serial', 'not null' => TRUE), - 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'block' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'primary key' => array('cid'), - 'unique keys' => array('title' => array('title')), - ); - - $schema['aggregator_category_feed'] = array( - 'fields' => array( - 'fid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'cid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('fid', 'cid'), - ); - - $schema['aggregator_category_item'] = array( - 'fields' => array( - 'iid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'cid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('iid', 'cid'), - ); - - $schema['aggregator_feed'] = array( - 'fields' => array( - 'fid' => array('type' => 'serial', 'not null' => TRUE), - 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'url' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'refresh' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'checked' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'image' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'etag' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'modified' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'block' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'unique keys' => array( - 'url' => array('url'), - 'title' => array('title') - ), - 'primary key' => array('fid'), - ); - - $schema['aggregator_item'] = array( - 'fields' => array( - 'iid' => array('type' => 'serial', 'not null' => TRUE), - 'fid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'author' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'timestamp' => array('type' => 'int', 'not null' => FALSE), - 'guid' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE) - ), - 'indexes' => array('fid' => array('fid')), - 'primary key' => array('iid'), - ); - - return $schema; -} - diff --git a/modules/block/block.schema b/modules/block/block.schema deleted file mode 100644 index d43309729..000000000 --- a/modules/block/block.schema +++ /dev/null @@ -1,52 +0,0 @@ -<?php -// $Id$ - -function block_schema() { - $schema['blocks'] = array( - 'fields' => array( - 'bid' => array('type' => 'serial', 'not null' => TRUE), - 'module' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - 'delta' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '0'), - 'theme' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'region' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => 'left'), - 'custom' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'throttle' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'visibility' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'pages' => array('type' => 'text', 'not null' => TRUE), - 'title' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - 'cache' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - ), - 'primary key' => array('bid'), - ); - - $schema['blocks_roles'] = array( - 'fields' => array( - 'module' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE), - 'delta' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE), - 'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE) - ), - 'primary key' => array( - 'module', - 'delta', - 'rid' - ), - ); - - $schema['boxes'] = array( - 'fields' => array( - 'bid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'body' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'), - 'info' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'format' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0) - ), - 'unique keys' => array('info' => array('info')), - 'primary key' => array('bid'), - ); - - $schema['cache_block'] = drupal_get_schema_unprocessed('system', 'cache'); - - return $schema; -} - diff --git a/modules/book/book.install b/modules/book/book.install index fdbafe48a..5efeeee0b 100644 --- a/modules/book/book.install +++ b/modules/book/book.install @@ -244,3 +244,24 @@ function book_update_6000() { return $ret; } +/** + * Implementation of hook_schema(). + */ +function book_schema() { + $schema['book'] = array( + 'fields' => array( + 'mlid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'bid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + ), + 'indexes' => array( + 'nid' => array('nid'), + 'bid' => array('bid') + ), + 'primary key' => array('mlid'), + ); + + return $schema; +} + + diff --git a/modules/book/book.schema b/modules/book/book.schema deleted file mode 100644 index f690f38dc..000000000 --- a/modules/book/book.schema +++ /dev/null @@ -1,20 +0,0 @@ -<?php -// $Id$ - -function book_schema() { - $schema['book'] = array( - 'fields' => array( - 'mlid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'bid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - ), - 'indexes' => array( - 'nid' => array('nid'), - 'bid' => array('bid') - ), - 'primary key' => array('mlid'), - ); - - return $schema; -} - diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 4c30b6c60..898016050 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -30,3 +30,47 @@ function comment_update_6001() { $ret[] = update_sql("ALTER TABLE {comments} DROP users"); return $ret; } + +/** + * Implementation of hook_schema(). + */ +function comment_schema() { + $schema['comments'] = array( + 'fields' => array( + 'cid' => array('type' => 'serial', 'not null' => TRUE), + 'pid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'nid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'subject' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), + 'comment' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'status' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), + 'format' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0), + 'thread' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), + 'name' => array('type' => 'varchar', 'length' => 60, 'not null' => FALSE), + 'mail' => array('type' => 'varchar', 'length' => 64, 'not null' => FALSE), + 'homepage' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE) + ), + 'indexes' => array( + 'nid' => array('nid'), + 'status' => array('status') + ), + 'primary key' => array('cid'), + ); + + $schema['node_comment_statistics'] = array( + 'fields' => array( + 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'last_comment_timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'last_comment_name' => array('type' => 'varchar', 'length' => 60, 'not null' => FALSE), + 'last_comment_uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'comment_count' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) + ), + 'indexes' => array('node_comment_timestamp' => array('last_comment_timestamp')), + 'primary key' => array('nid'), + ); + + return $schema; +} + diff --git a/modules/comment/comment.schema b/modules/comment/comment.schema deleted file mode 100644 index 057e55d96..000000000 --- a/modules/comment/comment.schema +++ /dev/null @@ -1,42 +0,0 @@ -<?php -// $Id$ - -function comment_schema() { - $schema['comments'] = array( - 'fields' => array( - 'cid' => array('type' => 'serial', 'not null' => TRUE), - 'pid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'nid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'subject' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - 'comment' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'status' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'format' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0), - 'thread' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), - 'name' => array('type' => 'varchar', 'length' => 60, 'not null' => FALSE), - 'mail' => array('type' => 'varchar', 'length' => 64, 'not null' => FALSE), - 'homepage' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE) - ), - 'indexes' => array( - 'nid' => array('nid'), - 'status' => array('status') - ), - 'primary key' => array('cid'), - ); - - $schema['node_comment_statistics'] = array( - 'fields' => array( - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'last_comment_timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'last_comment_name' => array('type' => 'varchar', 'length' => 60, 'not null' => FALSE), - 'last_comment_uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'comment_count' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array('node_comment_timestamp' => array('last_comment_timestamp')), - 'primary key' => array('nid'), - ); - - return $schema; -} diff --git a/modules/contact/contact.install b/modules/contact/contact.install index fe31ca327..8e3e2298d 100644 --- a/modules/contact/contact.install +++ b/modules/contact/contact.install @@ -20,3 +20,24 @@ function contact_uninstall() { variable_del('contact_form_information'); variable_del('contact_hourly_threshold'); } + +/** + * Implementation of hook_schema(). + */ +function contact_schema() { + $schema['contact'] = array( + 'fields' => array( + 'cid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'category' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'recipients' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'reply' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), + 'selected' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') + ), + 'unique keys' => array('category' => array('category')), + 'primary key' => array('cid'), + ); + + return $schema; +} + diff --git a/modules/contact/contact.schema b/modules/contact/contact.schema deleted file mode 100644 index f77f6a27c..000000000 --- a/modules/contact/contact.schema +++ /dev/null @@ -1,20 +0,0 @@ -<?php -// $Id$ - -function contact_schema() { - $schema['contact'] = array( - 'fields' => array( - 'cid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'category' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'recipients' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'reply' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'selected' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'unique keys' => array('category' => array('category')), - 'primary key' => array('cid'), - ); - - return $schema; -} - diff --git a/modules/dblog/dblog.install b/modules/dblog/dblog.install index b2f0ac97a..41db4cc4f 100644 --- a/modules/dblog/dblog.install +++ b/modules/dblog/dblog.install @@ -16,3 +16,29 @@ function dblog_uninstall() { // Remove tables. drupal_uninstall_schema('dblog'); } + +/** + * Implementation of hook_schema(). + */ +function dblog_schema() { + $schema['watchdog'] = array( + 'fields' => array( + 'wid' => array('type' => 'serial', 'not null' => TRUE), + 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'type' => array('type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => ''), + 'message' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'variables' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'severity' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), + 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'location' => array('type' => 'text', 'not null' => TRUE), + 'referer' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) + ), + 'primary key' => array('wid'), + 'indexes' => array('type' => array('type')), + ); + + return $schema; +} + diff --git a/modules/dblog/dblog.schema b/modules/dblog/dblog.schema deleted file mode 100644 index 785f1d98f..000000000 --- a/modules/dblog/dblog.schema +++ /dev/null @@ -1,25 +0,0 @@ -<?php -// $Id$ - -function dblog_schema() { - $schema['watchdog'] = array( - 'fields' => array( - 'wid' => array('type' => 'serial', 'not null' => TRUE), - 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'type' => array('type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => ''), - 'message' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'variables' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'severity' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'location' => array('type' => 'text', 'not null' => TRUE), - 'referer' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('wid'), - 'indexes' => array('type' => array('type')), - ); - - return $schema; -} - diff --git a/modules/drupal/drupal.install b/modules/drupal/drupal.install index 137b7d013..2c99f12c1 100644 --- a/modules/drupal/drupal.install +++ b/modules/drupal/drupal.install @@ -26,3 +26,37 @@ function drupal_uninstall() { variable_del('drupal_default_da_server'); variable_del('drupal_default_da_server_only'); } + +/** + * Implementation of hook_schema(). + */ +function drupal_schema() { + $schema['client'] = array( + 'fields' => array( + 'cid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'mail' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'slogan' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'mission' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'users' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'nodes' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'version' => array('type' => 'varchar', 'length' => 35, 'not null' => TRUE, 'default' => ''), + 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) + ), + 'primary key' => array('cid'), + ); + + $schema['client_system'] = array( + 'fields' => array( + 'cid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '') + ), + 'primary key' => array('cid', 'name'), + ); + + return $schema; +} + diff --git a/modules/drupal/drupal.schema b/modules/drupal/drupal.schema deleted file mode 100644 index 82b14d3ef..000000000 --- a/modules/drupal/drupal.schema +++ /dev/null @@ -1,33 +0,0 @@ -<?php -// $Id$ - -function drupal_schema() { - $schema['client'] = array( - 'fields' => array( - 'cid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'mail' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'slogan' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'mission' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'users' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'nodes' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'version' => array('type' => 'varchar', 'length' => 35, 'not null' => TRUE, 'default' => ''), - 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('cid'), - ); - - $schema['client_system'] = array( - 'fields' => array( - 'cid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '') - ), - 'primary key' => array('cid', 'name'), - ); - - return $schema; -} - diff --git a/modules/filter/filter.schema b/modules/filter/filter.schema deleted file mode 100644 index fbdf8536e..000000000 --- a/modules/filter/filter.schema +++ /dev/null @@ -1,31 +0,0 @@ -<?php -// $Id$ - -function filter_schema() { - $schema['filters'] = array( - 'fields' => array( - 'fid' => array('type' => 'serial', 'not null' => TRUE), - 'format' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'module' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - 'delta' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'primary key' => array('fid'), - 'indexes' => array('weight' => array('weight')), - ); - $schema['filter_formats'] = array( - 'fields' => array( - 'format' => array('type' => 'serial', 'not null' => TRUE), - 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'roles' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'cache' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'unique keys' => array('name' => array('name')), - 'primary key' => array('format'), - ); - - $schema['cache_filter'] = drupal_get_schema_unprocessed('system', 'cache'); - - return $schema; -} - diff --git a/modules/forum/forum.install b/modules/forum/forum.install index d17b9ba12..71f606eb6 100644 --- a/modules/forum/forum.install +++ b/modules/forum/forum.install @@ -50,3 +50,24 @@ function forum_uninstall() { variable_del('forum_block_num_0'); variable_del('forum_block_num_1'); } + +/** + * Implementation of hook_schema(). + */ +function forum_schema() { + $schema['forum'] = array( + 'fields' => array( + 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) + ), + 'indexes' => array( + 'nid' => array('nid'), + 'tid' => array('tid') + ), + 'primary key' => array('vid'), + ); + + return $schema; +} + diff --git a/modules/forum/forum.schema b/modules/forum/forum.schema deleted file mode 100644 index 738fb8e39..000000000 --- a/modules/forum/forum.schema +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -function forum_schema() { - $schema['forum'] = array( - 'fields' => array( - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array( - 'nid' => array('nid'), - 'tid' => array('tid') - ), - 'primary key' => array('vid'), - ); - - return $schema; -} diff --git a/modules/locale/locale.install b/modules/locale/locale.install index f283dca1c..2c89a8b13 100644 --- a/modules/locale/locale.install +++ b/modules/locale/locale.install @@ -133,3 +133,78 @@ function locale_uninstall() { // Remove tables. drupal_uninstall_schema('locale'); } + +/** + * Implementation of hook_schema(). + */ +function locale_schema() { + $schema['languages'] = array( + 'fields' => array( + // Language code, eg 'de' or 'en-US'. + 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), + // Language name in English. + 'name' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), + // Native language name. + 'native' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), + // LANGUAGE_RTL or LANGUAGE_LTR + 'direction' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + // Enabled flag. + 'enabled' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + // Number of plural indexes in this language. + 'plurals' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + // Plural formula in PHP code to evaluate to get plural indexes. + 'formula' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + // Domain to use for this language. + 'domain' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + // Path prefix to use for this language. + 'prefix' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + // Weight, used in lists of languages. + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + // Location of JavaScript translation file. + 'javascript' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), + ), + 'primary key' => array('language'), + ); + + $schema['locales_source'] = array( + 'fields' => array( + // Unique identifier of this string. + 'lid' => array('type' => 'serial', 'not null' => TRUE), + // Drupal path in case of online discovered translations or file path in case of imported strings. + 'location' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + // A module defined group of translations, see hook_locale(). + 'textgroup' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => 'default'), + // The original string in English. + 'source' => array('type' => 'text', 'mysql_type' => 'blob', 'not null' => TRUE), + // Drupal core version, which last used the string. + 'version' => array('type' => 'varchar', 'length' => 20, 'not null' => TRUE, 'default' => 'none'), + ), + 'primary key' => array('lid'), + 'indexes' => array + ('source' => array(array('source', 30))), + ); + + $schema['locales_target'] = array( + 'fields' => array( + // References locales_source. + 'lid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + // Translation string value in this language. + 'translation' => array('type' => 'text', 'mysql_type' => 'blob', 'not null' => TRUE), + // Language code referencing the languages table. + 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), + // Parent lid (lid of the previous string in the plural chain) in case of plural strings. + 'plid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + // Plural index number in case of plural strings. + 'plural' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) + ), + 'indexes' => array( + 'language' => array('language'), + 'lid' => array('lid'), + 'plid' => array('plid'), + 'plural' => array('plural') + ), + ); + + return $schema; +} + diff --git a/modules/locale/locale.schema b/modules/locale/locale.schema deleted file mode 100644 index be31341e9..000000000 --- a/modules/locale/locale.schema +++ /dev/null @@ -1,74 +0,0 @@ -<?php -// $Id$ - -function locale_schema() { - $schema['languages'] = array( - 'fields' => array( - // Language code, eg 'de' or 'en-US'. - 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), - // Language name in English. - 'name' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - // Native language name. - 'native' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - // LANGUAGE_RTL or LANGUAGE_LTR - 'direction' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - // Enabled flag. - 'enabled' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - // Number of plural indexes in this language. - 'plurals' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - // Plural formula in PHP code to evaluate to get plural indexes. - 'formula' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - // Domain to use for this language. - 'domain' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - // Path prefix to use for this language. - 'prefix' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - // Weight, used in lists of languages. - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - // Location of JavaScript translation file. - 'javascript' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), - ), - 'primary key' => array('language'), - ); - - $schema['locales_source'] = array( - 'fields' => array( - // Unique identifier of this string. - 'lid' => array('type' => 'serial', 'not null' => TRUE), - // Drupal path in case of online discovered translations or file path in case of imported strings. - 'location' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - // A module defined group of translations, see hook_locale(). - 'textgroup' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => 'default'), - // The original string in English. - 'source' => array('type' => 'text', 'mysql_type' => 'blob', 'not null' => TRUE), - // Drupal core version, which last used the string. - 'version' => array('type' => 'varchar', 'length' => 20, 'not null' => TRUE, 'default' => 'none'), - ), - 'primary key' => array('lid'), - 'indexes' => array - ('source' => array(array('source', 30))), - ); - - $schema['locales_target'] = array( - 'fields' => array( - // References locales_source. - 'lid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - // Translation string value in this language. - 'translation' => array('type' => 'text', 'mysql_type' => 'blob', 'not null' => TRUE), - // Language code referencing the languages table. - 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), - // Parent lid (lid of the previous string in the plural chain) in case of plural strings. - 'plid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - // Plural index number in case of plural strings. - 'plural' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array( - 'language' => array('language'), - 'lid' => array('lid'), - 'plid' => array('plid'), - 'plural' => array('plural') - ), - ); - - return $schema; -} - diff --git a/modules/menu/menu.install b/modules/menu/menu.install index 9ef6e1548..d4fdfe42b 100644 --- a/modules/menu/menu.install +++ b/modules/menu/menu.install @@ -20,3 +20,22 @@ function menu_uninstall() { drupal_uninstall_schema('menu'); menu_rebuild(); } + +/** + * Implementation of hook_schema(). + */ +function menu_schema() { + $schema['menu_custom'] = array( + 'fields' => array( + // This is used as a block delta so length is 32. + 'menu_name' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), + 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'description' => array('type' => 'text', 'not null' => FALSE), + ), + 'primary key' => array('menu_name'), + ); + + return $schema; +} + + diff --git a/modules/menu/menu.schema b/modules/menu/menu.schema deleted file mode 100644 index bc8c68a5b..000000000 --- a/modules/menu/menu.schema +++ /dev/null @@ -1,17 +0,0 @@ -<?php -// $Id$ - -function menu_schema() { - $schema['menu_custom'] = array( - 'fields' => array( - // This is used as a block delta so length is 32. - 'menu_name' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), - 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'description' => array('type' => 'text', 'not null' => FALSE), - ), - 'primary key' => array('menu_name'), - ); - - return $schema; -} - diff --git a/modules/node/node.schema b/modules/node/node.schema deleted file mode 100644 index 34e77b325..000000000 --- a/modules/node/node.schema +++ /dev/null @@ -1,109 +0,0 @@ -<?php -// $Id$ - -function node_schema() { - $schema['node'] = array( - 'fields' => array( - 'nid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), - 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), - 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 1), - 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'comment' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'promote' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'moderate' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'sticky' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'tnid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'translate' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - ), - 'indexes' => array( - 'node_changed' => array('changed'), - 'node_created' => array('created'), - 'node_moderate' => array('moderate'), - 'node_promote_status' => array('promote', 'status'), - 'node_status_type' => array('status', 'type', 'nid'), - 'node_title_type' => array('title', array('type', 4)), - 'node_type' => array(array('type', 4)), - 'status' => array('status'), - 'uid' => array('uid'), - 'tnid' => array('tnid'), - 'translate' => array('translate'), - ), - 'unique keys' => array( - 'nid_vid' => array('nid', 'vid'), - 'vid' => array('vid') - ), - 'primary key' => array('nid'), - ); - - $schema['node_access'] = array( - 'fields' => array( - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'gid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'realm' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'grant_view' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'grant_update' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'grant_delete' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'primary key' => array( - 'nid', - 'gid', - 'realm' - ), - ); - - $schema['node_counter'] = array( - 'fields' => array( - 'nid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'totalcount' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'big'), - 'daycount' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'medium'), - 'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('nid'), - ); - - $schema['node_revisions'] = array( - 'fields' => array( - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'vid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'body' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'teaser' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'log' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'format' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array( - 'nid' => array('nid'), - 'uid' => array('uid') - ), - 'primary key' => array('vid'), - ); - - $schema['node_type'] = array( - 'fields' => array( - 'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE), - 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'module' => array('type' => 'varchar', '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' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'size' => 'tiny'), - 'title_label' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'has_body' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'size' => 'tiny'), - 'body_label' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'min_word_count' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'size' => 'small'), - 'custom' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'modified' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'locked' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'orig_type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '') - ), - 'primary key' => array('type'), - ); - - return $schema; -} diff --git a/modules/openid/openid.install b/modules/openid/openid.install index c98b9ea34..1931e4edf 100644 --- a/modules/openid/openid.install +++ b/modules/openid/openid.install @@ -16,3 +16,24 @@ function openid_uninstall() { // Remove table. drupal_uninstall_schema('openid'); } + +/** + * Implementation of hook_schema(). + */ +function openid_schema() { + $schema['openid_association'] = array( + 'fields' => array( + 'idp_endpoint_uri' => array('type' => 'varchar', 'length' => 255), + 'assoc_handle' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), + 'assoc_type' => array('type' => 'varchar', 'length' => 32), + 'session_type' => array('type' => 'varchar', 'length' => 32), + 'mac_key' => array('type' => 'varchar', 'length' => 255), + 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'expires_in' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + ), + 'primary key' => array('assoc_handle'), + ); + + return $schema; +} + diff --git a/modules/openid/openid.schema b/modules/openid/openid.schema deleted file mode 100644 index 258756b27..000000000 --- a/modules/openid/openid.schema +++ /dev/null @@ -1,19 +0,0 @@ -<?php -// $Id$ - -function openid_schema() { - $schema['openid_association'] = array( - 'fields' => array( - 'idp_endpoint_uri' => array('type' => 'varchar', 'length' => 255), - 'assoc_handle' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), - 'assoc_type' => array('type' => 'varchar', 'length' => 32), - 'session_type' => array('type' => 'varchar', 'length' => 32), - 'mac_key' => array('type' => 'varchar', 'length' => 255), - 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'expires_in' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - ), - 'primary key' => array('assoc_handle'), - ); - - return $schema; -}
\ No newline at end of file diff --git a/modules/poll/poll.install b/modules/poll/poll.install index 877b6ed48..b8128b84f 100644 --- a/modules/poll/poll.install +++ b/modules/poll/poll.install @@ -16,3 +16,46 @@ function poll_uninstall() { // Remove tables. drupal_uninstall_schema('poll'); } + +/** + * Implementation of hook_schema(). + */ +function poll_schema() { + $schema['poll'] = array( + 'fields' => array( + 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'runtime' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'active' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) + ), + 'primary key' => array('nid'), + ); + + $schema['poll_choices'] = array( + 'fields' => array( + 'chid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'chtext' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'chvotes' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'chorder' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) + ), + 'indexes' => array('nid' => array('nid')), + 'primary key' => array('chid'), + ); + + $schema['poll_votes'] = array( + 'fields' => array( + 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'chorder' => array('type' => 'int', 'not null' => TRUE, 'default' => -1), + 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '') + ), + 'indexes' => array( + 'hostname' => array('hostname'), + 'nid' => array('nid'), + 'uid' => array('uid') + ), + ); + + return $schema; +} + diff --git a/modules/poll/poll.schema b/modules/poll/poll.schema deleted file mode 100644 index 7a9a35509..000000000 --- a/modules/poll/poll.schema +++ /dev/null @@ -1,42 +0,0 @@ -<?php -// $Id$ - -function poll_schema() { - $schema['poll'] = array( - 'fields' => array( - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'runtime' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'active' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('nid'), - ); - - $schema['poll_choices'] = array( - 'fields' => array( - 'chid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'chtext' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'chvotes' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'chorder' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array('nid' => array('nid')), - 'primary key' => array('chid'), - ); - - $schema['poll_votes'] = array( - 'fields' => array( - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), - 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'chorder' => array('type' => 'int', 'not null' => TRUE, 'default' => -1), - 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '') - ), - 'indexes' => array( - 'hostname' => array('hostname'), - 'nid' => array('nid'), - 'uid' => array('uid') - ), - ); - - return $schema; -} - diff --git a/modules/profile/profile.install b/modules/profile/profile.install index 8e645c28f..e8642da75 100644 --- a/modules/profile/profile.install +++ b/modules/profile/profile.install @@ -18,3 +18,44 @@ function profile_uninstall() { variable_del('profile_block_author_fields'); } + +/** + * Implementation of hook_schema(). + */ +function profile_schema() { + $schema['profile_fields'] = array( + 'fields' => array( + 'fid' => array('type' => 'serial', 'not null' => TRUE), + 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), + 'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'explanation' => array('type' => 'text', 'not null' => FALSE), + 'category' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), + 'page' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), + 'type' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), + 'required' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), + 'register' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), + 'visibility' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), + 'autocomplete' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), + 'options' => array('type' => 'text', 'not null' => FALSE) + ), + 'indexes' => array('category' => array('category')), + 'unique keys' => array('name' => array('name')), + 'primary key' => array('fid'), + ); + + $schema['profile_values'] = array( + 'fields' => array( + 'fid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), + 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), + 'value' => array('type' => 'text', 'not null' => FALSE) + ), + 'indexes' => array( + 'fid' => array('fid'), + 'uid' => array('uid') + ), + ); + + return $schema; +} + diff --git a/modules/profile/profile.schema b/modules/profile/profile.schema deleted file mode 100644 index b36cce9dc..000000000 --- a/modules/profile/profile.schema +++ /dev/null @@ -1,40 +0,0 @@ -<?php -// $Id$ - -function profile_schema() { - $schema['profile_fields'] = array( - 'fields' => array( - 'fid' => array('type' => 'serial', 'not null' => TRUE), - 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), - 'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'explanation' => array('type' => 'text', 'not null' => FALSE), - 'category' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), - 'page' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), - 'type' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'required' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'register' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'visibility' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'autocomplete' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'options' => array('type' => 'text', 'not null' => FALSE) - ), - 'indexes' => array('category' => array('category')), - 'unique keys' => array('name' => array('name')), - 'primary key' => array('fid'), - ); - - $schema['profile_values'] = array( - 'fields' => array( - 'fid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), - 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), - 'value' => array('type' => 'text', 'not null' => FALSE) - ), - 'indexes' => array( - 'fid' => array('fid'), - 'uid' => array('uid') - ), - ); - - return $schema; -} - diff --git a/modules/search/search.install b/modules/search/search.install index 6c7b0adc7..3f2fc48ab 100644 --- a/modules/search/search.install +++ b/modules/search/search.install @@ -20,3 +20,44 @@ function search_uninstall() { variable_del('overlap_cjk'); variable_del('search_cron_limit'); } + +/** + * Implementation of hook_schema(). + */ +function search_schema() { + $schema['search_dataset'] = array( + 'fields' => array( + 'sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'type' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), + 'data' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big') + ), + 'indexes' => array('sid_type' => array('sid', 'type')), + ); + + $schema['search_index'] = array( + 'fields' => array( + 'word' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE, 'default' => ''), + 'sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'type' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), + 'fromsid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'fromtype' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), + 'score' => array('type' => 'float', 'not null' => FALSE) + ), + 'indexes' => array( + 'from_sid_type' => array('fromsid', 'fromtype'), + 'sid_type' => array('sid', 'type'), + 'word' => array('word') + ), + ); + + $schema['search_total'] = array( + 'fields' => array( + 'word' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE, 'default' => ''), + 'count' => array('type' => 'float', 'not null' => FALSE) + ), + 'primary key' => array('word'), + ); + + return $schema; +} + diff --git a/modules/search/search.schema b/modules/search/search.schema deleted file mode 100644 index a90e3c6a1..000000000 --- a/modules/search/search.schema +++ /dev/null @@ -1,40 +0,0 @@ -<?php -// $Id$ - -function search_schema() { - $schema['search_dataset'] = array( - 'fields' => array( - 'sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'type' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), - 'data' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big') - ), - 'indexes' => array('sid_type' => array('sid', 'type')), - ); - - $schema['search_index'] = array( - 'fields' => array( - 'word' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE, 'default' => ''), - 'sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'type' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), - 'fromsid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'fromtype' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), - 'score' => array('type' => 'float', 'not null' => FALSE) - ), - 'indexes' => array( - 'from_sid_type' => array('fromsid', 'fromtype'), - 'sid_type' => array('sid', 'type'), - 'word' => array('word') - ), - ); - - $schema['search_total'] = array( - 'fields' => array( - 'word' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE, 'default' => ''), - 'count' => array('type' => 'float', 'not null' => FALSE) - ), - 'primary key' => array('word'), - ); - - return $schema; -} - diff --git a/modules/statistics/statistics.install b/modules/statistics/statistics.install index 61a0be64d..93cfc8c5f 100644 --- a/modules/statistics/statistics.install +++ b/modules/statistics/statistics.install @@ -43,3 +43,27 @@ function statistics_uninstall() { variable_del('statistics_block_top_all_num'); variable_del('statistics_block_top_last_num'); } + +/** + * Implementation of hook_schema(). + */ +function statistics_schema() { + $schema['accesslog'] = array( + 'fields' => array( + 'aid' => array('type' => 'serial', 'not null' => TRUE), + 'sid' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), + 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), + 'path' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), + 'url' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), + 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE), + 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), + 'timer' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) + ), + 'indexes' => array('accesslog_timestamp' => array('timestamp')), + 'primary key' => array('aid'), + ); + + return $schema; +} + diff --git a/modules/statistics/statistics.schema b/modules/statistics/statistics.schema deleted file mode 100644 index a866c0a5f..000000000 --- a/modules/statistics/statistics.schema +++ /dev/null @@ -1,23 +0,0 @@ -<?php -// $Id$ - -function statistics_schema() { - $schema['accesslog'] = array( - 'fields' => array( - 'aid' => array('type' => 'serial', 'not null' => TRUE), - 'sid' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), - 'path' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), - 'url' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE), - 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE), - 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), - 'timer' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array('accesslog_timestamp' => array('timestamp')), - 'primary key' => array('aid'), - ); - - return $schema; -} - diff --git a/modules/system/system.install b/modules/system/system.install index 67443602b..8ffd1d5f0 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -298,6 +298,220 @@ function system_install() { db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'node_options_forum', 'a:1:{i:0;s:6:"status";}'); } +/** + * Implementation of hook_schema(). + */ +function system_schema() { + // NOTE: {variable} needs to be created before all other tables, as + // some database drivers, e.g. Oracle and DB2, will require variable_get() + // and variable_set() for overcoming some database specific limitations. + $schema['variable'] = array( + 'fields' => array( + 'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'value' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + ), + 'primary key' => array('name'), + ); + + $schema['actions'] = array( + 'fields' => array( + 'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'), + 'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), + 'callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'parameters' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'description' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'), + ), + 'primary key' => array('aid'), + ); + + $schema['actions_aid'] = array( + 'fields' => array( + 'aid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + ), + 'primary key' => array('aid'), + ); + + $schema['batch'] = array( + 'fields' => array( + 'bid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'token' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE), + 'timestamp' => array('type' => 'int', 'not null' => TRUE), + 'batch' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big') + ), + 'primary key' => array('bid'), + 'indexes' => array('token' => array('token')), + ); + + $schema['cache'] = array( + 'fields' => array( + 'cid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'data' => array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'), + 'expire' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'headers' => array('type' => 'text', 'not null' => FALSE), + 'serialized' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0) + ), + 'indexes' => array('expire' => array('expire')), + 'primary key' => array('cid'), + ); + + $schema['cache_form'] = $schema['cache']; + $schema['cache_page'] = $schema['cache']; + $schema['cache_menu'] = $schema['cache']; + + $schema['files'] = array( + 'fields' => array( + 'fid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'filepath' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'filemime' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'filesize' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + ), + 'indexes' => array( + 'uid' => array('uid'), + 'status' => array('status'), + 'timestamp' => array('timestamp'), + ), + 'primary key' => array('fid'), + ); + + $schema['flood'] = array( + 'fields' => array( + 'fid' => array('type' => 'serial', 'not null' => TRUE), + 'event' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), + 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) + ), + 'primary key' => array('fid'), + ); + + $schema['history'] = array( + 'fields' => array( + 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'nid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) + ), + 'primary key' => array('uid', 'nid'), + ); + $schema['menu_router'] = array( + 'fields' => array( + 'path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'load_functions' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'to_arg_functions' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'access_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'access_arguments' => array('type' => 'text', 'not null' => FALSE), + 'page_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'page_arguments' => array('type' => 'text', 'not null' => FALSE), + 'fit' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'number_parts' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), + 'tab_parent' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'tab_root' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'title_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'title_arguments' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'type' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'block_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'description' => array('type' => 'text', 'not null' => TRUE), + 'position' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'file' => array('type' => 'text', 'size' => 'medium') + ), + 'indexes' => array( + 'fit' => array('fit'), + 'tab_parent' => array('tab_parent') + ), + 'primary key' => array('path'), + ); + + $schema['menu_links'] = array( + 'fields' => array( + 'menu_name' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), + 'mlid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'plid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'link_path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'router_path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'link_title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'options' => array('type' => 'text', 'not null' => FALSE), + 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => 'system'), + 'hidden' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), + 'external' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), + 'has_children' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), + 'expanded' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'depth' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), + 'customized' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), + 'p1' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'p2' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'p3' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'p4' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'p5' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'p6' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'p7' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'p8' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'p9' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'updated' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), + ), + 'indexes' => array( + 'path_menu' => array(array('link_path', 128), 'menu_name'), + 'menu_plid_expand_child' => array('menu_name', 'plid', 'expanded', 'has_children'), + 'menu_parents' => array('menu_name', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9'), + 'router_path' => array(array('router_path', 128)), + ), + 'primary key' => array('mlid'), + ); + + $schema['sessions'] = array( + 'fields' => array( + 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), + 'sid' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), + 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'cache' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'session' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big') + ), + 'primary key' => array('sid'), + 'indexes' => array( + 'timestamp' => array('timestamp'), + 'uid' => array('uid') + ), + ); + + $schema['system'] = array( + 'fields' => array( + 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'owner' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'throttle' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), + 'bootstrap' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'schema_version' => array('type' => 'int', 'not null' => TRUE, 'default' => -1, 'size' => 'small'), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + 'info' => array('type' => 'text', 'not null' => FALSE) + ), + 'primary key' => array('filename'), + 'indexes' => array('weight' => array('weight')), + ); + + $schema['url_alias'] = array( + 'fields' => array( + 'pid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), + 'src' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'dst' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), + 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => '') + ), + 'unique keys' => array('dst_language' => array('dst', 'language')), + 'primary key' => array('pid'), + 'indexes' => array('src' => array('src')), + ); + + return $schema; +} + + // Updates for core function system_update_110() { diff --git a/modules/system/system.schema b/modules/system/system.schema deleted file mode 100644 index d25527a96..000000000 --- a/modules/system/system.schema +++ /dev/null @@ -1,212 +0,0 @@ -<?php -// $Id$ - -function system_schema() { - // NOTE: {variable} needs to be created before all other tables, as - // some database drivers, e.g. Oracle and DB2, will require variable_get() - // and variable_set() for overcoming some database specific limitations. - $schema['variable'] = array( - 'fields' => array( - 'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'value' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - ), - 'primary key' => array('name'), - ); - - $schema['actions'] = array( - 'fields' => array( - 'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'), - 'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), - 'callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'parameters' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'description' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'), - ), - 'primary key' => array('aid'), - ); - - $schema['actions_aid'] = array( - 'fields' => array( - 'aid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - ), - 'primary key' => array('aid'), - ); - - $schema['batch'] = array( - 'fields' => array( - 'bid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'token' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE), - 'timestamp' => array('type' => 'int', 'not null' => TRUE), - 'batch' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big') - ), - 'primary key' => array('bid'), - 'indexes' => array('token' => array('token')), - ); - - $schema['cache'] = array( - 'fields' => array( - 'cid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'data' => array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'), - 'expire' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'headers' => array('type' => 'text', 'not null' => FALSE), - 'serialized' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array('expire' => array('expire')), - 'primary key' => array('cid'), - ); - - $schema['cache_form'] = $schema['cache']; - $schema['cache_page'] = $schema['cache']; - $schema['cache_menu'] = $schema['cache']; - - $schema['files'] = array( - 'fields' => array( - 'fid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'filepath' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'filemime' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'filesize' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - ), - 'indexes' => array( - 'uid' => array('uid'), - 'status' => array('status'), - 'timestamp' => array('timestamp'), - ), - 'primary key' => array('fid'), - ); - - $schema['flood'] = array( - 'fields' => array( - 'fid' => array('type' => 'serial', 'not null' => TRUE), - 'event' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('fid'), - ); - - $schema['history'] = array( - 'fields' => array( - 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'nid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('uid', 'nid'), - ); - $schema['menu_router'] = array( - 'fields' => array( - 'path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'load_functions' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'to_arg_functions' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'access_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'access_arguments' => array('type' => 'text', 'not null' => FALSE), - 'page_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'page_arguments' => array('type' => 'text', 'not null' => FALSE), - 'fit' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'number_parts' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), - 'tab_parent' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'tab_root' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'title_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'title_arguments' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'type' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'block_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'description' => array('type' => 'text', 'not null' => TRUE), - 'position' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'file' => array('type' => 'text', 'size' => 'medium') - ), - 'indexes' => array( - 'fit' => array('fit'), - 'tab_parent' => array('tab_parent') - ), - 'primary key' => array('path'), - ); - - $schema['menu_links'] = array( - 'fields' => array( - 'menu_name' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), - 'mlid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'plid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'link_path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'router_path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'link_title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'options' => array('type' => 'text', 'not null' => FALSE), - 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => 'system'), - 'hidden' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), - 'external' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), - 'has_children' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), - 'expanded' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'depth' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), - 'customized' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), - 'p1' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'p2' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'p3' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'p4' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'p5' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'p6' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'p7' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'p8' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'p9' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'updated' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'), - ), - 'indexes' => array( - 'path_menu' => array(array('link_path', 128), 'menu_name'), - 'menu_plid_expand_child' => array('menu_name', 'plid', 'expanded', 'has_children'), - 'menu_parents' => array('menu_name', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9'), - 'router_path' => array(array('router_path', 128)), - ), - 'primary key' => array('mlid'), - ); - - $schema['sessions'] = array( - 'fields' => array( - 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE), - 'sid' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'cache' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'session' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big') - ), - 'primary key' => array('sid'), - 'indexes' => array( - 'timestamp' => array('timestamp'), - 'uid' => array('uid') - ), - ); - - $schema['system'] = array( - 'fields' => array( - 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'owner' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'throttle' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'bootstrap' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'schema_version' => array('type' => 'int', 'not null' => TRUE, 'default' => -1, 'size' => 'small'), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'info' => array('type' => 'text', 'not null' => FALSE) - ), - 'primary key' => array('filename'), - 'indexes' => array('weight' => array('weight')), - ); - - $schema['url_alias'] = array( - 'fields' => array( - 'pid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'src' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'dst' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => '') - ), - 'unique keys' => array('dst_language' => array('dst', 'language')), - 'primary key' => array('pid'), - 'indexes' => array('src' => array('src')), - ); - - return $schema; -} diff --git a/modules/taxonomy/taxonomy.schema b/modules/taxonomy/taxonomy.schema deleted file mode 100644 index 36d171251..000000000 --- a/modules/taxonomy/taxonomy.schema +++ /dev/null @@ -1,100 +0,0 @@ -<?php -// $Id$ - -function taxonomy_schema() { - $schema['term_data'] = array( - 'fields' => array( - 'tid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'description' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'primary key' => array('tid'), - 'indexes' => array('vid' => array('vid')), - ); - - $schema['term_hierarchy'] = array( - 'fields' => array( - 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'parent' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array( - 'parent' => array('parent'), - 'tid' => array('tid') - ), - 'primary key' => array('tid', 'parent'), - ); - - $schema['term_node'] = array( - 'fields' => array( - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array( - 'nid' => array('nid'), - 'tid' => array('tid'), - 'vid' => array('vid') - ), - 'primary key' => array( - 'vid', - 'tid', - 'nid' - ), - ); - - $schema['term_relation'] = array( - 'fields' => array( - 'trid' => array('type' => 'serial', 'not null' => TRUE), - 'tid1' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'tid2' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'indexes' => array( - 'tid1' => array('tid1'), - 'tid2' => array('tid2') - ), - 'primary key' => array('trid'), - ); - - $schema['term_synonym'] = array( - 'fields' => array( - 'tsid' => array('type' => 'serial', 'not null' => TRUE), - 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '') - ), - 'indexes' => array( - 'name' => array(array('name', 3)), - 'tid' => array('tid') - ), - 'primary key' => array('tsid'), - ); - - $schema['vocabulary'] = array( - 'fields' => array( - 'vid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'description' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'), - 'help' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'relations' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'hierarchy' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'multiple' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'required' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'tags' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'primary key' => array('vid'), - ); - - $schema['vocabulary_node_types'] = array( - 'fields' => array( - 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'type' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '') - ), - 'primary key' => array('vid', 'type'), - ); - - return $schema; -} - diff --git a/modules/trigger/trigger.install b/modules/trigger/trigger.install index 13dd08ae1..14aaf2edd 100644 --- a/modules/trigger/trigger.install +++ b/modules/trigger/trigger.install @@ -19,3 +19,20 @@ function trigger_uninstall() { // Remove tables. drupal_uninstall_schema('trigger'); } + +/** + * Implementation of hook_schema(). + */ +function trigger_schema() { + $schema['trigger_assignments'] = array( + 'fields' => array( + 'hook' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), + 'op' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), + 'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), + ), + 'primary key' => array('hook', 'op', 'aid'), + ); + return $schema; +} + diff --git a/modules/trigger/trigger.schema b/modules/trigger/trigger.schema deleted file mode 100644 index 1b06b97d3..000000000 --- a/modules/trigger/trigger.schema +++ /dev/null @@ -1,15 +0,0 @@ -<?php -// $Id$ - -function trigger_schema() { - $schema['trigger_assignments'] = array( - 'fields' => array( - 'hook' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), - 'op' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), - 'aid' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - ), - 'primary key' => array('hook', 'op', 'aid'), - ); - return $schema; -} diff --git a/modules/update/update.install b/modules/update/update.install index 8c974dbe2..b910fe79a 100644 --- a/modules/update/update.install +++ b/modules/update/update.install @@ -28,3 +28,12 @@ function update_uninstall() { } menu_rebuild(); } + +/** + * Implementation of hook_schema(). + */ +function update_schema() { + $schema['cache_update'] = drupal_get_schema_unprocessed('system', 'cache'); + return $schema; +} + diff --git a/modules/update/update.schema b/modules/update/update.schema deleted file mode 100644 index 20663197b..000000000 --- a/modules/update/update.schema +++ /dev/null @@ -1,7 +0,0 @@ -<?php -// $Id$ - -function update_schema() { - $schema['cache_update'] = drupal_get_schema_unprocessed('system', 'cache'); - return $schema; -} diff --git a/modules/upload/upload.install b/modules/upload/upload.install index 1c07a190d..3e6eb367d 100644 --- a/modules/upload/upload.install +++ b/modules/upload/upload.install @@ -16,3 +16,23 @@ function upload_uninstall() { // Remove tables. drupal_uninstall_schema('upload'); } + +/** + * Implementation of hook_schema(). + */ +function upload_schema() { + $schema['upload'] = array( + 'fields' => array( + 'fid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), + 'description' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'list' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') + ), + 'primary key' => array('fid', 'vid'), + 'indexes' => array('vid' => array('vid'), 'nid' => array('nid')), + ); + + return $schema; +} + diff --git a/modules/upload/upload.schema b/modules/upload/upload.schema deleted file mode 100644 index 09843b58f..000000000 --- a/modules/upload/upload.schema +++ /dev/null @@ -1,19 +0,0 @@ -<?php -// $Id$ - -function upload_schema() { - $schema['upload'] = array( - 'fields' => array( - 'fid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'description' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'list' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'primary key' => array('fid', 'vid'), - 'indexes' => array('vid' => array('vid'), 'nid' => array('nid')), - ); - - return $schema; -} - diff --git a/modules/user/user.schema b/modules/user/user.schema deleted file mode 100644 index 032778f10..000000000 --- a/modules/user/user.schema +++ /dev/null @@ -1,85 +0,0 @@ -<?php -// $Id$ - -function user_schema() { - $schema['access'] = array( - 'fields' => array( - 'aid' => array('type' => 'serial', 'not null' => TRUE), - 'mask' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') - ), - 'primary key' => array('aid'), - ); - - $schema['authmap'] = array( - 'fields' => array( - 'aid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'authname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'module' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '') - ), - 'unique keys' => array('authname' => array('authname')), - 'primary key' => array('aid'), - ); - - $schema['permission'] = array( - 'fields' => array( - 'pid' => array('type' => 'serial', 'not null' => TRUE), - 'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'perm' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'), - 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('pid'), - 'indexes' => array('rid' => array('rid')), - ); - - $schema['role'] = array( - 'fields' => array( - 'rid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'name' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => '') - ), - 'unique keys' => array('name' => array('name')), - 'primary key' => array('rid'), - ); - - $schema['users'] = array( - 'fields' => array( - 'uid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - 'name' => array('type' => 'varchar', 'length' => 60, 'not null' => TRUE, 'default' => ''), - 'pass' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''), - 'mail' => array('type' => 'varchar', 'length' => 64, 'not null' => FALSE, 'default' => ''), - 'mode' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'sort' => array('type' => 'int', 'not null' => FALSE, 'default' => 0, 'size' => 'tiny'), - 'threshold' => array('type' => 'int', 'not null' => FALSE, 'default' => 0, 'size' => 'tiny'), - 'theme' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'signature' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'access' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'login' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), - 'timezone' => array('type' => 'varchar', 'length' => 8, 'not null' => FALSE), - 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), - 'picture' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'init' => array('type' => 'varchar', 'length' => 64, 'not null' => FALSE, 'default' => ''), - 'data' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big') - ), - 'indexes' => array( - 'access' => array('access'), - 'created' => array('created') - ), - 'unique keys' => array('name' => array('name')), - 'primary key' => array('uid'), - ); - - $schema['users_roles'] = array( - 'fields' => array( - 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) - ), - 'primary key' => array('uid', 'rid'), - ); - - return $schema; -} - |