From 595958d1e81762f38b29ff9e56d9f520e188319c Mon Sep 17 00:00:00 2001 From: opensides Date: Sat, 9 Oct 2004 00:06:52 +0000 Subject: [PATCH] nouvelle version des tables posgtresql beautification du code, tout les parametres en MAJUSCULES --- mysql/tables/llx_actioncomm.sql | 2 +- mysql/tables/llx_album.sql | 6 +++--- mysql/tables/llx_auteur.sql | 2 +- mysql/tables/llx_bank_account.sql | 4 ++-- mysql/tables/llx_bank_class.sql | 4 ++-- mysql/tables/llx_c_actioncomm.sql | 6 +++--- mysql/tables/llx_c_ape.sql | 2 +- mysql/tables/llx_c_chargesociales.sql | 4 ++-- mysql/tables/llx_c_civilite.sql | 2 +- mysql/tables/llx_c_departements.sql | 14 +++++++------- mysql/tables/llx_c_effectif.sql | 4 ++-- mysql/tables/llx_cash_account.sql | 4 ++-- pgsql/tables/llx_actioncomm.sql | 2 +- pgsql/tables/llx_adherent.sql | 6 +++--- pgsql/tables/llx_appro.sql | 2 +- pgsql/tables/llx_auteur.sql | 2 +- pgsql/tables/llx_bank.sql | 3 +-- pgsql/tables/llx_bank_account.sql | 12 ++++++------ pgsql/tables/llx_bank_class.sql | 4 ++-- pgsql/tables/llx_bookmark.sql | 2 +- pgsql/tables/llx_bookmark4u_login.sql | 2 +- pgsql/tables/llx_c_accountingsystem.sql | 1 + pgsql/tables/llx_c_actioncomm.sql | 8 ++++---- pgsql/tables/llx_c_ape.sql | 2 +- pgsql/tables/llx_c_chargesociales.sql | 4 ++-- pgsql/tables/llx_c_civilite.sql | 4 ++-- pgsql/tables/llx_c_departements.sql | 16 ++++++++-------- pgsql/tables/llx_c_effectif.sql | 2 +- pgsql/tables/llx_c_regions.sql | 6 +++--- pgsql/tables/llx_cash_account.sql | 6 +++--- 30 files changed, 69 insertions(+), 69 deletions(-) diff --git a/mysql/tables/llx_actioncomm.sql b/mysql/tables/llx_actioncomm.sql index 913df6d0433..c29b90d6454 100644 --- a/mysql/tables/llx_actioncomm.sql +++ b/mysql/tables/llx_actioncomm.sql @@ -25,7 +25,7 @@ create table llx_actioncomm ( id integer AUTO_INCREMENT PRIMARY KEY, - datea datetime, -- action date + datea timestamp without time zone, -- action date fk_action integer, label varchar(50), -- libelle de l'action fk_soc integer, diff --git a/mysql/tables/llx_album.sql b/mysql/tables/llx_album.sql index 0b626fb4135..1b304b952e2 100644 --- a/mysql/tables/llx_album.sql +++ b/mysql/tables/llx_album.sql @@ -25,9 +25,9 @@ create table llx_album rowid integer AUTO_INCREMENT PRIMARY KEY, osc_id integer NOT NULL, tms timestamp, - ref varchar(12), - title varchar(64), - annee smallint(64), + ref varchar(12), + title varchar(64), + annee smallint(64), description text, collectif tinyint, fk_user_author integer diff --git a/mysql/tables/llx_auteur.sql b/mysql/tables/llx_auteur.sql index 7a54b458c1c..98021250a19 100644 --- a/mysql/tables/llx_auteur.sql +++ b/mysql/tables/llx_auteur.sql @@ -25,6 +25,6 @@ create table llx_auteur rowid integer AUTO_INCREMENT PRIMARY KEY, oscid integer NOT NULL, tms timestamp, - nom varchar(255), + nom varchar(255), fk_user_author integer )type=innodb; diff --git a/mysql/tables/llx_bank_account.sql b/mysql/tables/llx_bank_account.sql index 79b90d37efa..d5f88d913fb 100644 --- a/mysql/tables/llx_bank_account.sql +++ b/mysql/tables/llx_bank_account.sql @@ -41,7 +41,7 @@ create table llx_bank_account domiciliation varchar(255), proprio varchar(60), adresse_proprio varchar(255), - courant smallint default 0 not null, - clos smallint default 0 not null, + courant smallint DEFAULT 0 NOT NULL, + clos smallint DEFAULT 0 NOT NULL, account_number varchar(8) )type=innodb; diff --git a/mysql/tables/llx_bank_class.sql b/mysql/tables/llx_bank_class.sql index f9ea052fa6c..391bee94eed 100644 --- a/mysql/tables/llx_bank_class.sql +++ b/mysql/tables/llx_bank_class.sql @@ -20,8 +20,8 @@ create table llx_bank_class ( - lineid integer not null, - fk_categ integer not null, + lineid integer NOT NULL, + fk_categ integer NOT NULL, INDEX(lineid) )type=innodb; diff --git a/mysql/tables/llx_c_actioncomm.sql b/mysql/tables/llx_c_actioncomm.sql index 4075ebee6e6..480a6a6626b 100644 --- a/mysql/tables/llx_c_actioncomm.sql +++ b/mysql/tables/llx_c_actioncomm.sql @@ -24,9 +24,9 @@ create table llx_c_actioncomm ( id integer PRIMARY KEY, - code varchar(12) UNIQUE NOT NULL, - type varchar(10) default 'system' not null, + code varchar(12) UNIQUE NOT NULL, + type varchar(10) DEFAULT 'system' NOT NULL, libelle varchar(30) NOT NULL, - active tinyint default 1 NOT NULL, + active tinyint DEFAULT 1 NOT NULL, todo tinyint )type=innodb; diff --git a/mysql/tables/llx_c_ape.sql b/mysql/tables/llx_c_ape.sql index 5c7b870ff38..2646b47f3f6 100644 --- a/mysql/tables/llx_c_ape.sql +++ b/mysql/tables/llx_c_ape.sql @@ -26,6 +26,6 @@ create table llx_c_ape rowid integer AUTO_INCREMENT UNIQUE, code_ape varchar(5) PRIMARY KEY, libelle varchar(255), - active tinyint default 1 NOT NULL + active tinyint DEFAULT 1 NOT NULL )type=innodb; diff --git a/mysql/tables/llx_c_chargesociales.sql b/mysql/tables/llx_c_chargesociales.sql index 890fa9dae0f..0c3fcf560d9 100644 --- a/mysql/tables/llx_c_chargesociales.sql +++ b/mysql/tables/llx_c_chargesociales.sql @@ -25,8 +25,8 @@ create table llx_c_chargesociales ( id integer PRIMARY KEY, libelle varchar(80), - deductible smallint NOT NULL default 0, - active tinyint default 1 NOT NULL + deductible smallint NOT NULL DEFAULT 0, + active tinyint DEFAULT 1 NOT NULL )type=innodb; diff --git a/mysql/tables/llx_c_civilite.sql b/mysql/tables/llx_c_civilite.sql index b2cd98ee241..7af4ba3660a 100644 --- a/mysql/tables/llx_c_civilite.sql +++ b/mysql/tables/llx_c_civilite.sql @@ -25,6 +25,6 @@ create table llx_c_civilite rowid integer PRIMARY KEY, code varchar(6) UNIQUE NOT NULL, civilite varchar(50), - active tinyint default 1 NOT NULL + active tinyint DEFAULT 1 NOT NULL )type=innodb; diff --git a/mysql/tables/llx_c_departements.sql b/mysql/tables/llx_c_departements.sql index bb3fa20a9a6..8ea96334e0d 100644 --- a/mysql/tables/llx_c_departements.sql +++ b/mysql/tables/llx_c_departements.sql @@ -23,14 +23,14 @@ create table llx_c_departements ( - rowid integer AUTO_INCREMENT PRIMARY KEY, + rowid integer AUTO_INCREMENT PRIMARY KEY, code_departement varchar(6) NOT NULL, - fk_region integer, - cheflieu varchar(7), - tncc integer, - ncc varchar(50), - nom varchar(50), - active tinyint default 1 NOT NULL, + fk_region integer, + cheflieu varchar(7), + tncc integer, + ncc varchar(50), + nom varchar(50), + active tinyint DEFAULT 1 NOT NULL, key (fk_region) )type=innodb; diff --git a/mysql/tables/llx_c_effectif.sql b/mysql/tables/llx_c_effectif.sql index 369a75d673d..5cba9f31975 100644 --- a/mysql/tables/llx_c_effectif.sql +++ b/mysql/tables/llx_c_effectif.sql @@ -24,8 +24,8 @@ create table llx_c_effectif ( id integer PRIMARY KEY, - code varchar(12) UNIQUE NOT NULL, + code varchar(12) UNIQUE NOT NULL, libelle varchar(30), - active tinyint default 1 NOT NULL + active tinyint DEFAULT 1 NOT NULL )type=innodb; diff --git a/mysql/tables/llx_cash_account.sql b/mysql/tables/llx_cash_account.sql index 55a340a8070..28eab106ffb 100644 --- a/mysql/tables/llx_cash_account.sql +++ b/mysql/tables/llx_cash_account.sql @@ -30,7 +30,7 @@ create table llx_cash_account datec datetime, tms timestamp, label varchar(30), - courant smallint default 0 not null, - clos smallint default 0 not null, + courant smallint DEFAULT 0 NOT NULL, + clos smallint DEFAULT 0 NOT NULL, account_number varchar(8) )type=innodb; diff --git a/pgsql/tables/llx_actioncomm.sql b/pgsql/tables/llx_actioncomm.sql index 42c27f03ed2..be36d25936f 100644 --- a/pgsql/tables/llx_actioncomm.sql +++ b/pgsql/tables/llx_actioncomm.sql @@ -26,7 +26,7 @@ create table llx_actioncomm ( id SERIAL PRIMARY KEY, - datea timestamp, -- action date + datea timestamp without time zone, -- action date fk_action integer, label varchar(50), -- libelle de l'action fk_soc integer, diff --git a/pgsql/tables/llx_adherent.sql b/pgsql/tables/llx_adherent.sql index 12e7e4ec5ab..e7de3bb0e52 100644 --- a/pgsql/tables/llx_adherent.sql +++ b/pgsql/tables/llx_adherent.sql @@ -32,8 +32,8 @@ create table llx_adherent public smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ? fk_adherent_type smallint, morphy CHAR(3) CHECK (morphy IN ('mor','phy')) NOT NULL, -- personne morale / personne physique - datevalid timestamp, -- date de validation - datec timestamp, -- date de creation + datevalid timestamp without time zone, -- date de validation + datec timestamp without time zone, -- date de creation prenom varchar(50), nom varchar(50), societe varchar(50), @@ -49,7 +49,7 @@ create table llx_adherent fk_user_author integer NOT NULL, fk_user_mod integer NOT NULL, fk_user_valid integer NOT NULL, - datefin timestamp NOT NULL, -- date de fin de validité de la cotisation + datefin timestamp without time zone NOT NULL, -- date de fin de validité de la cotisation note text ); diff --git a/pgsql/tables/llx_appro.sql b/pgsql/tables/llx_appro.sql index 93e67372d9e..bf30cc230cb 100644 --- a/pgsql/tables/llx_appro.sql +++ b/pgsql/tables/llx_appro.sql @@ -24,7 +24,7 @@ create table llx_appro ( rowid SERIAL PRIMARY KEY, - datec timestamp, + datec timestamp without time zone, tms timestamp, fk_product integer NOT NULL, quantity smallint NOT NULL, diff --git a/pgsql/tables/llx_auteur.sql b/pgsql/tables/llx_auteur.sql index 78d08ab99fc..c0c02908592 100644 --- a/pgsql/tables/llx_auteur.sql +++ b/pgsql/tables/llx_auteur.sql @@ -26,6 +26,6 @@ create table llx_auteur rowid SERIAL PRIMARY KEY, oscid integer NOT NULL, tms timestamp, - nom varchar(255), + nom varchar(255), fk_user_author integer ); diff --git a/pgsql/tables/llx_bank.sql b/pgsql/tables/llx_bank.sql index 64b8e339be2..ec041b93778 100644 --- a/pgsql/tables/llx_bank.sql +++ b/pgsql/tables/llx_bank.sql @@ -26,7 +26,7 @@ create table llx_bank ( rowid SERIAL PRIMARY KEY, - datec timestamp, + datec timestamp without time zone, datev date, -- date de valeur dateo date, -- date operation amount real NOT NULL default 0, @@ -43,4 +43,3 @@ create table llx_bank author varchar(40) -- a supprimer apres migration ); - diff --git a/pgsql/tables/llx_bank_account.sql b/pgsql/tables/llx_bank_account.sql index 5aec39bf4be..9f3224887b4 100644 --- a/pgsql/tables/llx_bank_account.sql +++ b/pgsql/tables/llx_bank_account.sql @@ -26,20 +26,20 @@ create table llx_bank_account ( rowid SERIAL PRIMARY KEY, - datec timestamp, + datec timestamp without time zone, tms timestamp, label varchar(30), - bank varchar(255), - code_banque varchar(7), + bank varchar(60), + code_banque varchar(7), code_guichet varchar(6), number varchar(255), cle_rib varchar(5), bic varchar(10), iban_prefix varchar(5), - domiciliation varchar(50), + domiciliation varchar(255), proprio varchar(60), adresse_proprio varchar(255), - courant smallint default 0 not null, - clos smallint default 0 not null, + courant smallint DEFAULT 0 NOT NULL, + clos smallint DEFAULT 0 NOT NULL, account_number varchar(8) ); diff --git a/pgsql/tables/llx_bank_class.sql b/pgsql/tables/llx_bank_class.sql index 9def1d0a2fa..9e582ff2a3f 100644 --- a/pgsql/tables/llx_bank_class.sql +++ b/pgsql/tables/llx_bank_class.sql @@ -22,8 +22,8 @@ create table llx_bank_class ( - lineid SERIAL, - fk_categ integer not null + lineid integer NOT NULL, + fk_categ integer NOT NULL ); create index llx_bank_class_lineid on llx_bank_class(lineid); diff --git a/pgsql/tables/llx_bookmark.sql b/pgsql/tables/llx_bookmark.sql index 0d7a065fb03..4018a56e842 100644 --- a/pgsql/tables/llx_bookmark.sql +++ b/pgsql/tables/llx_bookmark.sql @@ -26,5 +26,5 @@ create table llx_bookmark rowid SERIAL PRIMARY KEY, fk_soc integer, fk_user integer, - dateb timestamp + dateb timestamp without time zone ); diff --git a/pgsql/tables/llx_bookmark4u_login.sql b/pgsql/tables/llx_bookmark4u_login.sql index b375ccfa8ec..44f82cda392 100644 --- a/pgsql/tables/llx_bookmark4u_login.sql +++ b/pgsql/tables/llx_bookmark4u_login.sql @@ -25,5 +25,5 @@ create table llx_bookmark4u_login ( rowid serial PRIMARY KEY, fk_user integer, - bk4u_uid integer + bk4u_uid integer, ); diff --git a/pgsql/tables/llx_c_accountingsystem.sql b/pgsql/tables/llx_c_accountingsystem.sql index 66fd58012f2..2fcf8a3e0a5 100644 --- a/pgsql/tables/llx_c_accountingsystem.sql +++ b/pgsql/tables/llx_c_accountingsystem.sql @@ -27,6 +27,7 @@ create table llx_c_accountingsystem fk_pays integer NOT NULL, pcg_version varchar(12) NOT NULL, pcg_type varchar(20) NOT NULL, + pcg_subtype varchar(20) NOT NULL, label varchar(128) NOT NULL, account_number varchar(20) NOT NULL ); diff --git a/pgsql/tables/llx_c_actioncomm.sql b/pgsql/tables/llx_c_actioncomm.sql index 37795bebc28..d81f7a1e2cd 100644 --- a/pgsql/tables/llx_c_actioncomm.sql +++ b/pgsql/tables/llx_c_actioncomm.sql @@ -25,10 +25,10 @@ create table llx_c_actioncomm ( id SERIAL PRIMARY KEY, - code varchar(12) unique not null, - type varchar(10) default 'system' not null, - libelle varchar(30) not null, - active smallint default 1 not null, + code varchar(12) UNIQUE NOT NULL, + type varchar(10) DEFAULT 'system' NOT NULL, + libelle varchar(30) NOT NULL, + active smallint DEFAULT 1 NOT NULL, todo smallint ); diff --git a/pgsql/tables/llx_c_ape.sql b/pgsql/tables/llx_c_ape.sql index de156b0ecd8..06e79a3cb9b 100644 --- a/pgsql/tables/llx_c_ape.sql +++ b/pgsql/tables/llx_c_ape.sql @@ -26,6 +26,6 @@ create table llx_c_ape rowid serial UNIQUE, code_ape varchar(5) PRIMARY KEY, libelle varchar(255), - active smallint default 1 not null + active smallint DEFAULT 1 NOT NULL ); diff --git a/pgsql/tables/llx_c_chargesociales.sql b/pgsql/tables/llx_c_chargesociales.sql index 5a5ade97bf9..df86f98db10 100644 --- a/pgsql/tables/llx_c_chargesociales.sql +++ b/pgsql/tables/llx_c_chargesociales.sql @@ -25,8 +25,8 @@ create table llx_c_chargesociales ( id SERIAL PRIMARY KEY, libelle varchar(80), - deductible integer NOT NULL default 0, - active integer default 1 NOT NULL + deductible integer DEFAULT 0 NOT NULL, + active integer DEFAULT 1 NOT NULL ); diff --git a/pgsql/tables/llx_c_civilite.sql b/pgsql/tables/llx_c_civilite.sql index ed512d890b1..9d027cf5c7f 100644 --- a/pgsql/tables/llx_c_civilite.sql +++ b/pgsql/tables/llx_c_civilite.sql @@ -22,8 +22,8 @@ create table llx_c_civilite ( rowid serial PRIMARY KEY, - code varchar(6) unique not null, + code varchar(6) UNIQUE NOT NULL, civilite varchar(50), - active smallint default 1 + active smallint DEFAULT 1 NOT NULL ); diff --git a/pgsql/tables/llx_c_departements.sql b/pgsql/tables/llx_c_departements.sql index 025aeb47ffe..3715d8ac8e6 100644 --- a/pgsql/tables/llx_c_departements.sql +++ b/pgsql/tables/llx_c_departements.sql @@ -23,14 +23,14 @@ create table llx_c_departements ( - rowid serial PRIMARY KEY, - code_departement varchar(6) not null, - fk_region integer, - cheflieu varchar(7), - tncc integer, - ncc varchar(50), - nom varchar(50), - active smallint default 1 not null + rowid serial PRIMARY KEY, + code_departement varchar(6) NOT NULL, + fk_region integer, + cheflieu varchar(7), + tncc integer, + ncc varchar(50), + nom varchar(50), + active smallint DEFAULT 1 NOT NULL ); CREATE INDEX llx_c_departements_fk_region ON llx_c_departements(fk_region); diff --git a/pgsql/tables/llx_c_effectif.sql b/pgsql/tables/llx_c_effectif.sql index 6c29a011e7d..12510614560 100644 --- a/pgsql/tables/llx_c_effectif.sql +++ b/pgsql/tables/llx_c_effectif.sql @@ -1 +1 @@ --- ======================================================================== -- Copyright (C) 2004 Benoit Mortier -- -- 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_c_effectif ( id SERIAL PRIMARY KEY, code varchar(12) unique not null, libelle varchar(30), active integer default 1 not null ); \ No newline at end of file +-- ======================================================================== -- Copyright (C) 2004 Benoit Mortier -- -- 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_c_effectif ( id SERIAL PRIMARY KEY, code varchar(12) UNIQUE NOT NULL, libelle varchar(30), active integer DEFAULT 1 NOT NULL ); \ No newline at end of file diff --git a/pgsql/tables/llx_c_regions.sql b/pgsql/tables/llx_c_regions.sql index 266d7c9cc37..759c8f07b6a 100644 --- a/pgsql/tables/llx_c_regions.sql +++ b/pgsql/tables/llx_c_regions.sql @@ -24,11 +24,11 @@ create table llx_c_regions ( rowid serial PRIMARY KEY, - code_region integer UNIQUE not null, - fk_pays integer not null, + code_region integer UNIQUE NOT NULL, + fk_pays integer NOT NULL, cheflieu varchar(7), tncc integer, nom varchar(50), - active smallint default 1 not null + active smallint DEFAULT 1 NOT NULL ); diff --git a/pgsql/tables/llx_cash_account.sql b/pgsql/tables/llx_cash_account.sql index bc89048771b..967dbbe1ba1 100644 --- a/pgsql/tables/llx_cash_account.sql +++ b/pgsql/tables/llx_cash_account.sql @@ -28,10 +28,10 @@ create table llx_cash_account ( rowid SERIAL PRIMARY KEY, - datec timestamp, + datec timestamp without time zone, tms timestamp, label varchar(30), - courant smallint default 0 not null, - clos smallint default 0 not null, + courant smallint DEFAULT 0 NOT NULL, + clos smallint DEFAULT 0 NOT NULL, account_number varchar(8) );