summaryrefslogtreecommitdiff
path: root/modules/poll
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-10-05 14:43:26 +0000
committerDries Buytaert <dries@buytaert.net>2007-10-05 14:43:26 +0000
commit39706e3c51cf206ca6669bbb7a090d2f7d394591 (patch)
tree9286ccd302d526ea8a1de799081356fcc77c28a3 /modules/poll
parentd568128b9f7a0181b31e9baa087022e892352ea7 (diff)
downloadbrdo-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.
Diffstat (limited to 'modules/poll')
-rw-r--r--modules/poll/poll.install43
-rw-r--r--modules/poll/poll.schema42
2 files changed, 43 insertions, 42 deletions
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;
-}
-