Commit af299c99 authored by JonBob's avatar JonBob

New install system

parent 1182d802
# $Id$
# content.module
CREATE TABLE node_type (
type_name varchar(32) NOT NULL default '',
label varchar(255) NOT NULL default '',
description mediumtext NOT NULL,
help mediumtext NOT NULL,
title_label varchar(255) NOT NULL default '',
PRIMARY KEY (type_name)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
CREATE TABLE node_field (
field_name varchar(32) NOT NULL default '',
type varchar(127) NOT NULL default '',
global_settings mediumtext NOT NULL,
required int NOT NULL default '0',
multiple int NOT NULL default '0',
PRIMARY KEY (field_name)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
CREATE TABLE node_field_instance (
field_name varchar(32) NOT NULL default '',
type_name varchar(32) NOT NULL default '',
weight int NOT NULL default '0',
label varchar(255) NOT NULL default '',
widget_type varchar(32) NOT NULL default '',
widget_settings mediumtext NOT NULL,
PRIMARY KEY (field_name,type_name)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
# text.module
CREATE TABLE node_field_longtext_data (
vid int unsigned NOT NULL default '0',
field_name varchar(32) NOT NULL default '',
delta int unsigned NOT NULL default '0',
field_longtext mediumtext NOT NULL,
format int NOT NULL default '0',
PRIMARY KEY (vid,field_name,delta)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
CREATE TABLE node_field_shorttext_data (
vid int unsigned NOT NULL default '0',
field_name varchar(32) NOT NULL default '',
delta int unsigned NOT NULL default '0',
field_shorttext varchar(255) NOT NULL default '',
format int NOT NULL default '0',
PRIMARY KEY (vid,field_name,delta)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
# number.module
CREATE TABLE node_field_float_data (
vid int unsigned NOT NULL default '0',
field_name varchar(32) NOT NULL default '',
delta int unsigned NOT NULL default '0',
field_float float NOT NULL default '0',
PRIMARY KEY (vid,field_name,delta)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
CREATE TABLE node_field_int_data (
vid int unsigned NOT NULL default '0',
field_name varchar(32) NOT NULL default '',
delta int unsigned NOT NULL default '0',
field_int int NOT NULL default '0',
PRIMARY KEY (vid,field_name,delta)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
# date.module
CREATE TABLE node_field_date_data (
vid int unsigned NOT NULL default '0',
field_name varchar(32) NOT NULL default '',
delta int unsigned NOT NULL default '0',
field_date char(17) NOT NULL default '00010101T00:00:00',
PRIMARY KEY (vid,field_name,delta)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
# nodereference.module
CREATE TABLE node_field_nodereference_data (
vid int unsigned NOT NULL default '0',
field_name varchar(32) NOT NULL default '',
delta int unsigned NOT NULL default '0',
field_nid int unsigned NOT NULL default '0',
PRIMARY KEY (vid,field_name,delta)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
# userreference.module
CREATE TABLE node_field_userreference_data (
vid int unsigned NOT NULL default '0',
field_name varchar(32) NOT NULL default '',
delta int unsigned NOT NULL default '0',
field_uid int unsigned NOT NULL default '0',
PRIMARY KEY (vid,field_name,delta)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
<?php
function content_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {node_type} (
type_name varchar(32) NOT NULL default '',
label varchar(255) NOT NULL default '',
description mediumtext NOT NULL,
help mediumtext NOT NULL,
title_label varchar(255) NOT NULL default '',
PRIMARY KEY (type_name)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
db_query("CREATE TABLE {node_field} (
field_name varchar(32) NOT NULL default '',
type varchar(127) NOT NULL default '',
global_settings mediumtext NOT NULL,
required int NOT NULL default '0',
multiple int NOT NULL default '0',
PRIMARY KEY (field_name)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
db_query("CREATE TABLE {node_field_instance} (
field_name varchar(32) NOT NULL default '',
type_name varchar(32) NOT NULL default '',
weight int NOT NULL default '0',
label varchar(255) NOT NULL default '',
widget_type varchar(32) NOT NULL default '',
widget_settings mediumtext NOT NULL,
PRIMARY KEY (field_name,type_name)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
db_query("CREATE TABLE {node_type} (
type_name varchar(32) NOT NULL default '',
label varchar(255) NOT NULL default '',
description text NOT NULL,
help text NOT NULL,
title_label varchar(255) NOT NULL default '',
PRIMARY KEY (type_name)
)");
db_query("CREATE TABLE {node_field} (
field_name varchar(32) NOT NULL default '',
type varchar(127) NOT NULL default '',
global_settings text NOT NULL,
required integer NOT NULL default '0',
multiple integer NOT NULL default '0',
PRIMARY KEY (field_name)
)");
db_query("CREATE TABLE {node_field_instance} (
field_name varchar(32) NOT NULL default '',
type_name varchar(32) NOT NULL default '',
weight integer NOT NULL default '0',
label varchar(255) NOT NULL default '',
widget_type varchar(32) NOT NULL default '',
widget_settings text NOT NULL,
PRIMARY KEY (field_name,type_name)
)");
break;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment