From a39bb20058e13e3dfc3b58057e3cf6426d7d8633 Mon Sep 17 00:00:00 2001 From: opensides Date: Sat, 9 Oct 2004 11:26:43 +0000 Subject: [PATCH] nouvelle version des tables posgtresql beautification du code, tout les parametres en MAJUSCULES --- mysql/tables/llx_fa_pr.sql | 4 +-- mysql/tables/llx_facture.sql | 20 ++++++------- mysql/tables/llx_facture_fourn.sql | 18 ++++++------ mysql/tables/llx_facture_fourn_det.sql | 12 ++++---- mysql/tables/llx_facture_rec.sql | 12 ++++---- mysql/tables/llx_facturedet.sql | 10 +++---- mysql/tables/llx_facturedet_rec.sql | 12 ++++---- mysql/tables/llx_fichinter.sql | 10 +++---- mysql/tables/llx_groupart.sql | 2 +- mysql/tables/llx_groupesociete.sql | 2 +- mysql/tables/llx_groupesociete_remise.sql | 2 +- mysql/tables/llx_livre.sql | 8 ++--- mysql/tables/llx_newsletter.sql | 2 +- mysql/tables/llx_paiement.sql | 2 +- mysql/tables/llx_paiement_facture.sql | 2 +- mysql/tables/llx_paiementcharge.sql | 2 +- mysql/tables/llx_paiementfourn.sql | 2 +- mysql/tables/llx_product.sql | 14 ++++----- mysql/tables/llx_product_price.sql | 4 +-- mysql/tables/llx_product_stock.sql | 2 +- mysql/tables/llx_projet.sql | 6 ++-- mysql/tables/llx_propaldet.sql | 8 ++--- pgsql/tables/llx_facture.sql | 36 +++++++++++------------ pgsql/tables/llx_facture_fourn.sql | 26 ++++++++-------- pgsql/tables/llx_facture_fourn_det.sql | 12 ++++---- pgsql/tables/llx_facture_rec.sql | 21 +++++++------ pgsql/tables/llx_facturedet.sql | 12 ++++---- pgsql/tables/llx_facturedet_rec.sql | 12 ++++---- pgsql/tables/llx_fichinter.sql | 8 ++--- pgsql/tables/llx_groupart.sql | 4 +-- pgsql/tables/llx_groupesociete.sql | 4 +-- pgsql/tables/llx_groupesociete_remise.sql | 4 +-- pgsql/tables/llx_livre.sql | 10 +++---- pgsql/tables/llx_newsletter.sql | 14 ++++----- pgsql/tables/llx_notify.sql | 4 +-- pgsql/tables/llx_paiement.sql | 10 +++---- pgsql/tables/llx_paiement_facture.sql | 2 +- pgsql/tables/llx_paiementcharge.sql | 6 ++-- pgsql/tables/llx_paiementfourn.sql | 14 ++++----- pgsql/tables/llx_pointmort.sql | 2 +- pgsql/tables/llx_product.sql | 32 ++++++++++---------- pgsql/tables/llx_product_fournisseur.sql | 2 +- pgsql/tables/llx_product_price.sql | 6 ++-- pgsql/tables/llx_product_stock.sql | 2 +- pgsql/tables/llx_projet.sql | 6 ++-- pgsql/tables/llx_propaldet.sql | 14 ++++----- 46 files changed, 212 insertions(+), 207 deletions(-) diff --git a/mysql/tables/llx_fa_pr.sql b/mysql/tables/llx_fa_pr.sql index 5940b62ecab..e5890d04b90 100644 --- a/mysql/tables/llx_fa_pr.sql +++ b/mysql/tables/llx_fa_pr.sql @@ -22,6 +22,6 @@ create table llx_fa_pr ( rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_facture integer, - fk_propal integer + fk_facture integer, + fk_propal integer )type=innodb; diff --git a/mysql/tables/llx_facture.sql b/mysql/tables/llx_facture.sql index 057245accc2..149d9f299f5 100644 --- a/mysql/tables/llx_facture.sql +++ b/mysql/tables/llx_facture.sql @@ -22,18 +22,18 @@ create table llx_facture ( rowid integer AUTO_INCREMENT PRIMARY KEY, - facnumber varchar(50) NOT NULL, - fk_soc integer NOT NULL, + 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, - remise_percent real default 0, - tva real default 0, - total real default 0, - total_ttc real default 0, - fk_statut smallint default 0 NOT NULL, + paye smallint DEFAULT 0 NOT NULL, + amount real DEFAULT 0 NOT NULL, + remise real DEFAULT 0, + remise_percent real DEFAULT 0, + tva real DEFAULT 0, + total real DEFAULT 0, + total_ttc real DEFAULT 0, + fk_statut smallint DEFAULT 0 NOT NULL, author varchar(50), fk_user integer, -- createur de la facture fk_user_author integer, -- createur de la propale diff --git a/mysql/tables/llx_facture_fourn.sql b/mysql/tables/llx_facture_fourn.sql index b7844864e51..c008444ccd0 100644 --- a/mysql/tables/llx_facture_fourn.sql +++ b/mysql/tables/llx_facture_fourn.sql @@ -28,16 +28,16 @@ create table llx_facture_fourn datec datetime, -- date de creation de la facture datef date, -- date de la facture libelle varchar(255), - paye smallint default 0 NOT NULL, - amount real default 0 NOT NULL, - remise real default 0, - tva real default 0, - total real default 0, - total_ht real default 0, - total_tva real default 0, - total_ttc real default 0, + paye smallint DEFAULT 0 NOT NULL, + amount real DEFAULT 0 NOT NULL, + remise real DEFAULT 0, + tva real DEFAULT 0, + total real DEFAULT 0, + total_ht real DEFAULT 0, + total_tva real DEFAULT 0, + total_ttc real DEFAULT 0, - fk_statut smallint default 0 NOT NULL, + fk_statut smallint DEFAULT 0 NOT NULL, fk_user_author integer, -- createur de la facture fk_user_valid integer, -- valideur de la facture diff --git a/mysql/tables/llx_facture_fourn_det.sql b/mysql/tables/llx_facture_fourn_det.sql index ecf5cdca649..a9445e11565 100644 --- a/mysql/tables/llx_facture_fourn_det.sql +++ b/mysql/tables/llx_facture_fourn_det.sql @@ -25,11 +25,11 @@ create table llx_facture_fourn_det fk_facture_fourn integer NOT NULL, fk_product integer NULL, description text, - pu_ht real default 0, - qty smallint default 1, - total_ht real default 0, - tva_taux real default 0, - tva real default 0, - total_ttc real default 0 + pu_ht real DEFAULT 0, + qty smallint DEFAULT 1, + total_ht real DEFAULT 0, + tva_taux real DEFAULT 0, + tva real DEFAULT 0, + total_ttc real DEFAULT 0 )type=innodb; diff --git a/mysql/tables/llx_facture_rec.sql b/mysql/tables/llx_facture_rec.sql index 77e15beba15..22d50f3a907 100644 --- a/mysql/tables/llx_facture_rec.sql +++ b/mysql/tables/llx_facture_rec.sql @@ -26,12 +26,12 @@ create table llx_facture_rec fk_soc integer NOT NULL, datec datetime, -- date de creation - amount real default 0 NOT NULL, - remise real default 0, - remise_percent real default 0, - tva real default 0, - total real default 0, - total_ttc real default 0, + amount real DEFAULT 0 NOT NULL, + remise real DEFAULT 0, + remise_percent real DEFAULT 0, + tva real DEFAULT 0, + total real DEFAULT 0, + total_ttc real DEFAULT 0, fk_user_author integer, -- createur fk_projet integer, -- projet auquel est associé la facture diff --git a/mysql/tables/llx_facturedet.sql b/mysql/tables/llx_facturedet.sql index 836afed372d..db1aa414adf 100644 --- a/mysql/tables/llx_facturedet.sql +++ b/mysql/tables/llx_facturedet.sql @@ -24,12 +24,12 @@ create table llx_facturedet ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_facture integer NOT NULL, - fk_product integer NOT NULL default 0, + fk_product integer DEFAULT 0 NOT NULL, description text, - tva_taux real default 19.6, -- taux tva - qty real, -- quantité - remise_percent real default 0, -- pourcentage de remise - remise real default 0, -- montant de la remise + tva_taux real DEFAULT 19.6, -- taux tva + qty real, -- quantité + 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 date_start datetime, -- date debut si service diff --git a/mysql/tables/llx_facturedet_rec.sql b/mysql/tables/llx_facturedet_rec.sql index cd2faeba25a..8961dbe74cd 100644 --- a/mysql/tables/llx_facturedet_rec.sql +++ b/mysql/tables/llx_facturedet_rec.sql @@ -25,10 +25,10 @@ create table llx_facturedet_rec fk_facture integer NOT NULL, fk_product integer, description text, - tva_taux real default 19.6, -- taux tva - qty real, -- quantité - 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 + tva_taux real DEFAULT 19.6, -- taux tva + qty real, -- quantité + 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; diff --git a/mysql/tables/llx_fichinter.sql b/mysql/tables/llx_fichinter.sql index f1cd68a22b9..fc59fd0134b 100644 --- a/mysql/tables/llx_fichinter.sql +++ b/mysql/tables/llx_fichinter.sql @@ -1,9 +1,6 @@ -- =================================================================== -- 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 @@ -18,20 +15,23 @@ -- 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_fichinter ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_soc integer NOT NULL, - fk_projet integer default 0, -- projet auquel est rattache la fiche + fk_projet integer DEFAULT 0, -- projet auquel est rattache la fiche ref varchar(30) NOT NULL, -- number datec datetime, -- date de creation date_valid datetime, -- date de validation datei date, -- date de l'intervention fk_user_author integer, -- createur de la fiche fk_user_valid integer, -- valideur de la fiche - fk_statut smallint default 0, + fk_statut smallint DEFAULT 0, duree real, note text, diff --git a/mysql/tables/llx_groupart.sql b/mysql/tables/llx_groupart.sql index fd3b6cf6a87..fa451ef2f9a 100644 --- a/mysql/tables/llx_groupart.sql +++ b/mysql/tables/llx_groupart.sql @@ -25,7 +25,7 @@ create table llx_groupart rowid integer AUTO_INCREMENT PRIMARY KEY, osc_id integer NOT NULL, tms timestamp, - nom varchar(64), + nom varchar(64), groupart enum("artiste","groupe") NOT NULL, description text NOT NULL, fk_user_author integer diff --git a/mysql/tables/llx_groupesociete.sql b/mysql/tables/llx_groupesociete.sql index 01e9c966318..7a6ec953039 100644 --- a/mysql/tables/llx_groupesociete.sql +++ b/mysql/tables/llx_groupesociete.sql @@ -28,7 +28,7 @@ create table llx_groupesociete datec datetime, -- creation date nom varchar(60), -- company name note text, -- - remise real default 0, -- remise systématique pour le client + remise real DEFAULT 0, -- remise systématique pour le client fk_user_author integer )type=innodb; diff --git a/mysql/tables/llx_groupesociete_remise.sql b/mysql/tables/llx_groupesociete_remise.sql index c016321f5c5..5dc369a6001 100644 --- a/mysql/tables/llx_groupesociete_remise.sql +++ b/mysql/tables/llx_groupesociete_remise.sql @@ -29,7 +29,7 @@ create table llx_groupesociete_remise tms timestamp, datec datetime, -- creation date fk_user_author integer, -- utilisateur qui a créé l'info - remise real default 0, -- remise systématique pour le client + remise real DEFAULT 0, -- remise systématique pour le client note text )type=innodb; diff --git a/mysql/tables/llx_livre.sql b/mysql/tables/llx_livre.sql index 4cecd08ed9f..939a253f8c2 100644 --- a/mysql/tables/llx_livre.sql +++ b/mysql/tables/llx_livre.sql @@ -27,14 +27,14 @@ create table llx_livre tms timestamp, status tinyint, date_ajout datetime, - ref varchar(12), - title varchar(64), - annee smallint(64), + ref varchar(12), + title varchar(64), + annee smallint(64), description text, prix decimal(15,4), fk_editeur integer, fk_user_author integer, - frais_de_port tinyint default 1, + frais_de_port tinyint DEFAULT 1, UNIQUE(ref) )type=innodb; diff --git a/mysql/tables/llx_newsletter.sql b/mysql/tables/llx_newsletter.sql index d2a583b300a..dd848c557e6 100644 --- a/mysql/tables/llx_newsletter.sql +++ b/mysql/tables/llx_newsletter.sql @@ -32,7 +32,7 @@ create table llx_newsletter email_body text, target smallint, sql_target text, - status smallint NOT NULL DEFAULT 0, + status smallint DEFAULT 0 NOT NULL, date_send_request datetime, -- debut de l'envoi demandé date_send_begin datetime, -- debut de l'envoi date_send_end datetime, -- fin de l'envoi diff --git a/mysql/tables/llx_paiement.sql b/mysql/tables/llx_paiement.sql index f38a5130a52..ed86c31347a 100644 --- a/mysql/tables/llx_paiement.sql +++ b/mysql/tables/llx_paiement.sql @@ -27,7 +27,7 @@ create table llx_paiement datec datetime, -- date de creation tms timestamp, datep datetime, -- payment date - amount real default 0, + amount real DEFAULT 0, author varchar(50), fk_paiement integer NOT NULL, num_paiement varchar(50), diff --git a/mysql/tables/llx_paiement_facture.sql b/mysql/tables/llx_paiement_facture.sql index 2769ed1cf85..6b32927bbf6 100644 --- a/mysql/tables/llx_paiement_facture.sql +++ b/mysql/tables/llx_paiement_facture.sql @@ -24,7 +24,7 @@ create table llx_paiement_facture rowid integer AUTO_INCREMENT PRIMARY KEY, fk_paiement integer, fk_facture integer, - amount real default 0, + amount real DEFAULT 0, key (fk_paiement), key (fk_facture) diff --git a/mysql/tables/llx_paiementcharge.sql b/mysql/tables/llx_paiementcharge.sql index 2a856ce8f71..625108ce66a 100755 --- a/mysql/tables/llx_paiementcharge.sql +++ b/mysql/tables/llx_paiementcharge.sql @@ -26,7 +26,7 @@ create table llx_paiementcharge datec datetime, -- date de creation tms timestamp, datep datetime, -- payment date - amount real default 0, + amount real DEFAULT 0, fk_typepaiement integer NOT NULL, num_paiement varchar(50), note text, diff --git a/mysql/tables/llx_paiementfourn.sql b/mysql/tables/llx_paiementfourn.sql index b11b5d93671..3323d82d0c7 100644 --- a/mysql/tables/llx_paiementfourn.sql +++ b/mysql/tables/llx_paiementfourn.sql @@ -27,7 +27,7 @@ create table llx_paiementfourn datec datetime, -- date de creation de l'enregistrement fk_facture_fourn integer, -- facture datep datetime, -- date de paiement - amount real default 0, -- montant + amount real DEFAULT 0, -- montant fk_user_author integer, -- auteur fk_paiement integer NOT NULL, -- moyen de paiement num_paiement varchar(50), -- numéro de paiement (cheque) diff --git a/mysql/tables/llx_product.sql b/mysql/tables/llx_product.sql index 5c633fd622e..87deadc9ba9 100644 --- a/mysql/tables/llx_product.sql +++ b/mysql/tables/llx_product.sql @@ -29,15 +29,15 @@ create table llx_product label varchar(255), description text, price double, - tva_tx double default 19.6, + tva_tx double DEFAULT 19.6, fk_user_author integer, - envente tinyint default 1, - nbvente integer default 0, - fk_product_type integer default 0, + envente tinyint DEFAULT 1, + nbvente integer DEFAULT 0, + fk_product_type integer DEFAULT 0, duration varchar(6), - stock_propale integer default 0, - stock_commande integer default 0, - seuil_stock_alerte integer default 0 + stock_propale integer DEFAULT 0, + stock_commande integer DEFAULT 0, + seuil_stock_alerte integer DEFAULT 0 )type=innodb; diff --git a/mysql/tables/llx_product_price.sql b/mysql/tables/llx_product_price.sql index d91ff57125c..ca74ac5b1d5 100644 --- a/mysql/tables/llx_product_price.sql +++ b/mysql/tables/llx_product_price.sql @@ -27,8 +27,8 @@ create table llx_product_price fk_product integer NOT NULL, date_price datetime NOT NULL, price double, - tva_tx double default 19.6, + tva_tx double DEFAULT 19.6, fk_user_author integer, - envente tinyint default 1 + envente tinyint DEFAULT 1 )type=innodb; diff --git a/mysql/tables/llx_product_stock.sql b/mysql/tables/llx_product_stock.sql index bc8c6b79072..68db898e2a1 100644 --- a/mysql/tables/llx_product_stock.sql +++ b/mysql/tables/llx_product_stock.sql @@ -26,7 +26,7 @@ create table llx_product_stock tms timestamp, fk_product integer NOT NULL, fk_entrepot integer NOT NULL, - reel integer, -- stock réel + reel integer, -- stock réel key(fk_product), key(fk_entrepot) diff --git a/mysql/tables/llx_projet.sql b/mysql/tables/llx_projet.sql index 72c4a1d30f7..85be925063c 100644 --- a/mysql/tables/llx_projet.sql +++ b/mysql/tables/llx_projet.sql @@ -26,11 +26,11 @@ create table llx_projet fk_soc integer NOT NULL, fk_statut smallint NOT NULL, tms timestamp, - dateo date, -- date d'ouverture du projet + 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 + 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_propaldet.sql b/mysql/tables/llx_propaldet.sql index 4d4b7822d3e..8614512b7c1 100644 --- a/mysql/tables/llx_propaldet.sql +++ b/mysql/tables/llx_propaldet.sql @@ -25,10 +25,10 @@ create table llx_propaldet fk_propal integer, fk_product integer, description text, - tva_tx real default 19.6, -- taux tva - qty real, -- quantité - 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é + 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; diff --git a/pgsql/tables/llx_facture.sql b/pgsql/tables/llx_facture.sql index 0a691f5cea5..7c3aa0e21b4 100644 --- a/pgsql/tables/llx_facture.sql +++ b/pgsql/tables/llx_facture.sql @@ -24,27 +24,27 @@ create table llx_facture ( - rowid SERIAL PRIMARY KEY, - facnumber varchar(50) NOT NULL, - fk_soc integer NOT NULL, - datec timestamp, -- 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, - remise_percent real default 0, - tva real default 0, - total real default 0, - total_ttc real default 0, - fk_statut smallint default 0 NOT NULL, - author varchar(50), - fk_user integer, -- createur de la facture - fk_user_author integer, -- createur de la propale - fk_user_valid integer, -- valideur de la propale + rowid SERIAL PRIMARY KEY, + facnumber varchar(50) NOT NULL, + fk_soc integer NOT NULL, + datec timestamp without time zone, -- 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, + remise_percent real DEFAULT 0, + tva real DEFAULT 0, + total real DEFAULT 0, + total_ttc real DEFAULT 0, + fk_statut smallint DEFAULT 0 NOT NULL, + author varchar(50), + fk_user integer, -- createur de la facture + fk_user_author integer, -- createur de la propale + fk_user_valid integer, -- valideur de la propale fk_projet integer, -- projet auquel est associé la facture fk_cond_reglement integer, -- condition de reglement date_lim_reglement date, -- date limite de reglement - note text + note text ); create unique index llx_facture_facnumber on llx_facture(facnumber); diff --git a/pgsql/tables/llx_facture_fourn.sql b/pgsql/tables/llx_facture_fourn.sql index cbc5ed200e8..00e470cea88 100644 --- a/pgsql/tables/llx_facture_fourn.sql +++ b/pgsql/tables/llx_facture_fourn.sql @@ -27,19 +27,21 @@ create table llx_facture_fourn rowid SERIAL PRIMARY KEY, facnumber varchar(50) NOT NULL, fk_soc integer NOT NULL, - datec timestamp, -- date de creation de la facture - datef date, -- date de la facture + datec timestamp without time zone, -- date de creation de la facture + datef date, -- date de la facture libelle varchar(255), - paye smallint default 0 NOT NULL, - amount real default 0 NOT NULL, - remise real default 0, - tva real default 0, - total real default 0, - total_ht real default 0, - total_tva real default 0, - total_ttc real default 0, - fk_statut smallint default 0 NOT NULL, - fk_user_author integer, -- createur de la propale + paye smallint DEFAULT 0 NOT NULL, + amount real DEFAULT 0 NOT NULL, + remise real DEFAULT 0, + tva real DEFAULT 0, + total real DEFAULT 0, + total_ht real DEFAULT 0, + total_tva real DEFAULT 0, + total_ttc real DEFAULT 0, + + fk_statut smallint DEFAULT 0 NOT NULL, + + fk_user_author integer, -- createur de la propale fk_user_valid integer, -- valideur de la propale note text ); diff --git a/pgsql/tables/llx_facture_fourn_det.sql b/pgsql/tables/llx_facture_fourn_det.sql index 18585901ffb..2ebb68bdbdb 100644 --- a/pgsql/tables/llx_facture_fourn_det.sql +++ b/pgsql/tables/llx_facture_fourn_det.sql @@ -27,10 +27,10 @@ create table llx_facture_fourn_det fk_facture_fourn integer NOT NULL, fk_product integer NULL, description text, - pu_ht real default 0, - qty smallint default 1, - total_ht real default 0, - tva_taux real default 0, - tva real default 0, - total_ttc real default 0 + pu_ht real DEFAULT 0, + qty smallint DEFAULT 1, + total_ht real DEFAULT 0, + tva_taux real DEFAULT 0, + tva real DEFAULT 0, + total_ttc real DEFAULT 0 ); diff --git a/pgsql/tables/llx_facture_rec.sql b/pgsql/tables/llx_facture_rec.sql index 928699e4ec7..e19a93a352f 100644 --- a/pgsql/tables/llx_facture_rec.sql +++ b/pgsql/tables/llx_facture_rec.sql @@ -23,19 +23,22 @@ create table llx_facture_rec ( - rowid SERIAL PRIMARY KEY, + rowid SERIAL PRIMARY KEY, titre varchar(50) NOT NULL, - fk_soc integer NOT NULL, - datec timestamp, -- date de creation - amount real default 0 NOT NULL, - remise real default 0, - remise_percent real default 0, - tva real default 0, - total real default 0, - total_ttc real default 0, + fk_soc integer NOT NULL, + datec timestamp without time zone, -- date de creation + + amount real DEFAULT 0 NOT NULL, + remise real DEFAULT 0, + remise_percent real DEFAULT 0, + tva real DEFAULT 0, + total real DEFAULT 0, + total_ttc real DEFAULT 0, + fk_user_author integer, -- createur fk_projet integer, -- projet auquel est associé la facture fk_cond_reglement integer, -- condition de reglement + note text ); diff --git a/pgsql/tables/llx_facturedet.sql b/pgsql/tables/llx_facturedet.sql index 11dae90f513..fc612361fe9 100644 --- a/pgsql/tables/llx_facturedet.sql +++ b/pgsql/tables/llx_facturedet.sql @@ -26,16 +26,16 @@ create table llx_facturedet ( rowid SERIAL PRIMARY KEY, fk_facture integer NOT NULL, - fk_product integer NOT NULL DEFAULT 0, + fk_product integer DEFAULT 0 NOT NULL, description text, - tva_taux real default 19.6, -- taux tva + tva_taux real DEFAULT 19.6, -- taux tva qty real, -- quantité - remise_percent real default 0, -- pourcentage de remise - remise real default 0, -- montant de la remise + 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 - date_start timestamp, -- date debut si service - date_end timestamp -- date fin si service + date_start timestamp without time zone, -- date debut si service + date_end timestamp without time zone -- date fin si service ); CREATE INDEX llx_facturedet_fk_facture ON llx_facturedet (fk_facture); diff --git a/pgsql/tables/llx_facturedet_rec.sql b/pgsql/tables/llx_facturedet_rec.sql index 688005a7f23..ec7943e8745 100644 --- a/pgsql/tables/llx_facturedet_rec.sql +++ b/pgsql/tables/llx_facturedet_rec.sql @@ -27,10 +27,10 @@ create table llx_facturedet_rec fk_facture integer NOT NULL, fk_product integer, description text, - tva_taux real default 19.6, -- taux tva - qty real, -- quantité - 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 + tva_taux real DEFAULT 19.6, -- taux tva + qty real, -- quantité + 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 ); diff --git a/pgsql/tables/llx_fichinter.sql b/pgsql/tables/llx_fichinter.sql index 862e54cbf9d..3d85d13b792 100644 --- a/pgsql/tables/llx_fichinter.sql +++ b/pgsql/tables/llx_fichinter.sql @@ -26,14 +26,14 @@ create table llx_fichinter ( rowid SERIAL PRIMARY KEY, fk_soc integer NOT NULL, - fk_projet integer default 0, -- projet auquel est rattache la fiche + fk_projet integer DEFAULT 0, -- projet auquel est rattache la fiche ref varchar(30) NOT NULL, -- number - datec timestamp, -- date de creation - date_valid timestamp, -- date de validation + datec timestamp without time zone, -- date de creation + date_valid timestamp without time zone, -- date de validation datei date, -- date de l'intervention fk_user_author integer, -- createur de la fiche fk_user_valid integer, -- valideur de la fiche - fk_statut smallint default 0, + fk_statut smallint DEFAULT 0, duree real, note text ); diff --git a/pgsql/tables/llx_groupart.sql b/pgsql/tables/llx_groupart.sql index b28dbdfc828..28d5009e8fc 100644 --- a/pgsql/tables/llx_groupart.sql +++ b/pgsql/tables/llx_groupart.sql @@ -26,8 +26,8 @@ create table llx_groupart rowid SERIAL PRIMARY KEY, osc_id integer NOT NULL, tms timestamp, - nom varchar(64), - groupart CHAR(8) CHECK (groupart IN ('artiste','groupe')) NOT NULL, + nom varchar(64), + groupart CHAR(8) CHECK (groupart IN ('artiste','groupe')) NOT NULL, description text NOT NULL, fk_user_author integer ); diff --git a/pgsql/tables/llx_groupesociete.sql b/pgsql/tables/llx_groupesociete.sql index e1b38e4424e..124a4befffe 100644 --- a/pgsql/tables/llx_groupesociete.sql +++ b/pgsql/tables/llx_groupesociete.sql @@ -26,10 +26,10 @@ create table llx_groupesociete rowid serial PRIMARY KEY, parent integer UNIQUE, tms timestamp, - datec timestamp, -- creation date + datec timestamp without time zone, -- creation date nom varchar(60), -- company name note text, -- - remise real default 0, -- remise systématique pour le client + remise real DEFAULT 0, -- remise systématique pour le client fk_user_author integer ) diff --git a/pgsql/tables/llx_groupesociete_remise.sql b/pgsql/tables/llx_groupesociete_remise.sql index ad45254554a..3be10274c27 100644 --- a/pgsql/tables/llx_groupesociete_remise.sql +++ b/pgsql/tables/llx_groupesociete_remise.sql @@ -28,9 +28,9 @@ create table llx_groupesociete_remise rowid serial PRIMARY KEY, fk_groupe 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 real default 0, -- remise systématique pour le client + remise real DEFAULT 0, -- remise systématique pour le client note text ); diff --git a/pgsql/tables/llx_livre.sql b/pgsql/tables/llx_livre.sql index 6b9fc0ac81f..588b8ef1df7 100644 --- a/pgsql/tables/llx_livre.sql +++ b/pgsql/tables/llx_livre.sql @@ -27,15 +27,15 @@ create table llx_livre oscid integer NOT NULL, tms timestamp, status smallint, - date_ajout timestamp, - ref varchar(12), - title varchar(64), - annee smallint, + date_ajout timestamp without time zone, + ref varchar(12), + title varchar(64), + annee smallint, description text, prix decimal(15,4), fk_editeur integer, fk_user_author integer, - frais_de_port smallint default 1, + frais_de_port smallint DEFAULT 1, UNIQUE(ref) diff --git a/pgsql/tables/llx_newsletter.sql b/pgsql/tables/llx_newsletter.sql index cbddbc8dd23..ddffc6fe5c5 100644 --- a/pgsql/tables/llx_newsletter.sql +++ b/pgsql/tables/llx_newsletter.sql @@ -24,7 +24,7 @@ create table llx_newsletter ( rowid SERIAL PRIMARY KEY, - datec timestamp, + datec timestamp without time zone, tms timestamp, email_subject varchar(32) NOT NULL, email_from_name varchar(255) NOT NULL, @@ -33,12 +33,12 @@ create table llx_newsletter email_body text, target smallint, sql_target text, - status smallint NOT NULL DEFAULT 0, - date_send_request timestamp, -- debut de l'envoi demandé - date_send_begin timestamp, -- debut de l'envoi - date_send_end timestamp, -- fin de l'envoi - nbsent integer, -- nombre de mails envoyés - nberror integer, -- nombre de mails envoyés + status smallint DEFAULT 0 NOT NULL, + date_send_request timestamp without time zone, -- debut de l'envoi demandé + date_send_begin timestamp without time zone, -- debut de l'envoi + date_send_end timestamp without time zone, -- fin de l'envoi + nbsent integer, -- nombre de mails envoyés + nberror integer, -- nombre de mails envoyés fk_user_author integer, fk_user_valid integer, fk_user_modif integer diff --git a/pgsql/tables/llx_notify.sql b/pgsql/tables/llx_notify.sql index f59953f4001..b81f72ddb43 100644 --- a/pgsql/tables/llx_notify.sql +++ b/pgsql/tables/llx_notify.sql @@ -25,9 +25,9 @@ create table llx_notify ( rowid SERIAL PRIMARY KEY, tms timestamp, - daten timestamp, -- date de la notification + daten timestamp without time zone, -- date de la notification fk_action integer NOT NULL, fk_contact integer NOT NULL, - objet_type CHAR(10) CHECK (objet_type IN ('ficheinter','facture','propale')), + objet_type CHAR(10) CHECK (objet_type IN ('ficheinter','facture','propale')), objet_id integer NOT NULL ); diff --git a/pgsql/tables/llx_paiement.sql b/pgsql/tables/llx_paiement.sql index 211d15a8a44..6712d39d71d 100644 --- a/pgsql/tables/llx_paiement.sql +++ b/pgsql/tables/llx_paiement.sql @@ -24,15 +24,15 @@ create table llx_paiement ( rowid SERIAL PRIMARY KEY, fk_facture integer, - datec timestamp, + datec timestamp without time zone, -- date de creation tms timestamp, - datep timestamp, -- payment date - amount real default 0, + datep timestamp without time zone, -- payment date + amount real DEFAULT 0, author varchar(50), fk_paiement integer NOT NULL, num_paiement varchar(50), note text, fk_bank integer NOT NULL, - fk_user_creat integer, -- utilisateur qui a créé l'info - fk_user_modif integer -- utilisateur qui a modifié l'info + fk_user_creat integer, -- utilisateur qui a créé l'info + fk_user_modif integer -- utilisateur qui a modifié l'info ); diff --git a/pgsql/tables/llx_paiement_facture.sql b/pgsql/tables/llx_paiement_facture.sql index 419823ae30e..f2adc28fe8d 100644 --- a/pgsql/tables/llx_paiement_facture.sql +++ b/pgsql/tables/llx_paiement_facture.sql @@ -26,7 +26,7 @@ create table llx_paiement_facture rowid serial PRIMARY KEY, fk_paiement integer, fk_facture integer, - amount real default 0 + amount real DEFAULT 0 ); CREATE INDEX llx_paiement_facture_fk_paiement ON llx_paiement_facture(fk_paiement); diff --git a/pgsql/tables/llx_paiementcharge.sql b/pgsql/tables/llx_paiementcharge.sql index ba1660db0c1..48dea389d45 100644 --- a/pgsql/tables/llx_paiementcharge.sql +++ b/pgsql/tables/llx_paiementcharge.sql @@ -25,10 +25,10 @@ create table llx_paiementcharge ( rowid serial PRIMARY KEY, fk_charge integer, - datec timestamp, -- date de creation + datec timestamp without time zone, -- date de creation tms timestamp, - datep timestamp, -- payment date - amount real default 0, + datep timestamp without time zone, -- payment date + amount real DEFAULT 0, fk_typepaiement integer NOT NULL, num_paiement varchar(50), note text, diff --git a/pgsql/tables/llx_paiementfourn.sql b/pgsql/tables/llx_paiementfourn.sql index 414ccc8d4f1..579b15535f2 100644 --- a/pgsql/tables/llx_paiementfourn.sql +++ b/pgsql/tables/llx_paiementfourn.sql @@ -25,13 +25,13 @@ create table llx_paiementfourn ( rowid SERIAL PRIMARY KEY, tms timestamp, - datec timestamp, -- date de creation de l'enregistrement - fk_facture_fourn integer, -- facture - datep timestamp, -- date de paiement - amount real default 0, -- montant - fk_user_author integer, -- auteur - fk_paiement integer NOT NULL, -- moyen de paiement - num_paiement varchar(50), -- numéro de paiement (cheque) + datec timestamp without time zone, -- date de creation de l'enregistrement + fk_facture_fourn integer, -- facture + datep timestamp without time zone, -- date de paiement + amount real DEFAULT 0, -- montant + fk_user_author integer, -- auteur + fk_paiement integer NOT NULL, -- moyen de paiement + num_paiement varchar(50), -- numéro de paiement (cheque) note text, fk_bank integer NOT NULL ); diff --git a/pgsql/tables/llx_pointmort.sql b/pgsql/tables/llx_pointmort.sql index 73ce117460b..2fcacdbfd83 100644 --- a/pgsql/tables/llx_pointmort.sql +++ b/pgsql/tables/llx_pointmort.sql @@ -22,7 +22,7 @@ create table llx_pointmort ( - month timestamp, + month timestamp without time zone, amount real ); diff --git a/pgsql/tables/llx_product.sql b/pgsql/tables/llx_product.sql index fad2ada12c2..cccb0ea920f 100644 --- a/pgsql/tables/llx_product.sql +++ b/pgsql/tables/llx_product.sql @@ -23,20 +23,20 @@ create table llx_product ( - rowid SERIAL PRIMARY KEY, - datec timestamp, - tms timestamp, - ref varchar(15), - label varchar(255), - description text, - price double precision, - tva_tx double precision default 19.6, - fk_user_author integer, - envente smallint default 1, - nbvente integer default 0, - fk_product_type integer default 0, - duration varchar(6), - stock_propale integer default 0, - stock_commande integer default 0, - seuil_stock_alerte integer default 0 + rowid SERIAL PRIMARY KEY, + datec timestamp without time zone, + tms timestamp, + ref varchar(15) UNIQUE, + label varchar(255), + description text, + price double precision, + tva_tx double precision DEFAULT 19.6, + fk_user_author integer, + envente smallint DEFAULT 1, + nbvente integer DEFAULT 0, + fk_product_type integer DEFAULT 0, + duration varchar(6), + stock_propale integer DEFAULT 0, + stock_commande integer DEFAULT 0, + seuil_stock_alerte integer DEFAULT 0 ); diff --git a/pgsql/tables/llx_product_fournisseur.sql b/pgsql/tables/llx_product_fournisseur.sql index a749157fae7..77b84780874 100644 --- a/pgsql/tables/llx_product_fournisseur.sql +++ b/pgsql/tables/llx_product_fournisseur.sql @@ -24,7 +24,7 @@ create table llx_product_fournisseur ( rowid SERIAL PRIMARY KEY, - datec timestamp, + datec timestamp without time zone, tms timestamp, fk_product integer, fk_soc integer, diff --git a/pgsql/tables/llx_product_price.sql b/pgsql/tables/llx_product_price.sql index 178160d94a6..e60fcadd5c1 100644 --- a/pgsql/tables/llx_product_price.sql +++ b/pgsql/tables/llx_product_price.sql @@ -26,10 +26,10 @@ create table llx_product_price rowid SERIAL PRIMARY KEY, tms timestamp, fk_product integer NOT NULL, - date_price timestamp NOT NULL, + date_price timestamp without time zone NOT NULL, price double precision, - tva_tx double precision default 19.6, + tva_tx double precision DEFAULT 19.6, fk_user_author integer, - envente smallint default 1 + envente smallint DEFAULT 1 ); diff --git a/pgsql/tables/llx_product_stock.sql b/pgsql/tables/llx_product_stock.sql index 456e448cba7..35846b38022 100644 --- a/pgsql/tables/llx_product_stock.sql +++ b/pgsql/tables/llx_product_stock.sql @@ -27,7 +27,7 @@ create table llx_product_stock tms timestamp, fk_product integer NOT NULL, fk_stock integer NOT NULL, - reel integer + reel integer --stock réel ); CREATE INDEX llx_product_stock_fk_product ON llx_product_stock (fk_product); diff --git a/pgsql/tables/llx_projet.sql b/pgsql/tables/llx_projet.sql index 7376e199497..e07bfe07337 100644 --- a/pgsql/tables/llx_projet.sql +++ b/pgsql/tables/llx_projet.sql @@ -28,11 +28,11 @@ create table llx_projet fk_soc integer NOT NULL, fk_statut smallint NOT NULL, tms timestamp, - dateo date, -- date d'ouverture du projet + 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 + fk_user_resp integer, -- responsable du projet + fk_user_creat integer, -- createur du projet note text ); diff --git a/pgsql/tables/llx_propaldet.sql b/pgsql/tables/llx_propaldet.sql index f30f635d3c0..a612953cb06 100644 --- a/pgsql/tables/llx_propaldet.sql +++ b/pgsql/tables/llx_propaldet.sql @@ -24,14 +24,14 @@ create table llx_propaldet ( - rowid SERIAL PRIMARY KEY, - fk_propal integer, - fk_product integer, + rowid SERIAL PRIMARY KEY, + fk_propal integer, + fk_product integer, description text, - tva_tx real default 19.6, -- taux tva - qty real, -- quantité - 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é + 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 );