/[drupal]/contributions/modules/fb/fb_app.install
ViewVC logotype

Contents of /contributions/modules/fb/fb_app.install

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


Revision 1.12 - (show annotations) (download) (as text)
Thu Aug 6 23:47:26 2009 UTC (3 months, 3 weeks ago) by yogadex
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +2 -2 lines
File MIME type: text/x-php
#426334 by rjmackay, neilnz; fixes to schema api, postgres compatibility
1 <?php
2 /**
3 * @file
4 * Installs database tables and settings required by fb_app module.
5 *
6 */
7 // TODO: some of these tables should be created by othe module install files.
8
9 /**
10 * hook_install()
11 */
12 function fb_app_install() {
13 // Create tables.
14 drupal_install_schema('fb_app');
15
16 drupal_set_message(t('Facebook Application module installed. Please grant yourself <a href="!perm">permissions</a> and then browse to <a href="!create">Create Content => Facebook Application</a> to get started.', array('!perm' => url('admin/user/permissions'), '!create' => url('node/add/fb-app'))));
17 }
18
19 /**
20 * hook_uninstall()
21 */
22 function fb_app_uninstall() {
23 // Remove tables.
24 drupal_uninstall_schema('fb_app');
25 }
26
27 function fb_app_schema() {
28 $schema['fb_app'] = array(
29 'description' => 'Main FB_APP table',
30 'fields' => array(
31 'nid' => array('type' => 'int', 'length' => 11, 'unsigned' => TRUE, 'not null' => TRUE, ),
32 'label' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, ),
33 'apikey' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, ),
34 'id' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, ),
35 'secret' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, ),
36 'canvas' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, ),
37 'data' => array('type' => 'text', 'size' => 'big', ),
38 ),
39 'unique keys' => array(
40 'apikey' => array('apikey'),
41 ),
42 'primary key' => array('nid'),
43 );
44 $schema['fb_app_block'] = array(
45 'fields' => array(
46 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ),
47 'delta' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, ),
48 'format' => array('type' => 'int', 'default' => 0, ),
49 'body' => array('type' => 'text', 'size' => 'big', 'not null' => TRUE, ),
50 ),
51 'primary key' => array('nid', 'delta'),
52 );
53 $schema['fb_cache_filter'] = drupal_get_schema_unprocessed('system', 'cache');
54
55 return $schema;
56 }
57
58 function fb_app_update_6100() {
59 // Add id field
60 $ret = array();
61 db_add_field($ret, 'fb_app', 'id', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, ));
62 return $ret;
63 }
64
65 function fb_app_update_6101() {
66 $ret = array();
67 // The rid field is no longer used, and causes problems for databases in strict mode.
68 db_drop_field($ret, 'fb_app', 'rid');
69 // Other columns have been moved to fb_user.module, and are stored in data
70 db_drop_field($ret, 'fb_app', 'require_login');
71 db_drop_field($ret, 'fb_app', 'create_account');
72 db_drop_field($ret, 'fb_app', 'unique_account');
73 // canvas moved to fb_canvas.module
74 db_drop_field($ret, 'fb_app', 'canvas'); // BAD IDEA! see update 6202
75
76 return $ret;
77 }
78
79 function fb_app_update_6202() {
80 // canvas is too important, let's support it.
81 $ret = array();
82 db_add_field($ret, 'fb_app', 'canvas', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, ));
83 drupal_set_message(t('If any of your Facebook Applications support canvas pages, go to those applications, click edit and submit. This must be done manually. Sorry for the inconvenience.'));
84 return $ret;
85 }
86

  ViewVC Help
Powered by ViewVC 1.1.2