egroupware_official/doc/create_tables.mysql

187 lines
5.0 KiB
SQL
Executable File

# $Id$
CREATE TABLE applications (
app_name varchar(25) NOT NULL,
app_title varchar(50),
app_enabled int,
UNIQUE app_name (app_name)
);
insert into applications (app_name, app_title, app_enabled) values ('admin', 'Administration', 1);
insert into applications (app_name, app_title, app_enabled) values ('filemanager', 'File manager', 1);
insert into applications (app_name, app_title, app_enabled) values ('addressbook', 'Address Book', 1);
insert into applications (app_name, app_title, app_enabled) values ('todo', 'ToDo List', 1);
insert into applications (app_name, app_title, app_enabled) values ('calendar', 'Calendar', 1);
insert into applications (app_name, app_title, app_enabled) values ('email', 'Email', 1);
insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1);
insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0);
CREATE TABLE accounts (
con int(11) DEFAULT '0' NOT NULL auto_increment,
loginid varchar(25) NOT NULL,
passwd varchar(32) NOT NULL,
firstname varchar(50),
lastname varchar(50),
permissions text,
groups varchar(30),
lastlogin int(11),
lastloginfrom varchar(255),
lastpasswd_change int(11),
status enum('A','L') DEFAULT 'A' NOT NULL,
PRIMARY KEY (con),
UNIQUE loginid (loginid)
);
insert into accounts (loginid,passwd,firstname,lastname,permissions,groups,
status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account',
':admin:email:todo:addressbook:calendar:hr:',',1,','A');
create table groups (
group_id int NOT NULL auto_increment,
group_name varchar(255),
group_apps varchar(255),
primary key(group_id)
);
insert into groups (group_name) values ('Default');
CREATE TABLE preferences (
owner varchar(20),
name varchar(50),
value varchar(50)
);
insert into preferences values ('demo','maxmatchs','10');
insert into preferences values ('demo','mainscreen_showbirthdays','True');
insert into preferences values ('demo','mainscreen_showevents','True');
insert into preferences values ('demo','timeformat','12');
insert into preferences values ('demo','dateformat','m/d/Y');
insert into preferences values ('demo','theme','default');
insert into preferences values ('demo','tz_offset','0');
CREATE TABLE sessions (
sessionid varchar(255) NOT NULL,
loginid varchar(20),
passwd varchar(255),
ip varchar(255),
logintime int(11),
dla int(11),
UNIQUE sessionid (sessionid)
);
CREATE TABLE app_sessions (
sessionid varchar(255) NOT NULL,
loginid varchar(20),
app varchar(20),
content text
);
create table access_log (
sessionid varchar(30),
loginid varchar(30),
ip varchar(30),
li int,
lo int
);
CREATE TABLE profiles (
con int(11) DEFAULT '0' NOT NULL auto_increment,
owner varchar(20),
title varchar(255),
phone_number varchar(255),
comments text,
picture_format varchar(255),
picture blob,
PRIMARY KEY (con)
);
CREATE TABLE addressbook (
con int(11) DEFAULT '0' NOT NULL auto_increment,
owner varchar(25),
access varchar(10),
firstname varchar(255),
lastname varchar(255),
email varchar(255),
hphone varchar(255),
wphone varchar(255),
fax varchar(255),
pager varchar(255),
mphone varchar(255),
ophone varchar(255),
street varchar(255),
city varchar(255),
state varchar(255),
zip varchar(255),
bday varchar(255),
notes text,
company varchar(255),
PRIMARY KEY (con)
);
CREATE TABLE todo (
con int(11) DEFAULT '0' NOT NULL auto_increment,
owner varchar(25),
access varchar(10),
des text,
pri int(11),
status int(11),
datecreated int(11),
datedue int(11),
PRIMARY KEY (con)
);
CREATE TABLE webcal_entry (
cal_id int(11) DEFAULT '0' NOT NULL auto_increment,
cal_group_id int(11),
cal_create_by varchar(25) NOT NULL,
cal_date int(11) DEFAULT '0' NOT NULL,
cal_time int(11),
cal_mod_date int(11),
cal_mod_time int(11),
cal_duration int(11) DEFAULT '0' NOT NULL,
cal_priority int(11) DEFAULT '2',
cal_type varchar(10),
cal_access char(10),
cal_name varchar(80) NOT NULL,
cal_description text,
PRIMARY KEY (cal_id)
);
CREATE TABLE webcal_entry_repeats (
cal_id int(11) DEFAULT '0' NOT NULL,
cal_type enum('daily','weekly','monthlyByDay','monthlyByDate','yearly') DEFAULT 'daily' NOT NULL,
cal_end int(11),
cal_frequency int(11) DEFAULT '1',
cal_days char(7)
);
CREATE TABLE webcal_entry_user (
cal_id int(11) DEFAULT '0' NOT NULL,
cal_login varchar(25) NOT NULL,
cal_status char(1) DEFAULT 'A',
PRIMARY KEY (cal_id, cal_login)
);
create table webcal_entry_groups (
cal_id int,
groups varchar(255)
);
CREATE TABLE newsgroups (
con int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL,
messagecount int(11) NOT NULL,
lastmessage int(11) NOT NULL,
active char DEFAULT 'N' NOT NULL,
lastread int(11),
PRIMARY KEY (con),
UNIQUE name (name)
);
CREATE TABLE users_newsgroups (
owner int(11) NOT NULL,
newsgroup int(11) NOT NULL
);