nouvelle version des tables posgtresql

beautification du code, tout les parametres en MAJUSCULES
This commit is contained in:
opensides 2004-10-10 10:25:57 +00:00
parent 509f0a2eee
commit 9b027fbc50
31 changed files with 175 additions and 218 deletions

View File

@ -25,7 +25,7 @@ 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
fk_projet integer DEFAULT 0, -- projet auquel est rattache la propale
ref varchar(30) NOT NULL, -- propal number
datec datetime, -- date de creation
fin_validite datetime, -- date de fin de validite
@ -35,12 +35,12 @@ create table llx_propal
fk_user_author integer, -- createur de la propale
fk_user_valid integer, -- valideur de la propale
fk_user_cloture integer, -- cloture de la propale signee ou non signee
fk_statut smallint default 0,
price real default 0,
remise_percent real default 0,
remise real default 0,
tva real default 0,
total real default 0,
fk_statut smallint DEFAULT 0,
price real DEFAULT 0,
remise_percent real DEFAULT 0,
remise real DEFAULT 0,
tva real DEFAULT 0,
total real DEFAULT 0,
note text,
model_pdf varchar(50),
UNIQUE INDEX (ref)

View File

@ -26,6 +26,6 @@ create table llx_rights_def
libelle varchar(255),
module varchar(12),
type enum('r','w','m','d','a'),
bydefault tinyint default 0
bydefault tinyint DEFAULT 0
)type=innodb;

View File

@ -17,14 +17,15 @@
--
-- $Id$
-- $Source$
--
-- ========================================================================
create table llx_soc_events
(
rowid integer AUTO_INCREMENT PRIMARY KEY, -- public id
fk_soc int NOT NULL, --
dateb datetime NOT NULL, -- begin date
datee datetime NOT NULL, -- end date
fk_soc int NOT NULL, --
dateb datetime NOT NULL, -- begin date
datee datetime NOT NULL, -- end date
title varchar(100) NOT NULL,
url varchar(255),
description text

View File

@ -1,9 +1,6 @@
-- ===================================================================
-- 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
@ -20,6 +17,9 @@
--
-- Societes a recontacter
--
-- $Id$
-- $Source$
--
-- ===================================================================
create table llx_soc_recontact

View File

@ -22,42 +22,42 @@
create table llx_societe
(
idp integer AUTO_INCREMENT PRIMARY KEY,
id varchar(32), -- private id
active smallint default 0, --
parent integer default 0, --
tms timestamp,
datec datetime, -- creation date
datea datetime, -- activation date
nom varchar(60), -- company name
address varchar(255), -- company adresse
cp varchar(10), -- zipcode
ville varchar(50), -- town
fk_departement integer default 0, --
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, --
fk_forme_juridique integer default 0, -- forme juridique INSEE
siren varchar(9), -- siren ou RCS
siret varchar(14), -- numero de siret
ape varchar(4), -- code ape
tva_intra varchar(20), -- tva intracommunautaire
capital real, -- capital de la société
description text, --
fk_stcomm smallint default 0, -- commercial statut
note text, --
services integer default 0, --
prefix_comm varchar(5), -- prefix commercial
client int default 0, -- client oui/non
fournisseur smallint default 0, -- fournisseur oui/non
rubrique varchar(255), -- champ rubrique libre
fk_user_creat integer, -- utilisateur qui a créé l'info
fk_user_modif integer, -- utilisateur qui a modifié l'info
remise_client real default 0, -- remise systématique pour le client
idp integer AUTO_INCREMENT PRIMARY KEY,
id varchar(32), -- private id
active smallint DEFAULT 0, --
parent integer DEFAULT 0, --
tms timestamp,
datec datetime, -- creation date
datea datetime, -- activation date
nom varchar(60), -- company name
address varchar(255), -- company adresse
cp varchar(10), -- zipcode
ville varchar(50), -- town
fk_departement integer DEFAULT 0, --
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, --
fk_forme_juridique integer DEFAULT 0, -- forme juridique INSEE
siren varchar(9), -- siren ou RCS
siret varchar(14), -- numero de siret
ape varchar(4), -- code ape
tva_intra varchar(20), -- tva intracommunautaire
capital real, -- capital de la société
description text, --
fk_stcomm smallint DEFAULT 0, -- commercial statut
note text, --
services integer DEFAULT 0, --
prefix_comm varchar(5), -- prefix commercial
client integer DEFAULT 0, -- client oui/non
fournisseur smallint DEFAULT 0, -- fournisseur oui/non
rubrique varchar(255), -- champ rubrique libre
fk_user_creat integer, -- utilisateur qui a créé l'info
fk_user_modif integer, -- utilisateur qui a modifié l'info
remise_client real DEFAULT 0, -- remise systématique pour le client
UNIQUE INDEX(prefix_comm)
)type=innodb;

View File

@ -29,7 +29,7 @@ create table llx_societe_remise
tms timestamp,
datec datetime, -- creation date
fk_user_author integer, -- utilisateur qui a créé l'info
remise_client real default 0, -- remise systématique pour le client
remise_client real DEFAULT 0, -- remise systématique pour le client
note text
)type=innodb;

