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

Diff of /contributions/modules/attachment/attachment.install

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

revision 1.3, Tue Jul 17 19:50:04 2007 UTC revision 1.4, Sat Dec 1 00:43:12 2007 UTC
# Line 10  function attachment_update_1() { Line 10  function attachment_update_1() {
10  }  }
11    
12  /**  /**
13     * Add weight column to database table
14     */
15    function attachment_update_2() {
16      $ret = array();
17      switch ($GLOBALS['db_type']) {
18        case 'mysql':
19        case 'mysqli':
20            $ret[] = update_sql("ALTER TABLE {attachment} ADD COLUMN weight int(10) NOT NULL default 0;");
21          break;
22        case 'pgsql':
23            $ret[] = update_sql("alter table {attachment} add column weight integer not null;");
24          break;
25      }
26      return $ret;
27    }
28    
29    /**
30   * Install the initial schema.   * Install the initial schema.
31   */   */
32  function attachment_install() {  function attachment_install() {
# Line 23  function attachment_install() { Line 40  function attachment_install() {
40              aid int(10) unsigned NOT NULL,              aid int(10) unsigned NOT NULL,
41              nid int(10) unsigned NOT NULL,              nid int(10) unsigned NOT NULL,
42              fid int(10) unsigned NOT NULL,              fid int(10) unsigned NOT NULL,
43                weight int(10) NOT NULL default 0,
44              filename varchar(255) NOT NULL,              filename varchar(255) NOT NULL,
45              title varchar(255) NOT NULL,              title varchar(255) NOT NULL,
46              description varchar(255) NOT NULL,              description varchar(255) NOT NULL,
# Line 41  MYSQL_UPDATE Line 59  MYSQL_UPDATE
59            aid serial primary key,            aid serial primary key,
60            nid integer not null,            nid integer not null,
61            fid integer not null,            fid integer not null,
62              weight integer not null,
63            filename varchar(255) not null,            filename varchar(255) not null,
64            title varchar(255) not null,            title varchar(255) not null,
65            description varchar(255) not null,            description varchar(255) not null,

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.2