2000-11-02 10:01:06 +01:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
2000-11-05 07:47:24 +01:00
|
|
|
* phpGroupWare - Setup *
|
2000-11-02 10:01:06 +01:00
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
// NOTE: Please use spaces to seperate the field names. It makes copy and pasting easier.
|
|
|
|
|
2001-02-08 20:34:14 +01:00
|
|
|
$sql = "CREATE TABLE phpgw_config (
|
2001-05-02 10:00:33 +02:00
|
|
|
config_app varchar(50),
|
2000-12-14 07:38:47 +01:00
|
|
|
config_name varchar(255) NOT NULL UNIQUE,
|
|
|
|
config_value varchar(100) NOT NULL
|
2000-11-02 10:01:06 +01:00
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-02-08 21:11:13 +01:00
|
|
|
$sql = "create table phpgw_applications (
|
2000-11-02 10:01:06 +01:00
|
|
|
app_name varchar(25) NOT NULL,
|
|
|
|
app_title varchar(50),
|
|
|
|
app_enabled int,
|
|
|
|
app_order int,
|
|
|
|
app_tables varchar(255),
|
|
|
|
app_version varchar(20) NOT NULL default '0.0',
|
|
|
|
unique(app_name)
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
|
|
|
|
2001-02-10 05:50:21 +01:00
|
|
|
$sql = "create table phpgw_accounts (
|
2000-11-02 10:01:06 +01:00
|
|
|
account_id serial,
|
|
|
|
account_lid varchar(25) NOT NULL,
|
|
|
|
account_pwd char(32) NOT NULL,
|
|
|
|
account_firstname varchar(50),
|
|
|
|
account_lastname varchar(50),
|
2001-02-05 16:46:35 +01:00
|
|
|
account_lastlogin int,
|
2000-11-02 10:01:06 +01:00
|
|
|
account_lastloginfrom varchar(255),
|
|
|
|
account_lastpwd_change int,
|
|
|
|
account_status char(1),
|
2001-02-06 00:10:06 +01:00
|
|
|
account_type char(1),
|
2000-11-02 10:01:06 +01:00
|
|
|
unique(account_lid)
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-02-10 05:50:21 +01:00
|
|
|
$sql = "create table phpgw_preferences (
|
|
|
|
preference_owner int,
|
|
|
|
preference_value text
|
2000-11-02 10:01:06 +01:00
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2001-02-10 05:50:21 +01:00
|
|
|
|
2000-11-25 09:32:59 +01:00
|
|
|
$sql = "create table phpgw_sessions (
|
2000-11-02 10:01:06 +01:00
|
|
|
session_id varchar(255),
|
2000-11-21 05:49:40 +01:00
|
|
|
session_lid varchar(255),
|
2000-11-02 10:01:06 +01:00
|
|
|
session_ip varchar(255),
|
2000-12-14 09:02:08 +01:00
|
|
|
session_logintime int,
|
2000-11-02 10:01:06 +01:00
|
|
|
session_dla int,
|
2001-02-10 16:14:14 +01:00
|
|
|
session_action varchar(255),
|
2001-02-28 16:58:26 +01:00
|
|
|
session_flags char(2),
|
2000-11-02 10:01:06 +01:00
|
|
|
unique(session_id)
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2000-11-25 09:32:59 +01:00
|
|
|
$sql = "CREATE TABLE phpgw_acl (
|
|
|
|
acl_appname varchar(50),
|
|
|
|
acl_location varchar(255),
|
|
|
|
acl_account int,
|
|
|
|
acl_rights int
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-25 09:32:59 +01:00
|
|
|
|
|
|
|
$sql = "CREATE TABLE phpgw_app_sessions (
|
2001-02-08 05:42:44 +01:00
|
|
|
sessionid varchar(255) NOT NULL,
|
|
|
|
loginid varchar(20),
|
|
|
|
location varchar(255),
|
|
|
|
app varchar(20),
|
2001-03-31 10:11:41 +02:00
|
|
|
content text,
|
|
|
|
session_dla int
|
2000-11-02 10:01:06 +01:00
|
|
|
)";
|
2001-02-08 05:42:44 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2000-11-25 09:32:59 +01:00
|
|
|
$sql = "create table phpgw_access_log (
|
2000-11-02 10:01:06 +01:00
|
|
|
sessionid varchar(255),
|
|
|
|
loginid varchar(30),
|
|
|
|
ip varchar(30),
|
|
|
|
li int,
|
|
|
|
lo varchar(255)
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-03-27 01:40:02 +02:00
|
|
|
// Note: This table will be removed durring 0.9.11
|
2000-11-02 10:01:06 +01:00
|
|
|
$sql = "CREATE TABLE profiles (
|
|
|
|
con serial,
|
|
|
|
owner varchar(20),
|
|
|
|
title varchar(255),
|
|
|
|
phone_number varchar(255),
|
|
|
|
comments text,
|
|
|
|
picture_format varchar(255),
|
|
|
|
picture text
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-03-16 03:02:04 +01:00
|
|
|
$sql = "CREATE TABLE phpgw_addressbook(
|
2001-03-16 02:41:39 +01:00
|
|
|
id serial,
|
2001-03-16 02:33:15 +01:00
|
|
|
lid varchar(32),
|
2001-03-16 03:02:04 +01:00
|
|
|
tid varchar(1),
|
|
|
|
owner int,
|
2001-03-24 09:33:55 +01:00
|
|
|
access char(7),
|
2001-03-25 07:39:03 +02:00
|
|
|
cat_id varchar(32),
|
2001-03-16 02:33:15 +01:00
|
|
|
fn varchar(64),
|
|
|
|
n_family varchar(64),
|
|
|
|
n_given varchar(64),
|
|
|
|
n_middle varchar(64),
|
|
|
|
n_prefix varchar(64),
|
|
|
|
n_suffix varchar(64),
|
|
|
|
sound varchar(64),
|
|
|
|
bday varchar(32),
|
|
|
|
note text,
|
|
|
|
tz varchar(8),
|
|
|
|
geo varchar(32),
|
|
|
|
url varchar(128),
|
|
|
|
pubkey text,
|
|
|
|
org_name varchar(64),
|
|
|
|
org_unit varchar(64),
|
|
|
|
title varchar(64),
|
|
|
|
adr_one_street varchar(64),
|
2001-03-21 05:06:20 +01:00
|
|
|
adr_one_locality varchar(64),
|
|
|
|
adr_one_region varchar(64),
|
|
|
|
adr_one_postalcode varchar(64),
|
|
|
|
adr_one_countryname varchar(64),
|
|
|
|
adr_one_type varchar(32),
|
2001-03-16 02:33:15 +01:00
|
|
|
label text,
|
|
|
|
adr_two_street varchar(64),
|
2001-03-21 05:06:20 +01:00
|
|
|
adr_two_locality varchar(64),
|
|
|
|
adr_two_region varchar(64),
|
|
|
|
adr_two_postalcode varchar(64),
|
|
|
|
adr_two_countryname varchar(64),
|
|
|
|
adr_two_type varchar(32),
|
2001-03-16 02:33:15 +01:00
|
|
|
tel_work varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_home varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_voice varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_fax varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_msg varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_cell varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_pager varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_bbs varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_modem varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_car varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_isdn varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_video varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL,
|
|
|
|
tel_prefer varchar(32),
|
|
|
|
email varchar(64),
|
|
|
|
email_type varchar(32) DEFAULT 'INTERNET',
|
|
|
|
email_home varchar(64),
|
2001-03-16 04:06:43 +01:00
|
|
|
email_home_type varchar(32) DEFAULT 'INTERNET',
|
2001-03-16 04:09:18 +01:00
|
|
|
primary key (id)
|
2001-03-16 02:33:15 +01:00
|
|
|
)";
|
2001-02-25 07:04:31 +01:00
|
|
|
|
|
|
|
$phpgw_setup->db->query($sql);
|
|
|
|
|
|
|
|
$sql = "CREATE TABLE phpgw_addressbook_extra (
|
|
|
|
contact_id int,
|
|
|
|
contact_owner int,
|
|
|
|
contact_name varchar(255),
|
2001-02-27 01:28:56 +01:00
|
|
|
contact_value text
|
2001-02-25 07:04:31 +01:00
|
|
|
)";
|
|
|
|
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-03-27 01:40:02 +02:00
|
|
|
$sql = "create table phpgw_todo (
|
2000-11-02 10:01:06 +01:00
|
|
|
todo_id serial,
|
|
|
|
todo_id_parent int,
|
|
|
|
todo_owner varchar(25),
|
|
|
|
todo_access varchar(10),
|
2001-04-03 04:34:37 +02:00
|
|
|
todo_cat int,
|
2000-11-02 10:01:06 +01:00
|
|
|
todo_des text,
|
|
|
|
todo_pri int,
|
|
|
|
todo_status int,
|
|
|
|
todo_datecreated int,
|
2000-11-19 20:47:30 +01:00
|
|
|
todo_startdate int,
|
|
|
|
todo_enddate int
|
2000-11-02 10:01:06 +01:00
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-04-27 04:20:55 +02:00
|
|
|
$sql = "CREATE TABLE phpgw_cal (
|
2001-04-27 19:37:59 +02:00
|
|
|
cal_id serial,
|
2001-04-27 04:29:42 +02:00
|
|
|
owner int DEFAULT 0 NOT NULL,
|
|
|
|
category int DEFAULT 0 NOT NULL,
|
2001-04-27 04:20:55 +02:00
|
|
|
groups varchar(255),
|
|
|
|
datetime int4,
|
|
|
|
mdatetime int4,
|
|
|
|
edatetime int4,
|
|
|
|
priority int DEFAULT 2 NOT NULL,
|
2001-04-27 19:37:59 +02:00
|
|
|
cal_type varchar(10),
|
2001-04-27 04:47:54 +02:00
|
|
|
is_public int DEFAULT 1 NOT NULL,
|
2001-04-27 04:20:55 +02:00
|
|
|
title varchar(80) NOT NULL,
|
|
|
|
desription text
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-04-27 04:20:55 +02:00
|
|
|
$sql = "CREATE TABLE phpgw_cal_user (
|
2001-04-27 19:37:59 +02:00
|
|
|
cal_id int DEFAULT 0 NOT NULL,
|
|
|
|
cal_login int DEFAULT 0 NOT NULL,
|
|
|
|
cal_status char(1) DEFAULT 'A'
|
2001-04-27 04:20:55 +02:00
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-04-27 04:20:55 +02:00
|
|
|
$sql = "CREATE TABLE phpgw_cal_repeats (
|
2001-04-27 19:37:59 +02:00
|
|
|
cal_id int DEFAULT 0 NOT NULL,
|
2001-04-27 04:20:55 +02:00
|
|
|
recur_type int DEFAULT 0 NOT NULL,
|
|
|
|
recur_use_end int DEFAULT 0,
|
|
|
|
recur_enddate int4 DEFAULT 0,
|
|
|
|
recur_interval int DEFAULT 1,
|
|
|
|
recur_data int
|
2000-11-02 10:01:06 +01:00
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-04-30 05:04:02 +02:00
|
|
|
$sql = "CREATE TABLE phpgw_cal_holidays (
|
|
|
|
locale char(2) NOT NULL,
|
|
|
|
name varchar(50) NOT NULL,
|
|
|
|
date_time int4 DEFAULT 0 NOT NULL,
|
|
|
|
PRIMARY KEY (locale,name)
|
|
|
|
)";
|
|
|
|
$phpgw_setup->db->query($sql);
|
|
|
|
|
2000-11-02 10:01:06 +01:00
|
|
|
$sql = "CREATE TABLE newsgroups (
|
|
|
|
con serial,
|
|
|
|
name varchar(255) NOT NULL,
|
|
|
|
messagecount int,
|
|
|
|
lastmessage int,
|
|
|
|
active char DEFAULT 'N' NOT NULL,
|
|
|
|
lastread int
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2000-11-13 02:36:53 +01:00
|
|
|
$sql = "CREATE TABLE news_msg (
|
2000-11-13 09:44:43 +01:00
|
|
|
con serial,
|
|
|
|
msg int NOT NULL,
|
|
|
|
uid varchar(255) DEFAULT '',
|
|
|
|
udate int DEFAULT 0,
|
|
|
|
path varchar(255) DEFAULT '',
|
|
|
|
fromadd varchar(255) DEFAULT '',
|
|
|
|
toadd varchar(255) DEFAULT '',
|
|
|
|
ccadd varchar(255) DEFAULT '',
|
|
|
|
bccadd varchar(255) DEFAULT '',
|
|
|
|
reply_to varchar(255) DEFAULT '',
|
|
|
|
sender varchar(255) DEFAULT '',
|
|
|
|
return_path varchar(255) DEFAULT '',
|
|
|
|
subject varchar(255) DEFAULT '',
|
|
|
|
message_id varchar(255) DEFAULT '',
|
|
|
|
reference varchar(255) DEFAULT '',
|
|
|
|
in_reply_to varchar(255) DEFAULT '',
|
|
|
|
follow_up_to varchar(255) DEFAULT '',
|
|
|
|
nntp_posting_host varchar(255) DEFAULT '',
|
|
|
|
nntp_posting_date varchar(255) DEFAULT '',
|
|
|
|
x_complaints_to varchar(255) DEFAULT '',
|
|
|
|
x_trace varchar(255) DEFAULT '',
|
|
|
|
x_abuse_info varchar(255) DEFAULT '',
|
|
|
|
x_mailer varchar(255) DEFAULT '',
|
|
|
|
organization varchar(255) DEFAULT '',
|
|
|
|
content_type varchar(255) DEFAULT '',
|
|
|
|
content_description varchar(255) DEFAULT '',
|
|
|
|
content_transfer_encoding varchar(255) DEFAULT '',
|
|
|
|
mime_version varchar(255) DEFAULT '',
|
|
|
|
msgsize int DEFAULT 0,
|
|
|
|
msglines int DEFAULT 0,
|
|
|
|
body text NOT NULL
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-13 02:36:53 +01:00
|
|
|
|
2000-11-13 09:44:43 +01:00
|
|
|
|
2000-11-02 10:01:06 +01:00
|
|
|
$sql = "CREATE TABLE lang (
|
|
|
|
message_id varchar(150) DEFAULT '' NOT NULL,
|
|
|
|
app_name varchar(100) DEFAULT 'common' NOT NULL,
|
|
|
|
lang varchar(5) DEFAULT '' NOT NULL,
|
|
|
|
content text NOT NULL,
|
|
|
|
unique(message_id,app_name,lang)
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2001-01-08 16:01:37 +01:00
|
|
|
|
|
|
|
$sql = "CREATE TABLE phpgw_categories (
|
|
|
|
cat_id serial,
|
2001-04-27 18:02:59 +02:00
|
|
|
cat_main int,
|
|
|
|
cat_parent int DEFAULT 0,
|
|
|
|
cat_level int DEFAULT 0,
|
2001-01-08 16:01:37 +01:00
|
|
|
cat_owner int,
|
2001-03-27 14:20:39 +02:00
|
|
|
cat_access char(7),
|
2001-01-08 16:01:37 +01:00
|
|
|
cat_appname varchar(50) NOT NULL,
|
|
|
|
cat_name varchar(150) NOT NULL,
|
|
|
|
cat_description varchar(255) NOT NULL,
|
|
|
|
cat_data text
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2001-01-08 16:01:37 +01:00
|
|
|
|
2000-11-03 22:49:55 +01:00
|
|
|
|
|
|
|
$sql = "CREATE TABLE languages (
|
|
|
|
lang_id varchar(2) NOT NULL,
|
|
|
|
lang_name varchar(50) NOT NULL,
|
|
|
|
available varchar(3) NOT NULL DEFAULT 'No'
|
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-03 22:49:55 +01:00
|
|
|
|
2001-02-22 17:23:00 +01:00
|
|
|
$sql = "CREATE TABLE phpgw_notes (
|
2001-04-25 02:45:50 +02:00
|
|
|
note_id serial,
|
|
|
|
note_owner int,
|
|
|
|
note_access char(7),
|
|
|
|
note_date int,
|
|
|
|
note_category int,
|
|
|
|
note_content text
|
2000-11-18 02:11:48 +01:00
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-11-02 10:01:06 +01:00
|
|
|
|
2000-12-18 02:44:42 +01:00
|
|
|
$sql = "create table phpgw_hooks (
|
|
|
|
hook_id serial,
|
|
|
|
hook_appname varchar(255),
|
|
|
|
hook_location varchar(255),
|
|
|
|
hook_filename varchar(255)
|
2001-03-17 06:13:40 +01:00
|
|
|
)";
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->db->query($sql);
|
2000-12-18 02:44:42 +01:00
|
|
|
|
2001-03-22 09:23:35 +01:00
|
|
|
$sql = "create table phpgw_nextid (
|
|
|
|
appname varchar(25),
|
|
|
|
id int
|
|
|
|
)";
|
|
|
|
$phpgw_setup->db->query($sql);
|
|
|
|
|
2001-05-02 10:00:33 +02:00
|
|
|
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.005';
|
2001-02-13 20:30:18 +01:00
|
|
|
$phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi'];
|
2000-11-02 10:26:23 +01:00
|
|
|
update_version_table();
|
2001-02-27 01:28:56 +01:00
|
|
|
?>
|