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

Contents of /contributions/modules/bookmarks2/bookmarks2.install

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


Revision 1.4 - (show annotations) (download) (as text)
Sun Jul 27 19:36:41 2008 UTC (15 months, 4 weeks ago) by sanduhrs
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.3: +5 -1 lines
File MIME type: text/x-php
Port to d6
1 <?php
2 // $Id: bookmarks2.install,v 1.3 2007/12/21 11:59:10 sanduhrs Exp $
3
4 /**
5 * Bookmarks2
6 */
7
8 /**
9 * Implementation of hook_install()
10 */
11 function bookmarks2_install() {
12 switch ($GLOBALS['db_type']) {
13 case 'mysql':
14 case 'mysqli':
15 db_query("CREATE TABLE {bookmarks2} (
16 uid int(10) unsigned NOT NULL,
17 url varchar(128) NOT NULL,
18 title varchar(128) NOT NULL,
19 description text,
20 fid mediumint(9) unsigned NOT NULL,
21 uname varchar(80) default NULL,
22 pword varbinary(255) default NULL,
23 options tinyint(3) unsigned NOT NULL default '0',
24 KEY uid (uid),
25 KEY fid (fid))");
26
27 db_query("CREATE TABLE {bookmarks2_folders} (
28 fid mediumint(8) unsigned NOT NULL auto_increment,
29 f_parent_id mediumint(8) unsigned NOT NULL default '0',
30 uid int(10) unsigned NOT NULL default '0',
31 fname varchar(128) NOT NULL,
32 options tinyint(3) unsigned NOT NULL default '0',
33 PRIMARY KEY (fid),
34 KEY uid (uid),
35 KEY f_parent_id (f_parent_id))");
36
37 db_query("CREATE TABLE {bookmarks2_prefs} (
38 uid int(10) unsigned NOT NULL,
39 options tinyint(3) unsigned NOT NULL default '0',
40 pword_key varbinary(100) NULL DEFAULT NULL,
41 PRIMARY KEY (uid))");
42 }
43 }
44
45 /**
46 * Implementation of hook_uninstall()
47 */
48 function bookmarks2_uninstall() {
49 db_query('DROP TABLE {bookmarks2}');
50 db_query('DROP TABLE {bookmarks2_folders}');
51 db_query('DROP TABLE {bookmarks2_prefs}');
52
53 variable_del('bookmarks2_login_reminder_enabled');
54 variable_del('bookmarks2_link_crop_size');
55 }
56
57 function bookmarks2_update_1() {
58 $ret = array();
59 switch ($GLOBALS['db_type']) {
60 case 'mysql':
61 case 'mysqli':
62 $ret[] = update_sql("ALTER TABLE {bookmarks2_prefs} CHANGE pword_hash pword_key VARBINARY(100) NULL DEFAULT NULL");
63 }
64 return $ret;
65 }

  ViewVC Help
Powered by ViewVC 1.1.2