This commit is contained in:
Rodolphe Quiedeville 2002-04-29 20:57:25 +00:00
parent 6d7b84146c
commit 8a38142a02
25 changed files with 729 additions and 0 deletions

58
mysql/tables/Makefile Normal file
View File

@ -0,0 +1,58 @@
#
# Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
#
# $Id$
# $Source$
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
MYSQL=mysql -f
BASE=dolibarr
all: show
create:
$(MYSQL) $(BASE) < actioncomm.sql
$(MYSQL) $(BASE) < c_actioncomm.sql
$(MYSQL) $(BASE) < c_effectif.sql
$(MYSQL) $(BASE) < c_paiement.sql
$(MYSQL) $(BASE) < c_pays.sql
$(MYSQL) $(BASE) < c_prestatype.sql
$(MYSQL) $(BASE) < c_propalst.sql
$(MYSQL) $(BASE) < c_stcomm.sql
$(MYSQL) $(BASE) < c_typent.sql
$(MYSQL) $(BASE) < llx_bank.sql
$(MYSQL) $(BASE) < llx_bank_account.sql
$(MYSQL) $(BASE) < llx_bank_categ.sql
$(MYSQL) $(BASE) < llx_bank_class.sql
$(MYSQL) $(BASE) < llx_bookmark.sql
$(MYSQL) $(BASE) < llx_fa_pr.sql
$(MYSQL) $(BASE) < llx_facture.sql
$(MYSQL) $(BASE) < llx_paiement.sql
$(MYSQL) $(BASE) < llx_pointmort.sql
$(MYSQL) $(BASE) < llx_product.sql
$(MYSQL) $(BASE) < llx_propal.sql
$(MYSQL) $(BASE) < llx_propaldet.sql
$(MYSQL) $(BASE) < llx_soc_recontact.sql
$(MYSQL) $(BASE) < llx_user.sql
$(MYSQL) $(BASE) < llx_ventes.sql
$(MYSQL) $(BASE) < societe.sql
$(MYSQL) $(BASE) < socpeople.sql
drop:
$(MYSQL) $(BASE) < drop.sql
show:
$(MYSQL) $(BASE) -e 'show tables'

View File

@ -0,0 +1,22 @@
-- ========================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
--
-- Actions commerciales
--
-- ========================================================================
create table actioncomm
(
id integer AUTO_INCREMENT PRIMARY KEY,
datea datetime, -- action date
fk_action integer,
fk_soc integer,
author varchar(30),
fk_user_author integer,
fk_contact integer,
note text,
propalrowid integer
);

View File

@ -0,0 +1,10 @@
-- ========================================================================
-- $Id$
-- $Source$
-- ========================================================================
create table c_actioncomm
(
id integer PRIMARY KEY,
libelle varchar(30)
);

View File

@ -0,0 +1,11 @@
-- ========================================================================
-- $Id$
-- $Source$
-- ========================================================================
create table c_effectif
(
id integer PRIMARY KEY,
libelle varchar(30)
);

View File

@ -0,0 +1,12 @@
-- ========================================================================
-- $Id$
-- $Source$
-- ========================================================================
create table c_paiement
(
id integer PRIMARY KEY,
libelle varchar(30)
);

213
mysql/tables/drop.sql Normal file
View File

