link.install 1.2 KB
Newer Older
Nathan Haug's avatar
Nathan Haug committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// $Id$

/**
 * Implementation of hook_install().
 */
function link_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {node_field_link_data} (
          nid int unsigned NOT NULL default '0',
          vid int unsigned NOT NULL default '0',
          field_name varchar(32) NOT NULL default '',
          delta int unsigned NOT NULL default '0',
          field_url varchar(255) NOT NULL default '',
          field_title varchar(255) NOT NULL default '',
          attributes text NOT NULL default '',
          PRIMARY KEY  (vid,field_name,delta)
        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;

    case 'pgsql':
      db_query("CREATE TABLE {node_field_link_data} (
25
26
          nid integer NOT NULL default '0' CHECK (nid >= 0),
          vid integer NOT NULL default '0' CHECK (nid >= 0),
Nathan Haug's avatar
Nathan Haug committed
27
          field_name varchar(32) NOT NULL default '',
28
          delta integer NOT NULL default '0' CHECK (nid >= 0),
Nathan Haug's avatar
Nathan Haug committed
29
30
31
32
33
34
35
36
          field_url varchar(255) NOT NULL default '',
          field_title varchar(255) NOT NULL default '',
          attributes text NOT NULL default '',
          PRIMARY KEY  (vid,field_name,delta)
        )");
      break;
  }
}