2
0
forked from Wavyzz/dolibarr

nouvelle version des tables posgtresql

beautification du code, tout les parametres en MAJUSCULES
This commit is contained in:
opensides
2004-10-09 10:47:16 +00:00
parent 595958d1e8
commit cacc392b85
45 changed files with 92 additions and 96 deletions

View File

@@ -25,7 +25,7 @@ create table llx_c_chargesociales
(
id integer PRIMARY KEY,
libelle varchar(80),
deductible smallint NOT NULL DEFAULT 0,
deductible smallint DEFAULT 0 NOT NULL,
active tinyint DEFAULT 1 NOT NULL
)type=innodb;

View File

@@ -27,7 +27,7 @@ create table llx_c_forme_juridique
code varchar(12) UNIQUE NOT NULL,
fk_pays integer NOT NULL,
libelle varchar(255),
active tinyint default 1 NOT NULL
active tinyint DEFAULT 1 NOT NULL
)type=innodb;

View File

@@ -33,7 +33,7 @@ create table llx_c_paiement
code varchar(6) UNIQUE NOT NULL,
libelle varchar(30),
type smallint,
active tinyint default 1 NOT NULL
active tinyint DEFAULT 1 NOT NULL
)type=innodb;

View File

@@ -26,7 +26,7 @@ create table llx_c_pays
rowid integer PRIMARY KEY,
code varchar(6) UNIQUE NOT NULL,
libelle varchar(25) NOT NULL,
active tinyint default 1 NOT NULL
active tinyint DEFAULT 1 NOT NULL
)type=innodb;

View File

@@ -24,8 +24,8 @@
create table llx_c_propalst
(
id smallint PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
code varchar(12) UNIQUE NOT NULL,
label varchar(30),
active tinyint default 1 NOT NULL
active tinyint DEFAULT 1 NOT NULL
)type=innodb;

View File

@@ -29,6 +29,6 @@ create table llx_c_regions
cheflieu varchar(7),
tncc integer,
nom varchar(50),
active tinyint default 1 NOT NULL
active tinyint DEFAULT 1 NOT NULL
)type=innodb;

View File

@@ -2,9 +2,6 @@
-- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- $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
@@ -19,6 +16,9 @@
-- 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_c_typent
@@ -26,5 +26,5 @@ create table llx_c_typent
id integer PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
libelle varchar(30),
active tinyint default 1 NOT NULL
active tinyint DEFAULT 1 NOT NULL
)type=innodb;

View File

@@ -26,7 +26,7 @@ create table llx_commande
tms timestamp,
fk_soc integer,
fk_soc_contact integer,
fk_projet integer default 0, -- projet auquel est rattache la commande
fk_projet integer DEFAULT 0, -- projet auquel est rattache la commande
ref varchar(30) NOT NULL, -- propal number
date_creation datetime, -- date de creation
date_valid datetime, -- date de validation

View File

@@ -26,10 +26,10 @@ create table llx_commandedet
fk_product integer,
label varchar(255),
description text,
tva_tx real default 19.6, -- taux tva
qty real, -- quantit<69>
remise_percent real default 0, -- pourcentage de remise
remise real default 0, -- montant de la remise
tva_tx real DEFAULT 19.6, -- taux tva
qty real, -- quantit<69>
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise
subprice real, -- prix avant remise
price real -- prix final
)type=innodb;

View File

@@ -25,12 +25,12 @@ create table llx_compta
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
datev date, -- date de valeur
amount real NOT NULL default 0,
amount real DEFAULT 0 NOT NULL ,
label varchar(255),
fk_compta_account integer,
fk_user_author integer,
fk_user_valid integer,
valid tinyint default 0,
valid tinyint DEFAULT 0,
note text
)type=innodb;

View File

@@ -24,7 +24,7 @@ create table llx_cond_reglement
(
rowid integer PRIMARY KEY,
sortorder smallint,
actif tinyint default 1,
actif tinyint DEFAULT 1,
libelle varchar(255),
libelle_facture text,
fdm tinyint, -- reglement fin de mois

View File

@@ -25,7 +25,7 @@ create table llx_contrat
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
enservice smallint default 0,
enservice smallint DEFAULT 0,
mise_en_service datetime,
fin_validite datetime,
date_cloture datetime,

View File

@@ -27,6 +27,6 @@ create table llx_cotisation
fk_adherent integer,
dateadh datetime,
cotisation real,
fk_bank int(11) default NULL,
fk_bank int(11) DEFAULT NULL,
note text
)type=innodb;