View File

@ -38,7 +38,7 @@ create table llx_socpeople
fax varchar(30),
email varchar(255),
jabberid varchar(255),
fk_user integer default 0, -- user qui a créé l'enregistrement
fk_user integer DEFAULT 0, -- user qui a créé l'enregistrement
fk_user_modif integer,
note text
)type=innodb;

View File

@ -32,7 +32,7 @@ create table llx_todocomm
fk_user_author integer, -- id auteur de l'action
fk_soc integer, -- id de la societe auquel est rattachee l'action
fk_contact integer, -- id du contact sur laquelle l'action
-- doit etre effectuee
-- doit etre effectuee
note text
)type=innodb;

View File

@ -26,7 +26,7 @@ create table llx_tva
tms timestamp,
datep date, -- date de paiement
datev date, -- date de valeur
amount real NOT NULL default 0,
amount real NOT NULL DEFAULT 0,
label varchar(255),
note text
)type=innodb;

View File

@ -31,12 +31,12 @@ create table llx_user
firstname varchar(50),
code varchar(4),
email varchar(255),
admin smallint default 0,
admin smallint DEFAULT 0,
webcal_login varchar(25),
module_comm smallint default 1,
module_compta smallint default 1,
fk_societe integer default 0,
fk_socpeople integer default 0,
module_comm smallint DEFAULT 1,
module_compta smallint DEFAULT 1,
fk_societe integer DEFAULT 0,
fk_socpeople integer DEFAULT 0,
note text,
UNIQUE INDEX(login)

View File

@ -27,5 +27,6 @@ create table llx_user_param
page varchar(255),
param varchar(64),
value varchar(255),
UNIQUE (fk_user,page,param)
)type=innodb;

View File

@ -24,6 +24,7 @@ create table llx_user_rights
(
fk_user integer NOT NULL,
fk_id integer NOT NULL,
UNIQUE(fk_user,fk_id)
)type=innodb;

View File

@ -28,7 +28,7 @@ create table llx_ventes
dated datetime, -- date debut
datef datetime, -- date fin
price real,
author varchar(30),
author varchar(30),
active smallint DEFAULT 0 NOT NULL,
note varchar(255)
)type=innodb;

View File

@ -33,8 +33,8 @@ create table llx_voyage
dateo date, -- date operation
date_depart datetime, -- date du voyage
date_arrivee datetime, -- date du voyage
amount real NOT NULL default 0, -- prix du billet
reduction real NOT NULL default 0, -- montant de la reduction obtenue
amount real NOT NULL DEFAULT 0, -- prix du billet
reduction real NOT NULL DEFAULT 0, -- montant de la reduction obtenue
depart varchar(255),
arrivee varchar(255),
fk_type smallint, -- Train, Avion, Bateaux

View File

@ -27,7 +27,7 @@ create table llx_voyage_reduc
datev date, -- date de valeur
date_debut date, -- date operation
date_fin date,
amount real NOT NULL default 0,
amount real NOT NULL DEFAULT 0,
label varchar(255),
numero varchar(255),
fk_type smallint, -- Train, Avion, Bateaux

