From 2aeb65699e05341274ca828ba2c149e93649f057 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Mar 2005 21:05:18 +0000 Subject: [PATCH] Mise a jour script pgsql --- pgsql/tables/llx_contrat.key.sql | 12 ++++++------ pgsql/tables/llx_entrepot.sql | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pgsql/tables/llx_contrat.key.sql b/pgsql/tables/llx_contrat.key.sql index 8bc3c3c89f5..21753a12689 100644 --- a/pgsql/tables/llx_contrat.key.sql +++ b/pgsql/tables/llx_contrat.key.sql @@ -25,11 +25,11 @@ -- -- ============================================================================ --- --- -ALTER TABLE llx_contrat ADD INDEX (fk_soc); -ALTER TABLE llx_contrat ADD INDEX (fk_user_author); --- --- +-- Supprimme orhpelins pour permettre montée de la clé +DELETE llx_contrat FROM llx_contrat LEFT JOIN llx_societe ON llx_contrat.fk_soc = llx_societe.idp WHERE llx_societe.idp IS NULL; + +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 FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); ALTER TABLE llx_contrat ADD FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); diff --git a/pgsql/tables/llx_entrepot.sql b/pgsql/tables/llx_entrepot.sql index 4a2610918ea..d2f3a1c6b9b 100644 --- a/pgsql/tables/llx_entrepot.sql +++ b/pgsql/tables/llx_entrepot.sql @@ -32,6 +32,11 @@ create table llx_entrepot "tms" timestamp, "label" varchar(255) NOT NULL, "description" text, + "lieu" varchar(64), -- résumé lieu situation + "address" varchar(255), + "cp" varchar(10), + "ville" varchar(50), + "fk_pays" integer DEFAULT 0, "statut" smallint DEFAULT 1, -- 1 ouvert, 0 fermé "fk_user_author" integer );