View File

@@ -26,7 +26,7 @@ create table llx_deplacement
datec datetime NOT NULL,
tms timestamp,
dated datetime,
fk_user integer NOT NULL,
fk_user integer NOT NULL,
fk_user_author integer,
type smallint NOT NULL,
km smallint,

View File

@@ -27,7 +27,7 @@ create table llx_don
fk_statut smallint NOT NULL DEFAULT 0,-- etat du don promesse/valid
datec datetime, -- date de cr<63>ation de l'enregistrement
datedon datetime, -- date du don/promesse
amount real default 0,
amount real DEFAULT 0,
fk_paiement integer,
prenom varchar(50),
nom varchar(50),
@@ -37,7 +37,7 @@ create table llx_don
ville varchar(50),
pays varchar(50),
email varchar(255),
public smallint NOT NULL DEFAULT 1, -- le don est-il public (0,1)
public smallint DEFAULT 1 NOT NULL, -- le don est-il public (0,1)
fk_don_projet integer NOT NULL, -- projet auquel est fait le don
fk_user_author integer NOT NULL,
fk_user_valid integer NOT NULL,

View File

@@ -25,7 +25,7 @@ create table llx_editeur
rowid integer AUTO_INCREMENT PRIMARY KEY,
oscid integer NOT NULL,
tms timestamp,
nom varchar(255),
nom varchar(255),
fk_user_author integer
)type=innodb;

View File

@@ -28,7 +28,7 @@ create table llx_entrepot
tms timestamp,
label varchar(255) NOT NULL,
description text,
statut tinyint default 1, -- 1 ouvert, 0 ferm<72>
statut tinyint DEFAULT 1, -- 1 ouvert, 0 ferm<72>
fk_user_author integer
)type=innodb;

View File

@@ -33,7 +33,7 @@ create table llx_expedition
fk_user_valid integer, -- valideur
fk_entrepot integer,
fk_expedition_methode integer,
fk_statut smallint default 0,
fk_statut smallint DEFAULT 0,
note text,
model_pdf varchar(50),

View File

@@ -27,5 +27,5 @@ create table llx_expedition_methode
code varchar(30) NOT NULL,
libelle varchar(50) NOT NULL,
description text,
statut tinyint default 0
statut tinyint DEFAULT 0
)type=innodb;

View File

@@ -22,8 +22,8 @@
create table llx_expeditiondet
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_expedition integer not null,
fk_commande_ligne integer not null,
fk_expedition integer NOT NULL,
fk_commande_ligne integer NOT NULL,
qty real, -- quantit<69>
key(fk_expedition),

View File

@@ -24,9 +24,9 @@
create table llx_c_forme_juridique
(
rowid serial PRIMARY KEY,
code varchar(12) unique not null,
fk_pays integer not null,
code varchar(12) UNIQUE NOT NULL,
fk_pays integer NOT NULL,
libelle varchar(255),
active smallint default 1 not null
active smallint DEFAULT 1 NOT NULL
);

View File

@@ -35,7 +35,7 @@ create table llx_c_paiement
code varchar(6),
libelle varchar(30),
type smallint,
active smallint default 1 not null
active smallint DEFAULT 1 not null
);

View File

@@ -22,10 +22,10 @@
create table llx_c_pays
(
rowid SERIAL PRIMARY KEY,
code varchar(6) unique not null,
libelle varchar(25) not null,
active smallint default 1 NOT NULL
rowid SERIAL PRIMARY KEY,
code varchar(6) UNIQUE NOT NULL,
libelle varchar(25) NOT NULL,
active smallint DEFAULT 1 NOT NULL
);

View File

@@ -22,9 +22,9 @@
create table llx_c_propalst
(
id SERIAL PRIMARY KEY,
code varchar(12) unique not null,
id SERIAL PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
label varchar(30),
active integer default 1 not null
active integer DEFAULT 1 NOT NULL
);

View File

@@ -23,9 +23,9 @@
create table llx_c_regions
(
rowid serial PRIMARY KEY,
code_region integer UNIQUE NOT NULL,
fk_pays integer NOT NULL,
rowid serial PRIMARY KEY,
code_region integer UNIQUE NOT NULL,
fk_pays integer NOT NULL,
cheflieu varchar(7),
tncc integer,
nom varchar(50),

View File

@@ -23,8 +23,8 @@
create table llx_c_stcomm
(
id SERIAL PRIMARY KEY,
code varchar(12) unique not null,
code varchar(12) UNIQUE NOT NULL,
libelle varchar(30),
active smallint default 1 not null
active smallint DEFAULT 1 NOT NULL
);

View File

@@ -22,8 +22,8 @@
create table llx_c_typent
(
id SERIAL PRIMARY KEY,
code varchar(12) unique not null,
id SERIAL PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
libelle varchar(30),
active smallint default 1 not null
active smallint DEFAULT 1 NOT NULL
);

View File

@@ -25,13 +25,9 @@
create table llx_chargesociales
(
rowid SERIAL PRIMARY KEY,
date_ech timestamp NOT NULL, -- date d'echeance
date_pai timestamp, -- date de paiements
libelle varchar(80),
fk_type integer,
amount real default 0 NOT NULL,
paye smallint default 0 NOT NULL,
periode date
deductible smallint DEFAULT 0 NOT NULL,
active smallint DEFAULT 0 NOT NULL
);

View File

@@ -27,11 +27,11 @@ create table llx_commande
tms timestamp,
fk_soc integer,
fk_soc_contact integer,
fk_projet integer default 0, -- projet auquel est rattache la commande
fk_projet integer DEFAULT 0, -- projet auquel est rattache la commande
ref varchar(30) NOT NULL, -- propal number
date_creation timestamp, -- date de creation
date_valid timestamp, -- date de validation
date_cloture timestamp, -- date de cloture
date_creation timestamp without time zone, -- date de creation
date_valid timestamp without time zone, -- date de validation
date_cloture timestamp without time zone, -- date de cloture
date_commande date, -- date de la commande
fk_user_author integer, -- createur de la commande
fk_user_valid integer, -- valideur de la commande

View File

@@ -28,10 +28,10 @@ create table llx_commandedet
fk_product integer,
label varchar(255),
description text,
tva_tx real default 19.6, -- taux tva
qty real, -- quantit<69>
remise_percent real default 0, -- pourcentage de remise
remise real default 0, -- montant de la remise
tva_tx real DEFAULT 19.6, -- taux tva
qty real, -- quantit<69>
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise
subprice real, -- prix avant remise
price real -- prix final
);

View File

