Skip to content
Snippets Groups Projects
Commit 2399d1d6 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Mise a jour script pgsql

parent e325fb17
No related branches found
No related tags found
No related merge requests found
Showing
with 60 additions and 103 deletions
......@@ -49,5 +49,6 @@ create table llx_bank_account
"courant" smallint DEFAULT 0 NOT NULL,
"clos" smallint DEFAULT 0 NOT NULL,
"rappro" smallint DEFAULT 1,
"url" varchar(128),
"account_number" varchar(8)
);
......@@ -30,6 +30,6 @@ create table llx_c_pays
rowid integer PRIMARY KEY,
"code" varchar(2) NOT NULL,
"code_iso" varchar(3) ,
"libelle" varchar(25) NOT NULL,
"libelle" varchar(50) NOT NULL,
"active" smallint DEFAULT 1 NOT NULL
);
......@@ -26,6 +26,7 @@
create table llx_commande
(
rowid SERIAL PRIMARY KEY,
......
......@@ -30,11 +30,17 @@ create table llx_commandedet
"fk_product" integer,
"label" varchar(255),
"description" text,
"tva_tx" real DEFAULT 19.6, -- taux tva
"tva_tx" real, -- taux tva
"qty" real, -- quantit
"remise_percent" real DEFAULT 0, -- pourcentage de remise
"remise" real DEFAULT 0, -- montant de la remise
"fk_remise_except" integer NULL, -- Lien vers table des remises fixes
"subprice" real, -- prix avant remise
"price" real, -- prix final
"coef" real -- coefficient de marge
"total_ht" real, -- Total HT de la ligne toute quantit et incluant remise ligne et globale
"total_tva" real, -- Total TVA de la ligne toute quantit et incluant remise ligne et globale
"total_ttc" real, -- Total TTC de la ligne toute quantit et incluant remise ligne et globale
"info_bits" integer DEFAULT 0, -- TVA NPR ou non
"coef" real, -- coefficient de marge
"rang" integer DEFAULT 0
);
......@@ -35,4 +35,4 @@ ALTER TABLE llx_contrat ADD INDEX idx_contrat_fk_soc (fk_soc);
ALTER TABLE llx_contrat ADD INDEX idx_contrat_fk_user_author (fk_user_author);
ALTER TABLE llx_contrat ADD CONSTRAINT fk_contrat_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
ALTER TABLE llx_contrat ADD CONSTRAINT fk_contrat_societe FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
\ No newline at end of file
ALTER TABLE llx_contrat ADD CONSTRAINT fk_contrat_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
\ No newline at end of file
......@@ -49,8 +49,13 @@ create table llx_contratdet
"qty" real, -- quantit
"remise_percent" real DEFAULT 0, -- pourcentage de remise
"remise" real DEFAULT 0, -- montant de la remise
"fk_remise_except" integer NULL, -- Lien vers table des remises fixes
"subprice" real, -- prix avant remise
"price_ht" real, -- prix final
"total_ht" real, -- Total HT de la ligne toute quantit et incluant remise ligne et globale
"total_tva" real, -- Total TVA de la ligne toute quantit et incluant remise ligne et globale
"total_ttc" real, -- Total TTC de la ligne toute quantit et incluant remise ligne et globale
"info_bits" integer DEFAULT 0, -- TVA NPR ou non
"fk_user_author" integer NOT NULL default 0,
"fk_user_ouverture" integer,
"fk_user_cloture" integer,
......
......@@ -29,8 +29,9 @@
create table llx_document_model
(
nom varchar(50) PRIMARY KEY,
"type" varchar(12) NOT NULL,
rowid SERIAL PRIMARY KEY,
"nom" varchar(50),
"type" varchar(12) NOT NULL,
"libelle" varchar(255),
"description" text
);
\ No newline at end of file
......@@ -56,5 +56,5 @@ create table llx_facture
"date_lim_reglement" date, -- date limite de reglement
"note" text,
"note_public" text,
"model" varchar(50)
"model_pdf" varchar(50)
);
......@@ -28,17 +28,21 @@ create table llx_facturedet
(
rowid SERIAL PRIMARY KEY,
"fk_facture" integer NOT NULL,
"fk_product" integer NULL, -- doit pouvoir etre nul pour ligne detail sans produits
"fk_product" integer NULL, -- Doit pouvoir etre nul pour ligne detail sans produits
"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
"date_start" timestamp, -- date debut si service
"date_end" timestamp, -- date fin si service
"info_bits" integer DEFAULT 0,
"tva_taux" real, -- Taux tva produit/service (exemple 19.6)
"qty" real, -- Quantit (exemple 2)
"remise_percent" real DEFAULT 0, -- % de la remise ligne (exemple 20%)
"remise" real DEFAULT 0, -- Montant calcul de la remise % sur PU HT (exemple 20)
"fk_remise_except" integer NULL, -- Lien vers table des remises fixes
"subprice" real, -- P.U. HT (exemple 100)
"price" real, -- P.U. HT apres remise % de ligne
"total_ht" real, -- Total HT de la ligne toute quantit et incluant remise ligne et globale
"total_tva" real, -- Total TVA de la ligne toute quantit et incluant remise ligne et globale
"total_ttc" real, -- Total TTC de la ligne toute quantit et incluant remise ligne et globale
"date_start" timestamp, -- date debut si service
"date_end" timestamp, -- date fin si service
"info_bits" integer DEFAULT 0, -- TVA NPR ou non
"fk_code_ventilation" integer DEFAULT 0 NOT NULL,
"fk_export_compta" integer DEFAULT 0 NOT NULL,
"rang" integer DEFAULT 0
......
-- Generated from dolibarr_mysql2pgsql
-- (c) 2004, PostgreSQL Inc.
-- (c) 2005, Laurent Destailleur.
-- ============================================================================
-- Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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: llx_livraison.key.sql,v 1.1 2006/05/05 15:28:06 hregis Exp $
-- $Source: /cvsroot/dolibarr/dolibarr/mysql/tables/llx_livraison.key.sql,v $
--
-- ============================================================================
-- Supprimme orphelins pour permettre monte de la cl
-- V4 DELETE llx_livraison FROM llx_livraison LEFT JOIN llx_societe ON llx_livraison.fk_soc = llx_societe.idp WHERE llx_societe.idp IS NULL;
ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_soc (fk_soc);
ALTER TABLE llx_livraison ADD CONSTRAINT fk_livraison_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
......@@ -29,7 +29,6 @@ create table llx_livraison
(
rowid SERIAL PRIMARY KEY,
"tms" timestamp,
"fk_soc" integer NOT NULL,
"fk_commande" integer DEFAULT 0, -- commande auquel est rattache le bon de livraison
"fk_expedition" integer, -- expedition auquel est rattache le bon de livraison
"ref" varchar(30) NOT NULL, -- delivery number
......@@ -49,3 +48,4 @@ create table llx_livraison
);
CREATE INDEX idx_llx_livraison_ref ON llx_livraison (ref);
CREATE INDEX idx_llx_livraison_fk_commande ON llx_livraison (fk_commande);
-- Generated from dolibarr_mysql2pgsql
-- (c) 2004, PostgreSQL Inc.
-- (c) 2005, Laurent Destailleur.
-- ============================================================================
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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 SERIAL 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
);
......@@ -25,12 +25,14 @@
-- ===================================================================
create table llx_propal
(
rowid SERIAL PRIMARY KEY,
"fk_soc" integer,
"fk_projet" integer DEFAULT 0, -- projet auquel est rattache la propale
"ref" varchar(30) NOT NULL, -- propal number
"ref_client" varchar(30), -- customer order number
"datec" timestamp, -- date de creation
"datep" date, -- date de la propal
"fin_validite" timestamp, -- date de fin de validite
......
......@@ -29,10 +29,17 @@ create table llx_propaldet
"fk_propal" integer,
"fk_product" integer,
"description" text,
"tva_tx" real DEFAULT 19.6, -- taux tva
"tva_tx" real, -- taux tva
"qty" real, -- quantit
"remise_percent" real DEFAULT 0, -- pourcentage de remise
"remise" real DEFAULT 0, -- montant de la remise
"fk_remise_except" integer NULL, -- Lien vers table des remises fixes
"subprice" real, -- prix avant remise
"price" real -- prix final
"price" real, -- prix final
"total_ht" real, -- Total HT de la ligne toute quantit et incluant remise ligne et globale
"total_tva" real, -- Total TVA de la ligne toute quantit et incluant remise ligne et globale
"total_ttc" real, -- Total TTC de la ligne toute quantit et incluant remise ligne et globale
"info_bits" integer DEFAULT 0, -- TVA NPR ou non
"coef" real, -- coefficient de marge
"rang" integer DEFAULT 0
);
......@@ -27,9 +27,8 @@
create table llx_societe
(
idp SERIAL PRIMARY KEY,
"id" varchar(32), -- private id
"active" smallint DEFAULT 0, --
"parent" integer DEFAULT 0, --
"statut" smallint DEFAULT 0, -- statut
"parent" integer,
"tms" timestamp,
"datec" timestamp, -- creation date
"datea" timestamp, -- activation date
......@@ -46,6 +45,7 @@ create table llx_societe
"tel" varchar(20), -- phone number
"fax" varchar(20), -- fax number
"url" varchar(255), --
"email" varchar(128), --
"fk_secteur" integer DEFAULT 0, --
"fk_effectif" integer DEFAULT 0, --
"fk_typent" integer DEFAULT 0, --
......@@ -56,17 +56,17 @@ create table llx_societe
"tva_intra" varchar(20), -- tva intracommunautaire
"capital" real, -- capital de la socit
"description" text, --
"fk_stcomm" smallint DEFAULT 0, -- commercial statut
"fk_stcomm" smallint DEFAULT 0, -- commercial statut
"note" text, --
"services" integer DEFAULT 0, --
"services" smallint DEFAULT 0, --
"prefix_comm" varchar(5), -- prefix commercial
"client" integer DEFAULT 0, -- client oui/non
"fournisseur" smallint DEFAULT 0, -- fournisseur oui/non
"client" smallint DEFAULT 0, -- client 0/1/2
"fournisseur" smallint DEFAULT 0, -- fournisseur 0/1
"rubrique" varchar(255), -- champ rubrique libre
"fk_user_creat" integer, -- utilisateur qui a cr l'info
"fk_user_modif" integer, -- utilisateur qui a modifi l'info
"remise_client" real DEFAULT 0, -- remise systmatique pour le client
"mode_reglement" integer DEFAULT 0, -- mode de rglement
"cond_reglement" integer DEFAULT 1 NOT NULL, -- condition de rglement
"tva_assuj" smallint DEFAULT 1 -- assujti ou non la TVA
"mode_reglement" smallint, -- mode de rglement
"cond_reglement" smallint, -- condition de rglement
"tva_assuj" smallint DEFAULT 1 -- assujti ou non la TVA
);
......@@ -36,7 +36,6 @@ create table llx_societe_adresse_livraison
"address" varchar(255), -- company adresse
"cp" varchar(10), -- zipcode
"ville" varchar(50), -- town
"fk_departement" integer DEFAULT 0, --
"fk_pays" integer DEFAULT 0, --
"note" text, --
"fk_user_creat" integer, -- utilisateur qui a cr l'info
......
......@@ -4,6 +4,7 @@
-- ============================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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
......@@ -23,11 +24,8 @@
-- $Source$
--
-- Remises exceptionnelles
--
--
-- ============================================================================
create table llx_societe_remise_except
(
rowid SERIAL PRIMARY KEY,
......@@ -36,5 +34,5 @@ create table llx_societe_remise_except
"amount_ht" real NOT NULL,
"fk_user" integer NOT NULL,
"fk_facture" integer,
"description" text
"description" varchar(255) NOT NULL
);
......@@ -47,6 +47,7 @@ create table llx_user
"note" text,
"datelastaccess" timestamp,
"egroupware_id" integer,
"ldap_sid" varchar(255) DEFAULT NULL,
UNIQUE(login)
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment