mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
nouvelle version des tables posgtresql
beautification du code, tout les parametres en MAJUSCULES
This commit is contained in:
@@ -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)
|
||||
);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2002-2003 <20>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);
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
|
||||
@@ -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<63>t<EFBFBD>
|
||||
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<63><72> l'info
|
||||
fk_user_modif integer, -- utilisateur qui a modifi<66> l'info
|
||||
remise_client real default 0 -- remise syst<73>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<63>t<EFBFBD>
|
||||
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<63><72> l'info
|
||||
fk_user_modif integer, -- utilisateur qui a modifi<66> l'info
|
||||
remise_client real DEFAULT 0 -- remise syst<73>matique pour le client
|
||||
);
|
||||
|
||||
create unique index llx_societe_prefix_comm on llx_societe(prefix_comm);
|
||||
|
||||
@@ -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<63><72> l'info
|
||||
remise_client real default 0, -- remise syst<73>matique pour le client
|
||||
remise_client real DEFAULT 0, -- remise syst<73>matique pour le client
|
||||
note text
|
||||
);
|
||||
|
||||
|
||||
@@ -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<63><72> 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<63><72> l'enregistrement
|
||||
fk_user_modif integer,
|
||||
note text
|
||||
note text
|
||||
);
|
||||
|
||||
CREATE INDEX llx_socpeople_fk_soc ON llx_socpeople(fk_soc);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user