@ -0,0 +1,213 @@
--
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
drop table if exists abo_can;
drop table if exists abo_soc;
drop table if exists actioncomm;
drop table if exists bots;
drop table if exists c_anexpe;
drop table if exists c_actioncomm;
drop table if exists c_categtools;
drop table if exists c_contrat ;
drop table if exists c_contrib;
drop table if exists c_diplome ;
drop table if exists c_duree;
drop table if exists c_effectif;
drop table if exists c_formatdoc;
drop table if exists c_lang ;
drop table if exists c_niveau ;
drop table if exists c_nivlang ;
drop table if exists c_outil ;
drop table if exists c_modecontact;
drop table if exists c_moderech ;
drop table if exists c_paiement ;
drop table if exists c_pays ;
drop table if exists c_poste ;
drop table if exists c_prestatype ;
drop table if exists c_propalst ;
drop table if exists c_quality;
drop table if exists c_region ;
drop table if exists c_secteur ;
drop table if exists c_sex;
drop table if exists c_situation ;
drop table if exists c_stage_type;
drop table if exists c_stcomm;
drop table if exists c_typent ;
drop table if exists c_skilltype ;
drop table if exists candidat;
drop table if exists communique;
drop table if exists diplome ;
drop table if exists expe;
drop table if exists followbots;
drop table if exists indy;
drop table if exists known;
drop table if exists lang ;
drop table if exists langoffre ;
drop table if exists llx_bank;
drop table if exists llx_bank_categ;
drop table if exists llx_bank_class;
drop table if exists llx_bookmark;
drop table if exists llx_fa_pr;
drop table if exists llx_facture;
drop table if exists llx_paiement;
drop table if exists llx_pointmort;
drop table if exists llx_product;
drop table if exists llx_propal;
drop table if exists llx_propaldet;
drop table if exists llx_soc_recontact;
drop table if exists llx_ventes;
drop table if exists login ;
drop table if exists of_statutlog;
drop table if exists offre;
drop table if exists outil ;
drop table if exists outiloffre;
drop table if exists poste_resume ;
drop table if exists typent_resume ;
drop table if exists rech_cand;
drop table if exists rech_soc;
drop table if exists rescontact;
drop table if exists rescontactinfo;
drop table if exists resmessage;
drop table if exists res_appoint;
drop table if exists res_statutlog;
drop table if exists secteur_resume ;
drop table if exists socappoint ;
drop table if exists soccontact;
drop table if exists soccontactinfo;
drop table if exists socfollowresume;
drop table if exists socstatutlog ;
drop table if exists region_resume ;
drop table if exists societe;
drop table if exists soc_events;
drop table if exists soc_recontact;
drop table if exists socpeople;
drop table if exists soc_ssii;
drop table if exists soc_rescontact_byweek;
drop table if exists soc_resviewed_byweek;
drop table if exists socmessage ;
drop table if exists somenews;
drop table if exists stat_base ;
drop table if exists stat_abo ;
drop table if exists stat_cat;
drop table if exists stat_subs;
drop table if exists statcv ;
drop table if exists statcv_day;
drop table if exists statof ;
drop table if exists statof_day;
drop table if exists tchcontrib;
drop table if exists tchcorres;
drop table if exists tchsociete;
drop table if exists savannah_projects;

21
mysql/tables/llx_bank.sql Normal file
View File

@ -0,0 +1,21 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_bank
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
datev date, -- date de valeur
dateo date, -- date operation
amount real NOT NULL default 0,
label varchar(255),
author varchar(50),
fk_type smallint, -- CB, Virement, cheque
num_releve varchar(50),
num_chq int,
rappro tinyint default 0,
note text
);

View File

@ -0,0 +1,12 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_bank_account
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(30),
bank varchar(255),
number varchar(255)
);

View File

@ -0,0 +1,10 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_bank_categ
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(255)
);

View File

@ -0,0 +1,12 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_bank_class
(
lineid integer not null,
fk_categ integer not null,
INDEX(lineid)
);

View File

@ -0,0 +1,13 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_bookmark
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_soc int,
author varchar(255),
dateb datetime
);

View File

@ -0,0 +1,11 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_fa_pr
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_facture integer,
fk_propal integer
);

View File

@ -0,0 +1,41 @@
-- ===========================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- ===========================================================================
create table llx_facture
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
facnumber varchar(50) NOT NULL,
fk_soc integer NOT NULL,
datec datetime, -- date de creation de la facture
datef date, -- date de la facture
paye smallint default 0 NOT NULL,
amount real default 0 NOT NULL,
remise real default 0,
tva real default 0,
total real default 0,
fk_statut smallint default 0 NOT NULL,
author varchar(50),
fk_user integer, -- createur de la facture
note text,
UNIQUE INDEX (facnumber)
);

View File

@ -0,0 +1,14 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_facturedet
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_facture integer,
fk_product integer,
datec datetime,
note varchar(255),
price smallint
);

View File

@ -0,0 +1,18 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_paiement
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_facture integer,
datec datetime,
datep datetime, -- payment date
amount real default 0,
author varchar(50),
fk_paiement integer NOT NULL,
num_paiement varchar(50),
note text
);

View File

@ -0,0 +1,11 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_pointmort
(
month datetime,
amount real
);

View File

@ -0,0 +1,15 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_product
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(15),
label varchar(255),
description text,
price smallint,
duration varchar(32)
);

View File