View File

@ -27,22 +27,22 @@ create table llx_propal
rowid SERIAL 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 timestamp, -- date de creation
fin_validite timestamp, -- date de fin de validite
date_valid timestamp, -- date de validation
date_cloture timestamp, -- date de cloture
datep date, -- date de la propal
fk_user_author integer, -- createur de la propale
fk_user_valid integer, -- valideur de la propale
fk_user_cloture integer, -- cloture de la propale signee ou non signee
fk_statut smallint default 0,
price real default 0,
remise_percent real default 0,
remise real default 0,
tva real default 0,
total real default 0,
fk_projet integer DEFAULT 0, -- projet auquel est rattache la propale
ref varchar(30) NOT NULL, -- propal number
datec timestamp without time zone, -- date de creation
fin_validite timestamp without time zone, -- date de fin de validite
date_valid timestamp without time zone, -- date de validation
date_cloture timestamp without time zone, -- date de cloture
datep date, -- date de la propal
fk_user_author integer, -- createur de la propale
fk_user_valid integer, -- valideur de la propale
fk_user_cloture integer, -- cloture de la propale signee ou non signee
fk_statut smallint DEFAULT 0,
price real DEFAULT 0,
remise_percent real DEFAULT 0,
remise real DEFAULT 0,
tva real DEFAULT 0,
total real DEFAULT 0,
note text,
model_pdf varchar(50)
);

View File

@ -26,7 +26,7 @@ create table llx_rights_def
id integer PRIMARY KEY,
libelle varchar(255),
module varchar(12),
type CHAR CHECK (type IN ('r','w','m','d','a')),
bydefault smallint default 0
type CHAR CHECK (type IN ('r','w','m','d','a')),
bydefault smallint DEFAULT 0
);

View File

@ -1,41 +0,0 @@
-- ===================================================================
-- Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2002-2003 Éric Seigne <erics@rycks.com>
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
--
-- 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.
--
-- $Id$
-- $Source$
--
-- ===================================================================
create table llx_service
(
rowid SERIAL PRIMARY KEY,
datec timestamp,
tms timestamp,
ref varchar(15),
label varchar(255),
description text,
price smallint,
duration varchar(32),
debut_comm timestamp,
fin_comm timestamp,
fk_user_author integer,
fk_user_modif integer
);
create unique index llx_service_ref on llx_service(ref);

View File

