diff --git a/mysql/tables/Makefile b/mysql/tables/Makefile new file mode 100644 index 00000000000..d880894a8c3 --- /dev/null +++ b/mysql/tables/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2001-2002 Rodolphe Quiedeville +# +# $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' diff --git a/mysql/tables/actioncomm.sql b/mysql/tables/actioncomm.sql new file mode 100644 index 00000000000..5af18b25506 --- /dev/null +++ b/mysql/tables/actioncomm.sql @@ -0,0 +1,22 @@ +-- ======================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- $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 +); + diff --git a/mysql/tables/c_actioncomm.sql b/mysql/tables/c_actioncomm.sql new file mode 100644 index 00000000000..de9c67e3f27 --- /dev/null +++ b/mysql/tables/c_actioncomm.sql @@ -0,0 +1,10 @@ +-- ======================================================================== +-- $Id$ +-- $Source$ +-- ======================================================================== + +create table c_actioncomm +( + id integer PRIMARY KEY, + libelle varchar(30) +); diff --git a/mysql/tables/c_effectif.sql b/mysql/tables/c_effectif.sql new file mode 100644 index 00000000000..a4594c569a6 --- /dev/null +++ b/mysql/tables/c_effectif.sql @@ -0,0 +1,11 @@ +-- ======================================================================== +-- $Id$ +-- $Source$ +-- ======================================================================== + +create table c_effectif +( + id integer PRIMARY KEY, + libelle varchar(30) +); + diff --git a/mysql/tables/c_paiement.sql b/mysql/tables/c_paiement.sql new file mode 100644 index 00000000000..3127353908a --- /dev/null +++ b/mysql/tables/c_paiement.sql @@ -0,0 +1,12 @@ +-- ======================================================================== +-- $Id$ +-- $Source$ +-- ======================================================================== +create table c_paiement +( + id integer PRIMARY KEY, + libelle varchar(30) +); + + + diff --git a/mysql/tables/drop.sql b/mysql/tables/drop.sql new file mode 100644 index 00000000000..256d6329468 --- /dev/null +++ b/mysql/tables/drop.sql @@ -0,0 +1,213 @@ +-- +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- $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; + diff --git a/mysql/tables/llx_bank.sql b/mysql/tables/llx_bank.sql new file mode 100644 index 00000000000..ddcd5622c9f --- /dev/null +++ b/mysql/tables/llx_bank.sql @@ -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 +); diff --git a/mysql/tables/llx_bank_account.sql b/mysql/tables/llx_bank_account.sql new file mode 100644 index 00000000000..4dbd03dcace --- /dev/null +++ b/mysql/tables/llx_bank_account.sql @@ -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) +); diff --git a/mysql/tables/llx_bank_categ.sql b/mysql/tables/llx_bank_categ.sql new file mode 100644 index 00000000000..0432c9648c5 --- /dev/null +++ b/mysql/tables/llx_bank_categ.sql @@ -0,0 +1,10 @@ +-- =================================================================== +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_bank_categ +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + label varchar(255) +); diff --git a/mysql/tables/llx_bank_class.sql b/mysql/tables/llx_bank_class.sql new file mode 100644 index 00000000000..c0475e51ec5 --- /dev/null +++ b/mysql/tables/llx_bank_class.sql @@ -0,0 +1,12 @@ +-- =================================================================== +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_bank_class +( + lineid integer not null, + fk_categ integer not null, + + INDEX(lineid) +); diff --git a/mysql/tables/llx_bookmark.sql b/mysql/tables/llx_bookmark.sql new file mode 100644 index 00000000000..62f37ad4c16 --- /dev/null +++ b/mysql/tables/llx_bookmark.sql @@ -0,0 +1,13 @@ +-- =================================================================== +-- $Id$ +-- $Source$ +-- =================================================================== + + +create table llx_bookmark +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_soc int, + author varchar(255), + dateb datetime +); diff --git a/mysql/tables/llx_fa_pr.sql b/mysql/tables/llx_fa_pr.sql new file mode 100644 index 00000000000..cb27caf673c --- /dev/null +++ b/mysql/tables/llx_fa_pr.sql @@ -0,0 +1,11 @@ +-- =================================================================== +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_fa_pr +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_facture integer, + fk_propal integer +); diff --git a/mysql/tables/llx_facture.sql b/mysql/tables/llx_facture.sql new file mode 100644 index 00000000000..ae874440b6e --- /dev/null +++ b/mysql/tables/llx_facture.sql @@ -0,0 +1,41 @@ +-- =========================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- $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) +); diff --git a/mysql/tables/llx_facturedet.sql b/mysql/tables/llx_facturedet.sql new file mode 100644 index 00000000000..f183ed2b2ea --- /dev/null +++ b/mysql/tables/llx_facturedet.sql @@ -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 +); diff --git a/mysql/tables/llx_paiement.sql b/mysql/tables/llx_paiement.sql new file mode 100644 index 00000000000..bf26fd010fc --- /dev/null +++ b/mysql/tables/llx_paiement.sql @@ -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 +); diff --git a/mysql/tables/llx_pointmort.sql b/mysql/tables/llx_pointmort.sql new file mode 100644 index 00000000000..c2833d13dd1 --- /dev/null +++ b/mysql/tables/llx_pointmort.sql @@ -0,0 +1,11 @@ +-- =================================================================== +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_pointmort +( + month datetime, + amount real +); + diff --git a/mysql/tables/llx_product.sql b/mysql/tables/llx_product.sql new file mode 100644 index 00000000000..a87ed961e98 --- /dev/null +++ b/mysql/tables/llx_product.sql @@ -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) +); + diff --git a/mysql/tables/llx_projet.sql b/mysql/tables/llx_projet.sql new file mode 100644 index 00000000000..7d3ca82c8f4 --- /dev/null +++ b/mysql/tables/llx_projet.sql @@ -0,0 +1,38 @@ +-- =========================================================================== +-- Copyright (C) 2002 Rodolphe Quiedeville +-- +-- $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) + +); diff --git a/mysql/tables/llx_propal.sql b/mysql/tables/llx_propal.sql new file mode 100644 index 00000000000..098c4b7b286 --- /dev/null +++ b/mysql/tables/llx_propal.sql @@ -0,0 +1,27 @@ +-- =================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- $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) +); diff --git a/mysql/tables/llx_propaldet.sql b/mysql/tables/llx_propaldet.sql new file mode 100644 index 00000000000..eccf0a492a1 --- /dev/null +++ b/mysql/tables/llx_propaldet.sql @@ -0,0 +1,12 @@ +-- =================================================================== +-- $Id$ +-- $Source$ +-- =================================================================== + +create table llx_propaldet +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_propal integer, + fk_product integer, + price real +); diff --git a/mysql/tables/llx_soc_recontact.sql b/mysql/tables/llx_soc_recontact.sql new file mode 100644 index 00000000000..408778430e8 --- /dev/null +++ b/mysql/tables/llx_soc_recontact.sql @@ -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) +); \ No newline at end of file diff --git a/mysql/tables/llx_user.sql b/mysql/tables/llx_user.sql new file mode 100644 index 00000000000..261398bc2b1 --- /dev/null +++ b/mysql/tables/llx_user.sql @@ -0,0 +1,37 @@ +-- ============================================================================ +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- $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) +); diff --git a/mysql/tables/llx_ventes.sql b/mysql/tables/llx_ventes.sql new file mode 100644 index 00000000000..93635be5582 --- /dev/null +++ b/mysql/tables/llx_ventes.sql @@ -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) +); diff --git a/mysql/tables/societe.sql b/mysql/tables/societe.sql new file mode 100644 index 00000000000..c9deda0c247 --- /dev/null +++ b/mysql/tables/societe.sql @@ -0,0 +1,59 @@ +-- ======================================================================== +-- Copyright (C) 2000-2002 Rodolphe Quiedeville +-- 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) +); diff --git a/mysql/tables/socpeople.sql b/mysql/tables/socpeople.sql new file mode 100644 index 00000000000..2a6398da436 --- /dev/null +++ b/mysql/tables/socpeople.sql @@ -0,0 +1,21 @@ +-- ============================================================================ +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- $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 +);