@ -0,0 +1,38 @@
-- ===========================================================================
-- Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- ===========================================================================
create table llx_projet
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_soc integer NOT NULL,
fk_statut smallint NOT NULL,
tms timestamp,
dateo date, -- date d'ouverture du projet
ref varchar(50),
title varchar(255),
fk_user_resp integer, -- responsable du projet
fk_user_creat integer, -- createur du projet
note text,
UNIQUE INDEX(ref)
);

View File

@ -0,0 +1,27 @@
-- ===================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
-- ===================================================================
create table llx_propal
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_soc integer,
fk_soc_contact integer,
fk_projet integer default 0, -- projet auquel est rattache la propale
ref varchar(30) NOT NULL, -- propal number
datec datetime, -- date de creation de l'enregistrement
datep date, -- date de la propal
author varchar(30),
fk_user_author integer, -- createur de la propale
fk_statut smallint default 0,
price real default 0,
remise real default 0,
tva real default 0,
total real default 0,
note text,
UNIQUE INDEX (ref)
);

View File

@ -0,0 +1,12 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_propaldet
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_propal integer,
fk_product integer,
price real
);

View File

@ -0,0 +1,14 @@
-- ===================================================================
-- $Id$
-- $Source$
--
-- Societes a recontacter
--
-- ===================================================================
create table llx_soc_recontact
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_soc integer,
datere datetime,
author varchar(15)
);

37
mysql/tables/llx_user.sql Normal file
View File

@ -0,0 +1,37 @@
-- ============================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
--
-- 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.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- ===========================================================================
create table llx_user
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
tms timestamp,
login varchar(8),
pass varchar(8),
name varchar(50),
firstname varchar(50),
code varchar(4),
email varchar(255),
note text,
UNIQUE INDEX(code)
);

View File

@ -0,0 +1,17 @@
-- ===================================================================
-- $Id$
-- $Source$
-- ===================================================================
create table llx_ventes
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_soc integer NOT NULL,
fk_product integer NOT NULL,
dated datetime, -- date debut
datef datetime, -- date fin
price real,
author varchar(30),
active smallint DEFAULT 0 NOT NULL,
note varchar(255)
);

59
mysql/tables/societe.sql Normal file
View File

@ -0,0 +1,59 @@
-- ========================================================================
-- Copyright (C) 2000-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- SGBD : Mysql 3.23
--
-- $Id$
-- $Source$
-- ========================================================================
create table societe
(
idp integer AUTO_INCREMENT PRIMARY KEY,
id varchar(32), -- private id
active smallint default 0, --
parent integer default 0, --
intern bool default 1 NOT NULL, -- is an intern company
cjn bool default 1 NOT NULL, -- is allowed to export to cjn
ssii bool default 0 NOT NULL, --
datec datetime, -- creation date
datem datetime, -- modification date
datea datetime, -- activation date
datel datetime, -- last login date
nom varchar(60), -- company name
address varchar(255), -- company adresse
cp varchar(10), -- zipcode
ville varchar(50), -- town
fk_pays integer default 0, --
tel varchar(20), -- phone number
fax varchar(20), -- fax number
url varchar(255), --
fk_secteur integer default 0, --
fk_effectif integer default 0, --
fk_typent integer default 0, --
siren varchar(9), --
tchoozeid integer default 0, --
c_nom varchar(40), --
c_prenom varchar(40), --
c_tel varchar(20), --
c_mail varchar(80), --
description text, --
viewed integer default 0, --
formatcv varchar(50), --
alias varchar(50), -- alias unix name for rewrite
fplus bool default 0 NOT NULL , -- flag fiche plus
logo varchar(255), --
pubkey varchar(32), --
caddie integer default 0, --
karma integer default 0, --
off_acc smallint default 0, -- offers accepted
off_ref smallint default 0, -- offers refused
fk_stcomm smallint default 0, -- commercial statut
note text, --
newsletter bool default 1, -- newsletter on or off
view_res_coord bool default 0, -- view resume personnal info
cabrecrut bool default 0, -- Cabinet de recrutement
services integer default 0, --
reminder integer default 1, --
prefix_comm varchar(5), -- prefix commercial
UNIQUE INDEX(prefix_comm)
);

View File

@ -0,0 +1,21 @@
-- ============================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- $Id$
-- $Source$
--
--
-- ============================================================================
create table socpeople
(
idp integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
fk_soc integer,
name varchar(50),
firstname varchar(50),
address varchar(255),
poste varchar(80),
phone varchar(30),
fax varchar(30),
email varchar(255),
note text
);