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

Contents of /contributions/modules/interact/interact.install

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


Revision 1.1 - (show annotations) (download) (as text)
Sun Sep 28 16:23:46 2008 UTC (14 months ago) by prarie
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
File MIME type: text/x-php
Initial commit of interaction centre. Allows users to interact within large trusted communities that is more personal.
1 <?php
2
3 // $Id: address.install 151 2007-07-05 14:56:30Z prarie $
4
5 function interact_install() {
6 db_query("
7 CREATE TABLE {interact_preference} (
8 uid INT(10) UNSIGNED NOT NULL,
9 email_pref TINYINT(1) NOT NULL,
10 new_nodes TINYINT(1) NOT NULL,
11 new_comments TINYINT(1) NOT NULL,
12 edit_nodes TINYINT(1) NOT NULL,
13 edit_comments TINYINT(1) NOT NULL,
14 edit_own_items TINYINT(1) NOT NULL,
15 new_posts_to_own TINYINT(1) NOT NULL,
16 PRIMARY KEY (uid)
17 ) /*!40100 DEFAULT CHARACTER SET UTF8 */
18 ");
19 db_query("
20 CREATE TABLE {interact_action} (
21 aid INT(10) UNSIGNED NOT NULL,
22 uid INT(10) UNSIGNED NOT NULL,
23 type VARCHAR(32),
24 id INT(10) UNSIGNED NOT NULL,
25 create_time INT(11) NOT NULL,
26 message TEXT NOT NULL,
27 teaser TEXT NOT NULL,
28 PRIMARY KEY (aid),
29 KEY (type),
30 KEY (uid),
31 KEY (create_time)
32 ) /*!40100 DEFAULT CHARACTER SET UTF8 */
33 ");
34 db_query("
35 CREATE TABLE {interact_notify} (
36 aid INT(10) UNSIGNED NOT NULL,
37 type VARCHAR(32),
38 sub_type VARCHAR(32),
39 id INT(10) UNSIGNED NOT NULL,
40 PRIMARY KEY (aid, type, sub_type)
41 ) /*!40100 DEFAULT CHARACTER SET UTF8 */
42 ");
43 db_query("
44 CREATE TABLE {interact_notification} (
45 uid INT(10) UNSIGNED NOT NULL,
46 aid INT(10) UNSIGNED NOT NULL,
47 notify_aid INT(10) UNSIGNED NOT NULL,
48 status TINYINT(1) NOT NULL,
49 PRIMARY KEY (uid, aid)
50 ) /*!40100 DEFAULT CHARACTER SET UTF8 */
51 ");
52 db_query("
53 CREATE TABLE {interact_public_message} (
54 mid INT(10) UNSIGNED NOT NULL,
55 from_uid INT(10) UNSIGNED NOT NULL,
56 to_uid INT(10) UNSIGNED NOT NULL,
57 create_time INT(11) NOT NULL,
58 message TEXT NOT NULL,
59 PRIMARY KEY (mid),
60 KEY (to_uid, from_uid, mid)
61 ) /*!40100 DEFAULT CHARACTER SET UTF8 */
62 ");
63 db_query("UPDATE {system} SET weight = 99999 WHERE name = 'interact'");
64 drupal_set_message(t('Created interaction centre table schema.'));
65 }
66
67 function interact_uninstall() {
68 db_query("
69 DROP TABLE {interact_preference}
70 ");
71 db_query("
72 DROP TABLE {interact_action}
73 ");
74 db_query("
75 DROP TABLE {interact_notify}
76 ");
77 db_query("
78 DROP TABLE {interact_notification}
79 ");
80 db_query("
81 DROP TABLE {interact_public_message}
82 ");
83 }
84
85 ?>

  ViewVC Help
Powered by ViewVC 1.1.2