@ -24,10 +24,10 @@
create table llx_soc_events
(
rowid SERIAL PRIMARY KEY,
fk_soc int NOT NULL, --
dateb timestamp NOT NULL, -- begin date
datee timestamp NOT NULL, -- end date
rowid SERIAL PRIMARY KEY, -- public id
fk_soc int NOT NULL,
dateb timestamp without time zone NOT NULL, -- begin date
datee timestamp without time zone NOT NULL, -- end date
title varchar(100) NOT NULL,
url varchar(255),
description text

View File

@ -28,6 +28,6 @@ create table llx_soc_recontact
(
rowid SERIAL PRIMARY KEY,
fk_soc integer,
datere timestamp,
datere timestamp without time zone,
author varchar(15)
);

View File

@ -24,42 +24,42 @@
create table llx_societe
(
idp SERIAL PRIMARY KEY,
id varchar(32), -- private id
active smallint default 0, --
parent integer default 0, --
tms timestamp,
datec timestamp, -- creation date
datea timestamp, -- activation date
nom varchar(60), -- company name
address varchar(255), -- company adresse
cp varchar(10), -- zipcode
ville varchar(50), -- town
fk_departement integer default 0, --
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, --
fk_forme_juridique integer default 0, -- forme juridique INSEE
siren varchar(9), --
siret varchar(14), -- numero de siret
ape varchar(4), -- code ape
tva_intra varchar(20), -- tva intracommunautaire
capital real, -- capital de la société
description text, --
fk_stcomm smallint default 0, -- commercial statut
note text, --
services integer default 0, --
prefix_comm varchar(5), -- prefix commercial
client smallint default 0, -- client oui/non
fournisseur smallint default 0, -- fournisseur oui/non
rubrique varchar(255), -- champ rubrique libre
fk_user_creat integer, -- utilisateur qui a créé l'info
fk_user_modif integer, -- utilisateur qui a modifié l'info
remise_client real default 0 -- remise systématique pour le client
idp SERIAL PRIMARY KEY,
id varchar(32), -- private id
active smallint DEFAULT 0, --
parent integer DEFAULT 0, --
tms timestamp,
datec timestamp without time zone, -- creation date
datea timestamp without time zone, -- activation date
nom varchar(60), -- company name
address varchar(255), -- company adresse
cp varchar(10), -- zipcode
ville varchar(50), -- town
fk_departement integer DEFAULT 0, --
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, --
fk_forme_juridique integer DEFAULT 0, -- forme juridique INSEE
siren varchar(9), --
siret varchar(14), -- numero de siret
ape varchar(4), -- code ape
tva_intra varchar(20), -- tva intracommunautaire
capital real, -- capital de la société
description text, --
fk_stcomm smallint DEFAULT 0, -- commercial statut
note text, --
services integer DEFAULT 0, --
prefix_comm varchar(5), -- prefix commercial
client integer DEFAULT 0, -- client oui/non
fournisseur smallint DEFAULT 0, -- fournisseur oui/non
rubrique varchar(255), -- champ rubrique libre
fk_user_creat integer, -- utilisateur qui a créé l'info
fk_user_modif integer, -- utilisateur qui a modifié l'info
remise_client real DEFAULT 0 -- remise systématique pour le client
);
create unique index llx_societe_prefix_comm on llx_societe(prefix_comm);

View File

@ -27,9 +27,9 @@ create table llx_societe_remise
rowid serial PRIMARY KEY,
fk_soc integer NOT NULL,
tms timestamp,
datec timestamp, -- creation date
datec timestamp without time zone, -- creation date
fk_user_author integer, -- utilisateur qui a créé l'info
remise_client real default 0, -- remise systématique pour le client
remise_client real DEFAULT 0, -- remise systématique pour le client
note text
);

View File

@ -24,25 +24,25 @@
create table llx_socpeople
(
idp SERIAL PRIMARY KEY,
datec timestamp,
tms timestamp,
fk_soc integer, -- lien vers la societe
civilite varchar(6),
name varchar(50),
firstname varchar(50),
address varchar(255),
idp SERIAL PRIMARY KEY,
datec timestamp without time zone,
tms timestamp,
fk_soc integer, -- lien vers la societe
civilite varchar(6),
name varchar(50),
firstname varchar(50),
address varchar(255),
birthday date,
poste varchar(80),
phone varchar(30),
phone_perso varchar(30),
phone_mobile varchar(30),
fax varchar(30),
email varchar(255),
jabberid varchar(255),
fk_user integer default 0, -- user qui a créé l'enregistrement
poste varchar(80),
phone varchar(30),
phone_perso varchar(30),
phone_mobile varchar(30),
fax varchar(30),
email varchar(255),
jabberid varchar(255),
fk_user integer DEFAULT 0, -- user qui a créé l'enregistrement
fk_user_modif integer,
note text
note text
);
CREATE INDEX llx_socpeople_fk_soc ON llx_socpeople(fk_soc);

View File

