| 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() { |
| 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, |
| 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, |