From 220efb96b6d645350eb15f0147324a153ade65a8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 1 Sep 2007 13:25:36 +0000 Subject: [PATCH] =?UTF-8?q?D=E9but=20impl=E9mentation=20base=20MSSQL=20-?= =?UTF-8?q?=20merci=20=E0=20Simon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mssql/tables/llx_accountingtransaction.sql | 2 +- mssql/tables/llx_actioncomm.sql | 10 ++--- mssql/tables/llx_adherent.sql | 8 ++-- mssql/tables/llx_adherent_type.key.sql | 24 ++++++++++ mssql/tables/llx_adherent_type.sql | 2 +- mssql/tables/llx_bank.sql | 4 +- mssql/tables/llx_bank_account.sql | 2 +- mssql/tables/llx_bank_url.sql | 2 +- mssql/tables/llx_c_ecotaxe.sql | 32 +++++++++++++ mssql/tables/llx_c_pays.key.sql | 2 +- mssql/tables/llx_categorie.sql | 3 +- mssql/tables/llx_categorie_societe.key.sql | 28 ++++++++++++ mssql/tables/llx_categorie_societe.sql | 23 ++++++++++ mssql/tables/llx_chargesociales.sql | 2 +- mssql/tables/llx_commande.sql | 4 +- mssql/tables/llx_commande_fournisseur.sql | 2 +- mssql/tables/llx_commande_fournisseurdet.sql | 8 +++- mssql/tables/llx_compta.sql | 2 +- mssql/tables/llx_cotisation.key.sql | 23 ++++++++++ ...c_events.sql => llx_droitpret_rapport.sql} | 26 +++++------ mssql/tables/llx_entrepot_valorisation.sql | 2 +- mssql/tables/llx_expedition.sql | 2 +- mssql/tables/llx_facture.sql | 6 +-- mssql/tables/llx_facture_fourn.sql | 4 +- mssql/tables/llx_facture_rec.sql | 2 +- mssql/tables/llx_facture_stats.sql | 2 +- mssql/tables/llx_fichinterdet.sql | 2 +- mssql/tables/llx_livraison.sql | 2 +- mssql/tables/llx_menu.sql | 45 +++++++++++++++++++ mssql/tables/llx_menu_const.key.sql | 29 ++++++++++++ .../{llx_ventes.sql => llx_menu_const.sql} | 30 ++++++------- mssql/tables/llx_menu_constraint.sql | 27 +++++++++++ mssql/tables/llx_newsletter.sql | 45 ------------------- mssql/tables/llx_notify_def.sql | 2 +- mssql/tables/llx_projet.sql | 2 +- mssql/tables/llx_projet_task_time.sql | 2 +- mssql/tables/llx_propal.sql | 2 +- mssql/tables/llx_socpeople.sql | 2 +- mssql/tables/llx_texts.sql | 32 ------------- mssql/tables/llx_todocomm.sql | 38 ---------------- mssql/tables/llx_tva.sql | 4 +- mssql/tables/llx_voyage.sql | 2 +- mssql/tables/llx_voyage_reduc.sql | 6 +-- 43 files changed, 308 insertions(+), 191 deletions(-) create mode 100644 mssql/tables/llx_adherent_type.key.sql create mode 100644 mssql/tables/llx_c_ecotaxe.sql create mode 100644 mssql/tables/llx_categorie_societe.key.sql create mode 100644 mssql/tables/llx_categorie_societe.sql create mode 100644 mssql/tables/llx_cotisation.key.sql rename mssql/tables/{llx_soc_events.sql => llx_droitpret_rapport.sql} (51%) create mode 100644 mssql/tables/llx_menu.sql create mode 100644 mssql/tables/llx_menu_const.key.sql rename mssql/tables/{llx_ventes.sql => llx_menu_const.sql} (51%) create mode 100644 mssql/tables/llx_menu_constraint.sql delete mode 100644 mssql/tables/llx_newsletter.sql delete mode 100644 mssql/tables/llx_texts.sql delete mode 100644 mssql/tables/llx_todocomm.sql diff --git a/mssql/tables/llx_accountingtransaction.sql b/mssql/tables/llx_accountingtransaction.sql index 3256ee8c209..b78c1cd1105 100644 --- a/mssql/tables/llx_accountingtransaction.sql +++ b/mssql/tables/llx_accountingtransaction.sql @@ -23,7 +23,7 @@ create table llx_accountingtransaction ( rowid integer IDENTITY PRIMARY KEY, label varchar(128) NOT NULL, - datec datetime NOT NULL, + datec SMALLDATETIME NOT NULL, fk_author varchar(20) NOT NULL, tms timestamp, fk_facture integer, diff --git a/mssql/tables/llx_actioncomm.sql b/mssql/tables/llx_actioncomm.sql index ebabda29a68..f7f536e4207 100644 --- a/mssql/tables/llx_actioncomm.sql +++ b/mssql/tables/llx_actioncomm.sql @@ -26,11 +26,11 @@ create table llx_actioncomm ( id integer IDENTITY PRIMARY KEY, - datec datetime, -- SMALLDATETIME creation - datep datetime, -- SMALLDATETIME debut planifiee - datep2 datetime, -- SMALLDATETIME fin planifiee si action non ponctuelle - datea datetime, -- SMALLDATETIME debut realisation - datea2 datetime, -- SMALLDATETIME fin realisation si action non ponctuelle + datec SMALLDATETIME, -- SMALLDATETIME creation + datep SMALLDATETIME, -- SMALLDATETIME debut planifiee + datep2 SMALLDATETIME, -- SMALLDATETIME fin planifiee si action non ponctuelle + datea SMALLDATETIME, -- SMALLDATETIME debut realisation + datea2 SMALLDATETIME, -- SMALLDATETIME fin realisation si action non ponctuelle tms timestamp, -- SMALLDATETIME modif fk_action integer, -- type de l'action label varchar(50) NOT NULL, -- libelle de l'action diff --git a/mssql/tables/llx_adherent.sql b/mssql/tables/llx_adherent.sql index fe7f93f9720..df1aeaaa2e4 100644 --- a/mssql/tables/llx_adherent.sql +++ b/mssql/tables/llx_adherent.sql @@ -45,14 +45,14 @@ create table llx_adherent phone varchar(30), phone_perso varchar(30), phone_mobile varchar(30), - naiss datetime, -- SMALLDATETIME de naissance + naiss SMALLDATETIME, -- SMALLDATETIME de naissance photo varchar(255), -- url vers photo statut smallint NOT NULL DEFAULT 0, [public] smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils [public] ou pas ? - datefin datetime, -- SMALLDATETIME de fin de validité de la cotisation + datefin SMALLDATETIME, -- SMALLDATETIME de fin de validité de la cotisation note text, - datevalid datetime, -- SMALLDATETIME de validation - datec datetime, -- SMALLDATETIME de creation + datevalid SMALLDATETIME, -- SMALLDATETIME de validation + datec SMALLDATETIME, -- SMALLDATETIME de creation tms timestamp, -- SMALLDATETIME de modification fk_user_author integer NOT NULL, fk_user_mod integer NOT NULL, diff --git a/mssql/tables/llx_adherent_type.key.sql b/mssql/tables/llx_adherent_type.key.sql new file mode 100644 index 00000000000..8f5abbe1b71 --- /dev/null +++ b/mssql/tables/llx_adherent_type.key.sql @@ -0,0 +1,24 @@ +-- ============================================================================ +-- Copyright (C) 2007 Laurent Destailleur +-- +-- 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 UNIQUE INDEX uk_adherent_type_libelle ON llx_adherent_type(libelle); diff --git a/mssql/tables/llx_adherent_type.sql b/mssql/tables/llx_adherent_type.sql index bb67e53f571..cdbf09711be 100644 --- a/mssql/tables/llx_adherent_type.sql +++ b/mssql/tables/llx_adherent_type.sql @@ -30,7 +30,7 @@ create table llx_adherent_type rowid integer IDENTITY PRIMARY KEY, tms timestamp, statut smallint NOT NULL DEFAULT 0, - libelle varchar(50), + libelle varchar(50) NOT NULL, cotisation varchar(3) check (cotisation in ('yes','no')) NOT NULL DEFAULT 'yes', vote varchar(3) check (vote in ('yes','no')) DEFAULT 'yes', note text, diff --git a/mssql/tables/llx_bank.sql b/mssql/tables/llx_bank.sql index 43950f2e857..e4f1bbe56e1 100644 --- a/mssql/tables/llx_bank.sql +++ b/mssql/tables/llx_bank.sql @@ -25,8 +25,8 @@ create table llx_bank ( rowid integer IDENTITY PRIMARY KEY, datec datetime, - datev datetime, -- SMALLDATETIME de valeur - dateo datetime, -- SMALLDATETIME operation + datev SMALLDATETIME, -- SMALLDATETIME de valeur + dateo SMALLDATETIME, -- SMALLDATETIME operation amount real NOT NULL default 0, label varchar(255), fk_account integer, diff --git a/mssql/tables/llx_bank_account.sql b/mssql/tables/llx_bank_account.sql index c134d0d3022..a04af128e93 100644 --- a/mssql/tables/llx_bank_account.sql +++ b/mssql/tables/llx_bank_account.sql @@ -47,7 +47,7 @@ create table llx_bank_account rappro smallint DEFAULT 1, url varchar(128), account_number varchar(8), - currency_code varchar(2) NOT NULL, + currency_code varchar(3) NOT NULL, min_allowed integer DEFAULT 0, min_desired integer DEFAULT 0, comment varchar(254) diff --git a/mssql/tables/llx_bank_url.sql b/mssql/tables/llx_bank_url.sql index ffc9af32cd0..45a12e31e70 100644 --- a/mssql/tables/llx_bank_url.sql +++ b/mssql/tables/llx_bank_url.sql @@ -28,5 +28,5 @@ create table llx_bank_url url_id integer, url varchar(255), label varchar(255), - type varchar(12) check (type in ('company','payment','member','subscription','donation','sc','payment_sc')) + type varchar(16) NOT NULL check (type in ('company','payment','payment_supplier','member','subscription','donation','sc','payment_sc')) ); diff --git a/mssql/tables/llx_c_ecotaxe.sql b/mssql/tables/llx_c_ecotaxe.sql new file mode 100644 index 00000000000..f263114bf24 --- /dev/null +++ b/mssql/tables/llx_c_ecotaxe.sql @@ -0,0 +1,32 @@ +-- ======================================================================== +-- Copyright (C) 2007 Régis Houssin +-- +-- $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 +-- (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. +-- +-- ======================================================================== + +create table llx_c_ecotaxe +( + rowid integer IDENTITY PRIMARY KEY, + code varchar(64) UNIQUE NOT NULL, -- Code servant à la traduction et à la référence interne + libelle varchar(255), -- Description + price FLOAT(25), -- Montant HT + organization varchar(255), -- Organisme gérant le barème tarifaire + fk_pays integer NOT NULL, -- Pays correspondant + active tinyint DEFAULT 1 NOT NULL +); \ No newline at end of file diff --git a/mssql/tables/llx_c_pays.key.sql b/mssql/tables/llx_c_pays.key.sql index 1f1500a4a31..2c0c6342f09 100644 --- a/mssql/tables/llx_c_pays.key.sql +++ b/mssql/tables/llx_c_pays.key.sql @@ -22,5 +22,5 @@ CREATE UNIQUE INDEX idx_c_pays_code ON llx_c_pays(code); -CREATE UNIQUE INDEX idx_c_pays_code_iso ON llx_c_pays(code_iso); +--CREATE UNIQUE INDEX idx_c_pays_code_iso ON llx_c_pays(code_iso); CREATE UNIQUE INDEX idx_c_pays_libelle ON llx_c_pays(libelle); diff --git a/mssql/tables/llx_categorie.sql b/mssql/tables/llx_categorie.sql index 0c11509c5e3..02d2155e917 100644 --- a/mssql/tables/llx_categorie.sql +++ b/mssql/tables/llx_categorie.sql @@ -27,5 +27,6 @@ create table llx_categorie rowid integer IDENTITY PRIMARY KEY, label VARCHAR(255), -- nom de la catégorie description text, -- description de la catégorie - visible tinyint DEFAULT 1 NOT NULL -- determine si les produits sont visible ou pas + visible tinyint DEFAULT 1 NOT NULL, -- determine si les produits sont visible ou pas + type integer not null default 0 ); diff --git a/mssql/tables/llx_categorie_societe.key.sql b/mssql/tables/llx_categorie_societe.key.sql new file mode 100644 index 00000000000..f36eae10618 --- /dev/null +++ b/mssql/tables/llx_categorie_societe.key.sql @@ -0,0 +1,28 @@ +-- ============================================================================ +-- Copyright (C) 2007 Patrick Raguin +-- +-- 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. +-- +-- ============================================================================ + +ALTER TABLE llx_categorie_societe ADD PRIMARY KEY (fk_categorie, fk_societe); + +CREATE INDEX idx_categorie_societe_fk_categorie ON llx_categorie_societe(fk_categorie); +CREATE INDEX idx_categorie_societe_fk_societe ON llx_categorie_societe(fk_societe); + +ALTER TABLE llx_categorie_societe ADD CONSTRAINT fk_categorie_societe_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); +ALTER TABLE llx_categorie_societe ADD CONSTRAINT fk_categorie_societe_fk_soc FOREIGN KEY (fk_societe) REFERENCES llx_societe (rowid); + +CREATE UNIQUE INDEX fk_categorie ON llx_categorie_societe(fk_categorie, fk_societe); diff --git a/mssql/tables/llx_categorie_societe.sql b/mssql/tables/llx_categorie_societe.sql new file mode 100644 index 00000000000..cc0b7575b0f --- /dev/null +++ b/mssql/tables/llx_categorie_societe.sql @@ -0,0 +1,23 @@ +-- ============================================================================ +-- Copyright (C) 2007 Patrick Raguin +-- +-- 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. +-- +-- ============================================================================ + +create table llx_categorie_societe ( + fk_categorie integer not null, + fk_societe integer not null +); diff --git a/mssql/tables/llx_chargesociales.sql b/mssql/tables/llx_chargesociales.sql index 01f877ab1ca..9a22af1fec7 100644 --- a/mssql/tables/llx_chargesociales.sql +++ b/mssql/tables/llx_chargesociales.sql @@ -28,7 +28,7 @@ create table llx_chargesociales fk_type integer, amount real default 0 NOT NULL, paye smallint default 0 NOT NULL, - periode datetime + periode SMALLDATETIME ); diff --git a/mssql/tables/llx_commande.sql b/mssql/tables/llx_commande.sql index e9bfebc2d84..fb6e2966414 100644 --- a/mssql/tables/llx_commande.sql +++ b/mssql/tables/llx_commande.sql @@ -32,7 +32,7 @@ create table llx_commande date_creation datetime, -- SMALLDATETIME de creation date_valid datetime, -- SMALLDATETIME de validation date_cloture datetime, -- SMALLDATETIME de cloture - date_commande datetime, -- SMALLDATETIME de la commande + date_commande SMALLDATETIME, -- SMALLDATETIME de la commande fk_user_author integer, -- createur de la commande fk_user_valid integer, -- valideur de la commande fk_user_cloture integer, -- auteur cloture @@ -52,7 +52,7 @@ create table llx_commande facture tinyint default 0, fk_cond_reglement integer, -- condition de réglement fk_mode_reglement integer, -- mode de réglement - date_livraison datetime default NULL, + date_livraison SMALLDATETIME default NULL, fk_adresse_livraison integer, -- adresse de livraison ); diff --git a/mssql/tables/llx_commande_fournisseur.sql b/mssql/tables/llx_commande_fournisseur.sql index c268dc232bd..3f4bccdef1e 100644 --- a/mssql/tables/llx_commande_fournisseur.sql +++ b/mssql/tables/llx_commande_fournisseur.sql @@ -31,7 +31,7 @@ create table llx_commande_fournisseur date_creation datetime, -- SMALLDATETIME de creation date_valid datetime, -- SMALLDATETIME de validation date_cloture datetime, -- SMALLDATETIME de cloture - date_commande datetime, -- SMALLDATETIME de la commande + date_commande SMALLDATETIME, -- SMALLDATETIME de la commande fk_user_author integer, -- createur de la commande fk_user_valid integer, -- valideur de la commande fk_user_cloture integer, -- auteur cloture diff --git a/mssql/tables/llx_commande_fournisseurdet.sql b/mssql/tables/llx_commande_fournisseurdet.sql index 920810fd3dd..5d57a6c070a 100644 --- a/mssql/tables/llx_commande_fournisseurdet.sql +++ b/mssql/tables/llx_commande_fournisseurdet.sql @@ -31,6 +31,10 @@ create table llx_commande_fournisseurdet 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 + price real, -- prix final + subprice float, -- prix avant remise + total_ht float, -- Total HT de la ligne toute quantité et incluant remise ligne et globale + total_tva float, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale + total_ttc float, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale + info_bits integer DEFAULT 0 -- TVA NPR ou non ); diff --git a/mssql/tables/llx_compta.sql b/mssql/tables/llx_compta.sql index 3c5937aa600..7fa695c71b8 100644 --- a/mssql/tables/llx_compta.sql +++ b/mssql/tables/llx_compta.sql @@ -24,7 +24,7 @@ create table llx_compta ( rowid integer IDENTITY PRIMARY KEY, datec datetime, - datev datetime, -- SMALLDATETIME de valeur + datev SMALLDATETIME, -- SMALLDATETIME de valeur amount real DEFAULT 0 NOT NULL , label varchar(255), fk_compta_account integer, diff --git a/mssql/tables/llx_cotisation.key.sql b/mssql/tables/llx_cotisation.key.sql new file mode 100644 index 00000000000..7a89cab26c5 --- /dev/null +++ b/mssql/tables/llx_cotisation.key.sql @@ -0,0 +1,23 @@ +-- ============================================================================ +-- Copyright (C) 2007 Laurent Destailleur +-- +-- 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 UNIQUE INDEX uk_cotisation ON llx_cotisation(fk_adherent,dateadh); diff --git a/mssql/tables/llx_soc_events.sql b/mssql/tables/llx_droitpret_rapport.sql similarity index 51% rename from mssql/tables/llx_soc_events.sql rename to mssql/tables/llx_droitpret_rapport.sql index a87d295190d..81f01022f50 100644 --- a/mssql/tables/llx_soc_events.sql +++ b/mssql/tables/llx_droitpret_rapport.sql @@ -1,17 +1,17 @@ -- ======================================================================== --- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2007 Patrick Raguin -- -- 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 +-- 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. +-- GNU General Public License for more details. -- --- You should have received a copy of the GNU General [public] License +-- 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. -- @@ -20,13 +20,13 @@ -- -- ======================================================================== -create table llx_soc_events -( - rowid integer IDENTITY PRIMARY KEY, -- [public] id - fk_soc integer NOT NULL, -- - dateb datetime NOT NULL, -- begin SMALLDATETIME - datee datetime NOT NULL, -- end SMALLDATETIME - title varchar(100) NOT NULL, - url varchar(255), - description text + +create table llx_droitpret_rapport ( + rowid integer NOT NULL identity PRIMARY KEY, + date_envoie datetime NOT NULL, + format varchar(10) NOT NULL, + date_debut datetime NOT NULL, + date_fin datetime NOT NULL, + fichier varchar(255) NOT NULL, + nbfact integer NOT NULL, ); diff --git a/mssql/tables/llx_entrepot_valorisation.sql b/mssql/tables/llx_entrepot_valorisation.sql index 5285e61b7e7..c61ff03a738 100644 --- a/mssql/tables/llx_entrepot_valorisation.sql +++ b/mssql/tables/llx_entrepot_valorisation.sql @@ -24,7 +24,7 @@ create table llx_entrepot_valorisation ( rowid integer IDENTITY PRIMARY KEY, tms timestamp, -- SMALLDATETIME technique mise à jour automatiquement - date_calcul datetime, -- SMALLDATETIME auquel a ete calcule la valeur + date_calcul SMALLDATETIME, -- SMALLDATETIME auquel a ete calcule la valeur fk_entrepot integer NOT NULL , valo_pmp float(12) -- valoristaion du stock en PMP --key(fk_entrepot) diff --git a/mssql/tables/llx_expedition.sql b/mssql/tables/llx_expedition.sql index 2f6561a4682..51c6dd2f795 100644 --- a/mssql/tables/llx_expedition.sql +++ b/mssql/tables/llx_expedition.sql @@ -28,7 +28,7 @@ create table llx_expedition fk_commande integer, date_creation datetime, -- SMALLDATETIME de creation date_valid datetime, -- SMALLDATETIME de validation - date_expedition datetime, -- SMALLDATETIME de l'expedition + date_expedition SMALLDATETIME, -- SMALLDATETIME de l'expedition fk_user_author integer, -- createur fk_user_valid integer, -- valideur fk_entrepot integer, diff --git a/mssql/tables/llx_facture.sql b/mssql/tables/llx_facture.sql index 5cfefb90955..6178242b5b6 100644 --- a/mssql/tables/llx_facture.sql +++ b/mssql/tables/llx_facture.sql @@ -29,8 +29,8 @@ create table llx_facture increment varchar(10), fk_soc integer NOT NULL, datec datetime, -- SMALLDATETIME de creation de la facture - datef datetime, -- SMALLDATETIME de la facture - date_valid datetime, -- SMALLDATETIME de validation + datef SMALLDATETIME, -- SMALLDATETIME de la facture + date_valid SMALLDATETIME, -- SMALLDATETIME de validation paye smallint DEFAULT 0 NOT NULL, amount real DEFAULT 0 NOT NULL, remise_percent real DEFAULT 0, -- remise relative @@ -54,7 +54,7 @@ create table llx_facture fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...) fk_mode_reglement integer, -- mode de reglement (Virement, Prélèvement) - date_lim_reglement datetime, -- SMALLDATETIME limite de reglement + date_lim_reglement SMALLDATETIME, -- SMALLDATETIME limite de reglement note text, note_public text, diff --git a/mssql/tables/llx_facture_fourn.sql b/mssql/tables/llx_facture_fourn.sql index 184f45be40c..fbafbc23d00 100644 --- a/mssql/tables/llx_facture_fourn.sql +++ b/mssql/tables/llx_facture_fourn.sql @@ -27,7 +27,7 @@ create table llx_facture_fourn type smallint DEFAULT 0 NOT NULL, fk_soc integer NOT NULL, datec datetime, -- SMALLDATETIME de creation de la facture - datef datetime, -- SMALLDATETIME de la facture + datef SMALLDATETIME, -- SMALLDATETIME de la facture libelle varchar(255), paye smallint DEFAULT 0 NOT NULL, amount real DEFAULT 0 NOT NULL, @@ -46,7 +46,7 @@ create table llx_facture_fourn fk_projet integer, -- projet auquel est associée la facture fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...) - date_lim_reglement datetime, -- SMALLDATETIME limite de reglement + date_lim_reglement SMALLDATETIME, -- SMALLDATETIME limite de reglement note text, note_public text diff --git a/mssql/tables/llx_facture_rec.sql b/mssql/tables/llx_facture_rec.sql index 1a67211b580..967b5597f49 100644 --- a/mssql/tables/llx_facture_rec.sql +++ b/mssql/tables/llx_facture_rec.sql @@ -39,7 +39,7 @@ create table llx_facture_rec fk_projet integer, -- projet auquel est associé la facture fk_cond_reglement integer DEFAULT 0, -- condition de reglement fk_mode_reglement integer DEFAULT 0, -- mode de reglement (Virement, Prélèvement) - date_lim_reglement datetime, -- SMALLDATETIME limite de reglement + date_lim_reglement SMALLDATETIME, -- SMALLDATETIME limite de reglement note text, note_public text, diff --git a/mssql/tables/llx_facture_stats.sql b/mssql/tables/llx_facture_stats.sql index 16cb26ff4df..a83da3a992c 100644 --- a/mssql/tables/llx_facture_stats.sql +++ b/mssql/tables/llx_facture_stats.sql @@ -22,7 +22,7 @@ create table llx_facture_stats ( date_full datetime, - date_day datetime, + date_day SMALLDATETIME, data varchar(50), value real diff --git a/mssql/tables/llx_fichinterdet.sql b/mssql/tables/llx_fichinterdet.sql index c40f81c4b5d..e2c245b98c1 100644 --- a/mssql/tables/llx_fichinterdet.sql +++ b/mssql/tables/llx_fichinterdet.sql @@ -24,7 +24,7 @@ create table llx_fichinterdet ( rowid integer IDENTITY PRIMARY KEY, fk_fichinter integer, - SMALLDATETIME SMALLDATETIME, -- SMALLDATETIME de la ligne d'intervention + date SMALLDATETIME, -- SMALLDATETIME de la ligne d'intervention description text, -- description de la ligne d'intervention duree integer, -- duree de la ligne d'intervention rang integer DEFAULT 0 -- ordre affichage sur la fiche diff --git a/mssql/tables/llx_livraison.sql b/mssql/tables/llx_livraison.sql index 1de22e2204a..b1f3876bbee 100644 --- a/mssql/tables/llx_livraison.sql +++ b/mssql/tables/llx_livraison.sql @@ -37,7 +37,7 @@ create table llx_livraison note text, note_public text, model_pdf varchar(50), - date_livraison datetime default NULL, + date_livraison SMALLDATETIME default NULL, fk_adresse_livraison integer -- adresse de livraison --key(fk_commande) diff --git a/mssql/tables/llx_menu.sql b/mssql/tables/llx_menu.sql new file mode 100644 index 00000000000..7b87e988a8e --- /dev/null +++ b/mssql/tables/llx_menu.sql @@ -0,0 +1,45 @@ +-- ======================================================================== +-- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2007 Laurent Destailleur +-- +-- 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_menu ( + rowid integer PRIMARY KEY NOT NULL , + + menu_handler varchar(16) NOT NULL default 'auguria', -- Menu handler name + type varchar(4) NOT NULL check (type in ('top','left')) default 'left', -- Menu top or left + + mainmenu varchar(100) NOT NULL, -- Name family/module (home, companies, ...) + fk_menu integer NOT NULL, -- 0 or Id of mother menu line + [order] SMALLINT NOT NULL, -- Order of entry + + url varchar(255) NOT NULL, -- Relative (or absolute) url to go + target varchar(100) NULL, -- Target of Url link + + titre varchar(255) NOT NULL, -- Key for menu translation + langs varchar(100), -- Lang file to load for translation + + level SMALLINT, -- ??? + + leftmenu varchar(100) NULL, -- Condition to show or hide + [right] varchar(255), -- Condition to show enabled or disabled + [user] SMALLINT NOT NULL default '0', -- 0 if menu for all users, 1 for external only, 2 for internal only +); diff --git a/mssql/tables/llx_menu_const.key.sql b/mssql/tables/llx_menu_const.key.sql new file mode 100644 index 00000000000..71fbed841f2 --- /dev/null +++ b/mssql/tables/llx_menu_const.key.sql @@ -0,0 +1,29 @@ +-- ======================================================================== +-- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2005 Laurent Destailleur +-- +-- 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 INDEX idx_menu_const_fk_menu on llx_menu_const(fk_menu); +CREATE INDEX idx_menu_const_fk_constraint on llx_menu_const(fk_constraint); + +ALTER TABLE llx_menu_const ADD CONSTRAINT fk_menu_const_fk_menu FOREIGN KEY (fk_menu) REFERENCES llx_menu (rowid); +ALTER TABLE llx_menu_const ADD CONSTRAINT fk_menu_const_fk_constraint FOREIGN KEY (fk_constraint) REFERENCES llx_menu_constraint (rowid); diff --git a/mssql/tables/llx_ventes.sql b/mssql/tables/llx_menu_const.sql similarity index 51% rename from mssql/tables/llx_ventes.sql rename to mssql/tables/llx_menu_const.sql index 7c73d944427..7c7014aff0e 100644 --- a/mssql/tables/llx_ventes.sql +++ b/mssql/tables/llx_menu_const.sql @@ -1,34 +1,30 @@ --- =================================================================== --- Copyright (C) 2002 Rodolphe Quiedeville +-- ======================================================================== +-- Copyright (C) 2007 Patrick Raguin -- -- 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 +-- 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. +-- GNU General Public License for more details. -- --- You should have received a copy of the GNU General [public] License +-- 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_ventes -( - rowid integer IDENTITY PRIMARY KEY, - fk_soc integer NOT NULL, - fk_product integer NOT NULL, - dated datetime, -- SMALLDATETIME debut - datef datetime, -- SMALLDATETIME fin - price real, - author varchar(30), - active smallint DEFAULT 0 NOT NULL, - note varchar(255) + +CREATE TABLE llx_menu_const ( + rowid integer NOT NULL IDENTITY PRIMARY KEY, + fk_menu integer NOT NULL, + fk_constraint integer NOT NULL, + [user] tinyint NOT NULL default 2 ); + diff --git a/mssql/tables/llx_menu_constraint.sql b/mssql/tables/llx_menu_constraint.sql new file mode 100644 index 00000000000..e92eb60d00f --- /dev/null +++ b/mssql/tables/llx_menu_constraint.sql @@ -0,0 +1,27 @@ +-- ======================================================================== +-- Copyright (C) 2007 Patrick Raguin +-- +-- 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_menu_constraint ( + rowid integer PRIMARY KEY NOT NULL, + action varchar(255) NOT NULL +); diff --git a/mssql/tables/llx_newsletter.sql b/mssql/tables/llx_newsletter.sql deleted file mode 100644 index cec3ee397ff..00000000000 --- a/mssql/tables/llx_newsletter.sql +++ /dev/null @@ -1,45 +0,0 @@ --- ============================================================================ --- Copyright (C) 2003 Rodolphe Quiedeville --- --- 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_newsletter -( - rowid integer IDENTITY PRIMARY KEY, - datec datetime, - tms timestamp, - email_subject varchar(32) NOT NULL, - email_from_name varchar(255) NOT NULL, - email_from_email varchar(255) NOT NULL, - email_replyto varchar(255) NOT NULL, - email_body text, - target smallint, - sql_target text, - 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 - 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/mssql/tables/llx_notify_def.sql b/mssql/tables/llx_notify_def.sql index 181dbfa8eb7..b7cff6b9d3f 100644 --- a/mssql/tables/llx_notify_def.sql +++ b/mssql/tables/llx_notify_def.sql @@ -24,7 +24,7 @@ create table llx_notify_def ( rowid integer IDENTITY PRIMARY KEY, tms timestamp, - datec datetime, -- SMALLDATETIME de creation + datec SMALLDATETIME, -- SMALLDATETIME de creation fk_action integer NOT NULL, fk_soc integer NOT NULL, fk_contact integer NOT NULL diff --git a/mssql/tables/llx_projet.sql b/mssql/tables/llx_projet.sql index 37ccd0802af..18babf6071d 100644 --- a/mssql/tables/llx_projet.sql +++ b/mssql/tables/llx_projet.sql @@ -26,7 +26,7 @@ create table llx_projet fk_soc integer NOT NULL, fk_statut smallint NOT NULL, tms timestamp, - dateo datetime, -- SMALLDATETIME d'ouverture du projet + dateo SMALLDATETIME, -- SMALLDATETIME d'ouverture du projet ref varchar(50), title varchar(255), fk_user_resp integer, -- responsable du projet diff --git a/mssql/tables/llx_projet_task_time.sql b/mssql/tables/llx_projet_task_time.sql index 0c5ccaca36f..d55b3157f8a 100644 --- a/mssql/tables/llx_projet_task_time.sql +++ b/mssql/tables/llx_projet_task_time.sql @@ -24,7 +24,7 @@ create table llx_projet_task_time ( rowid integer IDENTITY PRIMARY KEY, fk_task integer NOT NULL, - task_date datetime, + task_date SMALLDATETIME, task_duration FLOAT(25), fk_user integer, note text diff --git a/mssql/tables/llx_propal.sql b/mssql/tables/llx_propal.sql index 6acfe404d16..f4d8d522606 100644 --- a/mssql/tables/llx_propal.sql +++ b/mssql/tables/llx_propal.sql @@ -29,7 +29,7 @@ create table llx_propal ref_client varchar(30), -- customer order number datec datetime, -- SMALLDATETIME de creation - datep datetime, -- SMALLDATETIME de la propal + datep SMALLDATETIME, -- SMALLDATETIME de la propal fin_validite datetime, -- SMALLDATETIME de fin de validite date_valid datetime, -- SMALLDATETIME de validation date_cloture datetime, -- SMALLDATETIME de cloture diff --git a/mssql/tables/llx_socpeople.sql b/mssql/tables/llx_socpeople.sql index 370ac5acb78..1d7576b264a 100644 --- a/mssql/tables/llx_socpeople.sql +++ b/mssql/tables/llx_socpeople.sql @@ -33,7 +33,7 @@ create table llx_socpeople cp varchar(25), ville varchar(255), fk_pays integer DEFAULT 0, - birthday datetime, + birthday SMALLDATETIME, poste varchar(80), phone varchar(30), phone_perso varchar(30), diff --git a/mssql/tables/llx_texts.sql b/mssql/tables/llx_texts.sql deleted file mode 100644 index 508bdd30fce..00000000000 --- a/mssql/tables/llx_texts.sql +++ /dev/null @@ -1,32 +0,0 @@ --- ============================================================================ --- Copyright (C) 2005 Laurent Destailleur --- --- 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_models -( - rowid integer IDENTITY PRIMARY KEY, - tms timestamp, - type varchar(32), -- Fonction destinee au modele - [public] smallint DEFAULT 1 NOT NULL, -- Model publique ou privee - fk_user integer, -- Id utilisateur si privee, sinon null - title varchar(128), -- Titre modele - content text -- Texte du modele -); diff --git a/mssql/tables/llx_todocomm.sql b/mssql/tables/llx_todocomm.sql deleted file mode 100644 index 6d4b36471a9..00000000000 --- a/mssql/tables/llx_todocomm.sql +++ /dev/null @@ -1,38 +0,0 @@ --- ======================================================================== --- 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 --- (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. --- --- Actions commerciales a effectuer --- --- ======================================================================== - -create table llx_todocomm -( - id integer IDENTITY PRIMARY KEY, - datea datetime, -- SMALLDATETIME 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 -); - diff --git a/mssql/tables/llx_tva.sql b/mssql/tables/llx_tva.sql index dde8e16d2bf..b02a72754fc 100644 --- a/mssql/tables/llx_tva.sql +++ b/mssql/tables/llx_tva.sql @@ -24,8 +24,8 @@ create table llx_tva ( rowid integer IDENTITY PRIMARY KEY, tms timestamp, - datep datetime, -- SMALLDATETIME de paiement - datev datetime, -- SMALLDATETIME de valeur + datep SMALLDATETIME, -- SMALLDATETIME de paiement + datev SMALLDATETIME, -- SMALLDATETIME de valeur amount real NOT NULL DEFAULT 0, label varchar(255), note text diff --git a/mssql/tables/llx_voyage.sql b/mssql/tables/llx_voyage.sql index 53a7f90a2f2..a1bed07dff5 100644 --- a/mssql/tables/llx_voyage.sql +++ b/mssql/tables/llx_voyage.sql @@ -30,7 +30,7 @@ create table llx_voyage rowid integer IDENTITY PRIMARY KEY, datec datetime, - dateo datetime, -- SMALLDATETIME operation + dateo SMALLDATETIME, -- SMALLDATETIME operation date_depart datetime, -- SMALLDATETIME du voyage date_arrivee datetime, -- SMALLDATETIME du voyage amount real NOT NULL DEFAULT 0, -- prix du billet diff --git a/mssql/tables/llx_voyage_reduc.sql b/mssql/tables/llx_voyage_reduc.sql index 2fa165d7ce3..8556853bdd8 100644 --- a/mssql/tables/llx_voyage_reduc.sql +++ b/mssql/tables/llx_voyage_reduc.sql @@ -24,9 +24,9 @@ create table llx_voyage_reduc ( rowid integer IDENTITY PRIMARY KEY, datec datetime, - datev datetime, -- SMALLDATETIME de valeur - date_debut datetime, -- SMALLDATETIME operation - date_fin datetime, + datev SMALLDATETIME, -- SMALLDATETIME de valeur + date_debut SMALLDATETIME, -- SMALLDATETIME operation + date_fin SMALLDATETIME, amount real NOT NULL DEFAULT 0, label varchar(255), numero varchar(255),