@@ -26,9 +26,9 @@
create table llx_compta
(
rowid SERIAL PRIMARY KEY,
datec timestamp,
datec timestamp without time zone,
datev date, -- date de valeur
amount real NOT NULL default 0,
amount real DEFAULT 0 NOT NULL,
label varchar(255),
fk_compta_account integer,
fk_user_author integer,

View File

@@ -26,7 +26,7 @@
create table llx_compta_account
(
rowid SERIAL PRIMARY KEY,
datec timestamp,
datec timestamp without time zone,
number varchar(12),
label varchar(255),
fk_user_author integer,

View File

@@ -25,9 +25,9 @@ create table llx_concert
(
rowid SERIAL PRIMARY KEY,
tms timestamp,
date_concert timestamp,
date_concert timestamp without time zone NOT NULL,
description text,
collectif int DEFAULT 0 NOT NULL,
collectif smallint DEFAULT 0 NOT NULL,
fk_groupart integer,
fk_lieu_concert integer,
fk_user_author integer

View File

@@ -25,7 +25,7 @@ create table llx_cond_reglement
(
rowid SERIAL PRIMARY KEY,
sortorder smallint,
actif int default 1,
actif smallint DEFAULT 1,
libelle varchar(255),
libelle_facture text,
fdm smallint, -- reglement fin de mois

View File

@@ -25,14 +25,14 @@ create table llx_contrat
(
rowid SERIAL PRIMARY KEY,
tms timestamp,
enservice smallint default 0,
mise_en_service timestamp,
fin_validite timestamp,
date_cloture timestamp,
enservice smallint DEFAULT 0,
mise_en_service timestamp without time zone,
fin_validite timestamp without time zone,
date_cloture timestamp without time zone,
fk_soc integer NOT NULL,
fk_product integer NOT NULL,
fk_facture integer NOT NULL default 0,
fk_facturedet integer NOT NULL default 0,
fk_facture integer NOT NULL DEFAULT 0,
fk_facturedet integer NOT NULL DEFAULT 0,
fk_user_author integer NOT NULL,
fk_user_mise_en_service integer,
fk_user_cloture integer

View File

@@ -25,10 +25,10 @@ create table llx_cotisation
(
rowid SERIAL PRIMARY KEY,
tms timestamp,
datec timestamp,
datec timestamp without time zone,
fk_adherent integer,
dateadh timestamp,
dateadh timestamp without time zone,
cotisation real,
fk_bank integer default NULL,
fk_bank integer DEFAULT NULL,
note text
);

View File

@@ -24,10 +24,10 @@
create table llx_deplacement
(
rowid SERIAL PRIMARY KEY,
datec timestamp,
datec timestamp without time zone NOT NULL,
tms timestamp,
dated timestamp,
fk_user integer NOT NULL,
dated timestamp without time zone,
fk_user integer NOT NULL,
fk_user_author integer,
type smallint NOT NULL,
km smallint,

View File

@@ -25,7 +25,7 @@
create table llx_domain
(
rowid SERIAL PRIMARY KEY,
datec timestamp,
datec timestamp without time zone,
label varchar(255),
note text
);

View File

@@ -26,9 +26,9 @@ create table llx_don
rowid SERIAL PRIMARY KEY,
tms timestamp,
fk_statut smallint NOT NULL DEFAULT 0,-- etat du don promesse/valid
datec timestamp, -- date de cr<63>ation de l'enregistrement
datedon timestamp, -- date du don/promesse
amount real default 0,
datec timestamp without time zone, -- date de cr<63>ation de l'enregistrement
datedon timestamp without time zone, -- date du don/promesse
amount real DEFAULT 0,
fk_paiement integer,
prenom varchar(50),
nom varchar(50),
@@ -38,7 +38,7 @@ create table llx_don
ville varchar(50),
pays varchar(50),
email varchar(255),
public smallint NOT NULL DEFAULT 1, -- le don est-il public (0,1)
public smallint DEFAULT 1 NOT NULL, -- le don est-il public (0,1)
fk_don_projet integer NOT NULL, -- projet auquel est fait le don
fk_user_author integer NOT NULL,
fk_user_valid integer NOT NULL,

View File

@@ -25,7 +25,7 @@ create table llx_don_projet
(
rowid SERIAL PRIMARY KEY,
tms timestamp,
datec timestamp,
datec timestamp without time zone,
libelle varchar(255),
fk_user_author integer NOT NULL,
note text

View File

@@ -26,7 +26,7 @@ create table llx_editeur
rowid SERIAL PRIMARY KEY,
oscid integer NOT NULL,
tms timestamp,
nom varchar(255),
nom varchar(255),
fk_user_author integer
);

View File

@@ -24,11 +24,11 @@
create table llx_entrepot
(
rowid SERIAL PRIMARY KEY,
datec timestamp,
datec timestamp without time zone,
tms timestamp,
label varchar(255) NOT NULL,
description text,
statut smallint default 1, -- 1 ouvert, 0 ferm<72>
statut smallint DEFAULT 1, -- 1 ouvert, 0 ferm<72>
fk_user_author integer
);

View File

@@ -27,14 +27,14 @@ create table llx_expedition
tms timestamp,
ref varchar(30) NOT NULL,
fk_commande integer,
date_creation timestamp, -- date de creation
date_valid timestamp, -- date de validation
date_creation timestamp without time zone, -- date de creation
date_valid timestamp without time zone, -- date de validation
date_expedition date, -- date de l'expedition
fk_user_author integer, -- createur
fk_user_valid integer, -- valideur
fk_entrepot integer,
fk_expedition_methode integer,
fk_statut smallint default 0,
fk_statut smallint DEFAULT 0,
note text,
model_pdf varchar(50),

View File

@@ -28,5 +28,5 @@ create table llx_expedition_methode
code varchar(30) NOT NULL,
libelle varchar(50) NOT NULL,
description text,
statut smallint default 0
statut smallint DEFAULT 0
);

View File

@@ -24,8 +24,8 @@
create table llx_expeditiondet
(
rowid serial PRIMARY KEY,
fk_expedition integer not null,
fk_commande_ligne integer not null,
fk_expedition integer NOT NULL,
fk_commande_ligne integer NOT NULL,
qty real -- quantit<69>
);