/[drupal]/contributions/modules/question/question.install
ViewVC logotype

Contents of /contributions/modules/question/question.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Fri Oct 24 04:26:21 2008 UTC (13 months ago) by codepoet
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +40 -0 lines
File MIME type: text/x-php
updating file listing for HEAD
1 <?php
2 function question_install() {
3 switch ($GLOBALS['db_type']) {
4 case 'mysql':
5 case 'mysqli':
6 case 'pgsql':
7 db_query("CREATE TABLE {question_node} (
8 nid int(10) NOT NULL default '0',
9 questioner varchar(50) NOT NULL default '',
10 quid int(10) NOT NULL default '0',
11 question text NOT NULL,
12 q_format int(4) NOT NULL default '0',
13 answer text NOT NULL,
14 a_format int(4) NOT NULL default '0',
15 PRIMARY KEY (`nid`)
16 );");
17 db_query("CREATE TABLE {question_queue} (
18 qid int(10) NOT NULL default '0',
19 questioner varchar(50) NOT NULL default '',
20 quid int(10) NOT NULL default '0',
21 question text NOT NULL
22 );");
23 break;
24 }
25 }
26
27 function question_update_1() {
28 $items = array();
29 $items[] = update_sql("ALTER TABLE {question_node} ADD PRIMARY KEY (`nid`)");
30 $items[] = update_sql("ALTER TABLE {question_queue} ADD PRIMARY KEY (`qid`)");
31 return $items;
32 }
33
34 function question_uninstall() {
35 db_query('DROP TABLE {question_node}');
36 db_query('DROP TABLE {question_queue}');
37 variable_del('question_require_registered');
38 variable_del('question_thanks');
39 }
40 ?>

  ViewVC Help
Powered by ViewVC 1.1.2