@ -25,7 +25,7 @@
create table llx_socstatutlog
(
id SERIAL PRIMARY KEY,
datel timestamp,
datel timestamp without time zone,
fk_soc integer,
fk_statut integer,
author varchar(30)

View File

@ -25,7 +25,7 @@ create table llx_stock_mouvement
(
rowid SERIAL PRIMARY KEY,
tms timestamp,
datem timestamp,
datem timestamp without time zone,
fk_product integer NOT NULL,
fk_stock integer NOT NULL,
value integer,

View File

@ -27,13 +27,13 @@
create table llx_todocomm
(
id SERIAL PRIMARY KEY,
datea timestamp, -- date de l'action
label varchar(50), -- libelle de l'action
fk_user_action integer, -- id de la personne qui doit effectuer l'action
fk_user_author integer, -- id auteur de l'action
fk_soc integer, -- id de la societe auquel est rattachee l'action
fk_contact integer, -- id du contact sur laquelle l'action
-- doit etre effectuee
datea timestamp without time zone, -- date de l'action
label varchar(50), -- libelle de l'action
fk_user_action integer, -- id de la personne qui doit effectuer l'action
fk_user_author integer, -- id auteur de l'action
fk_soc integer, -- id de la societe auquel est rattachee l'action
fk_contact integer, -- id du contact sur laquelle l'action
-- doit etre effectuee
note text
);

View File

@ -28,7 +28,7 @@ create table llx_tva
tms timestamp,
datep date, -- date de paiement
datev date, -- date de valeur
amount real NOT NULL default 0,
amount real NOT NULL DEFAULT 0,
label varchar(255),
note text
);

View File

@ -25,7 +25,7 @@
create table llx_user
(
rowid SERIAL PRIMARY KEY,
datec timestamp,
datec timestamp without time zone,
tms timestamp,
login varchar(8),
pass varchar(32),
@ -33,12 +33,12 @@ create table llx_user
firstname varchar(50),
code varchar(4),
email varchar(255),
admin smallint default 0,
admin smallint DEFAULT 0,
webcal_login varchar(25),
module_comm smallint default 1,
module_compta smallint default 1,
fk_societe integer default 0,
fk_socpeople integer default 0,
module_comm smallint DEFAULT 1,
module_compta smallint DEFAULT 1,
fk_societe integer DEFAULT 0,
fk_socpeople integer DEFAULT 0,
note text
);

View File

@ -27,10 +27,10 @@ create table llx_ventes
rowid SERIAL PRIMARY KEY,
fk_soc integer NOT NULL,
fk_product integer NOT NULL,
dated timestamp, -- date debut
datef timestamp, -- date fin
dated timestamp without time zone, -- date debut
datef timestamp without time zone, -- date fin
price real,
author varchar(30),
author varchar(30),
active smallint DEFAULT 0 NOT NULL,
note varchar(255)
);

View File

@ -25,23 +25,18 @@
create table llx_voyage
(
rowid SERIAL PRIMARY KEY,
datec timestamp,
dateo date, -- date operation
date_depart timestamp, -- date du voyage
date_arrivee timestamp, -- date du voyage
amount real NOT NULL default 0, -- prix du billet
reduction real NOT NULL default 0, -- montant de la reduction obtenue
datec timestamp without time zone,
dateo date, -- date operation
date_depart timestamp without time zone, -- date du voyage
date_arrivee timestamp without time zone, -- date du voyage
amount real NOT NULL DEFAULT 0, -- prix du billet
reduction real NOT NULL DEFAULT 0, -- montant de la reduction obtenue
depart varchar(255),
arrivee varchar(255),
fk_type smallint, -- Train, Avion, Bateaux
fk_type smallint, -- Train, Avion, Bateaux
fk_reduc integer,
distance integer, -- distance en kilometre
dossier varchar(50), -- numero de dossier
distance integer, -- distance en kilometre
dossier varchar(50), -- numero de dossier
note text
);
-- insert into llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc)
-- values ('2002-04-21 12:05','2002-04-21 15:25',26.8,'Paris','Auray',1);
-- insert into llx_voyage (date_depart, date_arrivee, amount, depart, arrivee, fk_reduc)
-- values ('2002-04-23 15:42','2002-04-23 19:10',26.8,'Auray','Paris',1);

View File

@ -25,11 +25,11 @@
create table llx_voyage_reduc
(
rowid SERIAL PRIMARY KEY,
datec timestamp,
datec timestamp without time zone,
datev date, -- date de valeur
date_debut date, -- date operation
date_fin date,
amount real NOT NULL default 0,
amount real NOT NULL DEFAULT 0,
label varchar(255),
numero varchar(255),
fk_type smallint, -- Train, Avion, Bateaux