Fix: Le nom des index gnrs pour pgsql inclus la table car sous pgsql on un nom d'index doit etre unique pour toute la base (sous mysql, unique par table)

Fix: Corrige problme de quot sur UNIQUE
This commit is contained in:
Laurent Destailleur 2005-03-04 22:43:16 +00:00
parent 41e2311770
commit 261d9c63fc
37 changed files with 96 additions and 60 deletions

View File

@ -55,8 +55,9 @@ create table llx_adherent
"fk_user_mod" integer NOT NULL,
"fk_user_valid" integer NOT NULL,
"datefin" timestamp, -- date de fin de validité de la cotisation
"note" text
"note" text,
UNIQUE(login)
);
CREATE INDEX idx_login ON llx_adherent (login);
CREATE INDEX idx_llx_adherent_login ON llx_adherent (login);

View File

@ -30,7 +30,8 @@ create table llx_adherent_options
(
optid SERIAL PRIMARY KEY,
"tms" timestamp,
"adhid" integer NOT NULL -- id de l'adherent auquel correspond ces attributs optionnel
"adhid" integer NOT NULL, -- id de l'adherent auquel correspond ces attributs optionnel
UNIQUE(adhid)
);
CREATE INDEX idx_adhid ON llx_adherent_options (adhid);
CREATE INDEX idx_llx_adherent_options_adhid ON llx_adherent_options (adhid);

View File

@ -28,6 +28,7 @@
create table llx_album_to_groupart
(
"fk_album" integer NOT NULL,
"fk_groupart" integer NOT NULL
"fk_groupart" integer NOT NULL,
UNIQUE(fk_album, fk_groupart)
);

View File

@ -29,4 +29,4 @@ create table llx_bank_class
"fk_categ" integer NOT NULL
);
CREATE INDEX idx_lineid ON llx_bank_class (lineid);
CREATE INDEX idx_llx_bank_class_lineid ON llx_bank_class (lineid);

View File

@ -29,7 +29,8 @@ create table llx_bookmark4u_login
(
rowid SERIAL PRIMARY KEY,
"fk_user" integer,
"bk4u_uid" integer
"bk4u_uid" integer,
UNIQUE(fk_user)
);
CREATE INDEX idx_fk_user ON llx_bookmark4u_login (fk_user);
CREATE INDEX idx_llx_bookmark4u_login_fk_user ON llx_bookmark4u_login (fk_user);

View File

@ -31,8 +31,9 @@ create table llx_c_ape
rowid SERIAL PRIMARY KEY,
"code_ape" varchar(5) NOT NULL,
"libelle" varchar(255),
"active" smallint DEFAULT 1 NOT NULL
"active" smallint DEFAULT 1 NOT NULL,
UNIQUE(code_ape)
);
CREATE INDEX idx_code_ape ON llx_c_ape (code_ape);
CREATE INDEX idx_llx_c_ape_code_ape ON llx_c_ape (code_ape);

View File

@ -38,7 +38,7 @@ create table llx_c_departements
"active" smallint DEFAULT 1 NOT NULL
);
CREATE INDEX idx_fk_region ON llx_c_departements (fk_region);
CREATE INDEX idx_llx_c_departements_fk_region ON llx_c_departements (fk_region);

View File

@ -31,5 +31,5 @@ create table llx_co_fa
"fk_facture" integer NOT NULL
);
CREATE INDEX idx_fk_commande ON llx_co_fa (fk_commande);
CREATE INDEX idx_fk_facture ON llx_co_fa (fk_facture);
CREATE INDEX idx_llx_co_fa_fk_commande ON llx_co_fa (fk_commande);
CREATE INDEX idx_llx_co_fa_fk_facture ON llx_co_fa (fk_facture);

View File

@ -49,7 +49,8 @@ create table llx_commande
"total_ttc" real default 0,
"note" text,
"model_pdf" varchar(50),
"facture" smallint default 0
"facture" smallint default 0,
UNIQUE(ref)
);
CREATE INDEX idx_ref ON llx_commande (ref);
CREATE INDEX idx_llx_commande_ref ON llx_commande (ref);

View File

@ -50,7 +50,8 @@ create table llx_commande_fournisseur
"total_ht" real default 0,
"total_ttc" real default 0,
"note" text,
"model_pdf" varchar(50)
"model_pdf" varchar(50),
UNIQUE(ref)
);
CREATE INDEX idx_ref ON llx_commande_fournisseur (ref);
CREATE INDEX idx_llx_commande_fournisseur_ref ON llx_commande_fournisseur (ref);

View File

@ -33,5 +33,7 @@ create table llx_compta_compte_generaux
"intitule" varchar(255),
"fk_user_author" integer,
"note" text,
"UNIQUE"(numero)
UNIQUE(numero)
);
CREATE INDEX idx_llx_compta_compte_generaux_numero ON llx_compta_compte_generaux (numero);

View File

@ -36,7 +36,8 @@ create table llx_const
"value" text, -- max 65535 caracteres
"type" varchar(6) CHECK (type IN ('yesno','texte','chaine')) ,
"visible" smallint DEFAULT 1 NOT NULL,
"note" text
"note" text,
UNIQUE(name)
);
CREATE INDEX idx_name ON llx_const (name);
CREATE INDEX idx_llx_const_name ON llx_const (name);

View File

@ -32,5 +32,7 @@ create table llx_contact_facture
idp SERIAL PRIMARY KEY,
"fk_soc" integer NOT NULL,
"fk_contact" integer NOT NULL, -- point sur llx_socpeople
"UNIQUE" (fk_soc, fk_contact)
UNIQUE(fk_soc, fk_contact)
);
CREATE INDEX idx_llx_contact_facture_fk_soc__fk_contact ON llx_contact_facture ();

View File

@ -40,9 +40,10 @@ create table llx_expedition
"fk_expedition_methode" integer,
"fk_statut" smallint DEFAULT 0,
"note" text,
"model_pdf" varchar(50)
"model_pdf" varchar(50),
UNIQUE(ref)
);
CREATE INDEX idx_ref ON llx_expedition (ref);
CREATE INDEX idx_fk_expedition_methode ON llx_expedition (fk_expedition_methode);
CREATE INDEX idx_fk_commande ON llx_expedition (fk_commande);
CREATE INDEX idx_llx_expedition_ref ON llx_expedition (ref);
CREATE INDEX idx_llx_expedition_fk_expedition_methode ON llx_expedition (fk_expedition_methode);
CREATE INDEX idx_llx_expedition_fk_commande ON llx_expedition (fk_commande);

View File

@ -32,5 +32,5 @@ create table llx_expeditiondet
"qty" real -- quantité
);
CREATE INDEX idx_fk_expedition ON llx_expeditiondet (fk_expedition);
CREATE INDEX idx_fk_commande_ligne ON llx_expeditiondet (fk_commande_ligne);
CREATE INDEX idx_llx_expeditiondet_fk_expedition ON llx_expeditiondet (fk_expedition);
CREATE INDEX idx_llx_expeditiondet_fk_commande_ligne ON llx_expeditiondet (fk_commande_ligne);

View File

@ -48,8 +48,9 @@ create table llx_facture
"fk_cond_reglement" integer, -- condition de reglement (30 jours, fin de mois ...)
"fk_mode_reglement" integer, -- mode de reglement (Virement, Prélèvement)
"date_lim_reglement" date, -- date limite de reglement
"note" text
"note" text,
UNIQUE(facnumber)
);
CREATE INDEX idx_facnumber ON llx_facture (facnumber);
CREATE INDEX idx_llx_facture_facnumber ON llx_facture (facnumber);
CREATE INDEX fksoc ON llx_facture (fk_soc);

View File

@ -47,5 +47,6 @@ create table llx_facture_fourn
"fk_statut" smallint DEFAULT 0 NOT NULL,
"fk_user_author" integer, -- createur de la facture
"fk_user_valid" integer, -- valideur de la facture
"note" text
"note" text,
UNIQUE(facnumber, fk_soc)
);

View File

@ -45,4 +45,4 @@ create table llx_facture_rec
"note" text
);
CREATE INDEX fksoc ON llx_facture_rec (fk_soc);
CREATE INDEX idx_facture_rec_fksoc ON llx_facture_rec (fk_soc);

View File

@ -38,7 +38,8 @@ create table llx_fichinter
"fk_user_valid" integer, -- valideur de la fiche
"fk_statut" smallint DEFAULT 0,
"duree" real,
"note" text
"note" text,
UNIQUE(ref)
);
CREATE INDEX idx_ref ON llx_fichinter (ref);
CREATE INDEX idx_llx_fichinter_ref ON llx_fichinter (ref);

View File

@ -39,8 +39,9 @@ create table llx_livre
"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)
);
CREATE INDEX idx_ref ON llx_livre (ref);
CREATE INDEX idx_llx_livre_ref ON llx_livre (ref);

View File

@ -28,5 +28,6 @@
create table llx_livre_to_auteur
(
"fk_livre" integer NOT NULL,
"fk_auteur" integer NOT NULL
"fk_auteur" integer NOT NULL,
UNIQUE(fk_livre, fk_auteur)
);

View File

@ -33,5 +33,5 @@ create table llx_paiement_facture
);
CREATE INDEX idx_fk_paiement ON llx_paiement_facture (fk_paiement);
CREATE INDEX idx_fk_facture ON llx_paiement_facture (fk_facture);
CREATE INDEX idx_llx_paiement_facture_fk_paiement ON llx_paiement_facture (fk_paiement);
CREATE INDEX idx_llx_paiement_facture_fk_facture ON llx_paiement_facture (fk_facture);

View File

@ -41,5 +41,7 @@ create table llx_prelevement
"date_credit" timestamp,
"fk_user_credit" integer,
"UNIQUE"(ref)
UNIQUE(ref)
);
CREATE INDEX idx_llx_prelevement_ref ON llx_prelevement (ref);

View File

@ -43,5 +43,7 @@ create table llx_prelevement_bons
"date_credit" timestamp, -- date de crédit sur le compte
"fk_user_credit" integer, -- user qui a remonté l'info de crédit
"UNIQUE"(ref)
UNIQUE(ref)
);
CREATE INDEX idx_llx_prelevement_bons_ref ON llx_prelevement_bons (ref);

View File

@ -36,6 +36,6 @@ create table llx_product_fournisseur
"fk_user_author" integer
);
CREATE INDEX idx_fk_product ON llx_product_fournisseur (fk_product);
CREATE INDEX idx_fk_soc ON llx_product_fournisseur (fk_soc);
CREATE INDEX idx_llx_product_fournisseur_fk_product ON llx_product_fournisseur (fk_product);
CREATE INDEX idx_llx_product_fournisseur_fk_soc ON llx_product_fournisseur (fk_soc);

View File

@ -34,6 +34,6 @@ create table llx_product_stock
"reel" integer -- stock réel
);
CREATE INDEX idx_fk_product ON llx_product_stock (fk_product);
CREATE INDEX idx_fk_entrepot ON llx_product_stock (fk_entrepot);
CREATE INDEX idx_llx_product_stock_fk_product ON llx_product_stock (fk_product);
CREATE INDEX idx_llx_product_stock_fk_entrepot ON llx_product_stock (fk_entrepot);

View File

@ -37,7 +37,8 @@ create table llx_projet
"title" varchar(255),
"fk_user_resp" integer, -- responsable du projet
"fk_user_creat" integer, -- createur du projet
"note" text
"note" text,
UNIQUE(ref)
);
CREATE INDEX idx_ref ON llx_projet (ref);
CREATE INDEX idx_llx_projet_ref ON llx_projet (ref);

View File

@ -46,7 +46,8 @@ create table llx_propal
"tva" real DEFAULT 0,
"total" real DEFAULT 0,
"note" text,
"model_pdf" varchar(50)
"model_pdf" varchar(50),
UNIQUE(ref)
);
CREATE INDEX idx_ref ON llx_propal (ref);
CREATE INDEX idx_llx_propal_ref ON llx_propal (ref);

View File

@ -32,5 +32,7 @@ create table llx_so_gr
rowid SERIAL PRIMARY KEY,
"fk_soc" integer,
"fk_groupe" integer,
"UNIQUE"(fk_soc, fk_groupe)
UNIQUE(fk_soc, fk_groupe)
);
CREATE INDEX idx_llx_so_gr_fk_soc__fk_groupe ON llx_so_gr ();

View File

@ -64,8 +64,9 @@ create table llx_societe
"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 systématique pour le client
"remise_client" real DEFAULT 0, -- remise systématique pour le client
UNIQUE(prefix_comm)
);
CREATE INDEX idx_prefix_comm ON llx_societe (prefix_comm);
CREATE INDEX idx_llx_societe_prefix_comm ON llx_societe (prefix_comm);

View File

@ -29,6 +29,7 @@ create table llx_societe_commerciaux
(
rowid SERIAL PRIMARY KEY,
"fk_soc" integer,
"fk_user" integer
"fk_user" integer,
UNIQUE(fk_soc, fk_user)
);

View File

@ -37,6 +37,6 @@ create table llx_stock_mouvement
"fk_user_author" integer
);
CREATE INDEX idx_fk_product ON llx_stock_mouvement (fk_product);
CREATE INDEX idx_fk_entrepot ON llx_stock_mouvement (fk_entrepot);
CREATE INDEX idx_llx_stock_mouvement_fk_product ON llx_stock_mouvement (fk_product);
CREATE INDEX idx_llx_stock_mouvement_fk_entrepot ON llx_stock_mouvement (fk_entrepot);

View File

@ -42,7 +42,8 @@ create table llx_user
"module_compta" smallint DEFAULT 1,
"fk_societe" integer DEFAULT 0,
"fk_socpeople" integer DEFAULT 0,
"note" text
"note" text,
UNIQUE(login)
);
CREATE INDEX idx_login ON llx_user (login);
CREATE INDEX idx_llx_user_login ON llx_user (login);

View File

@ -32,5 +32,7 @@ create table llx_user_param
"page" varchar(255),
"param" varchar(64),
"value" varchar(255),
"UNIQUE" (fk_user,page,param)
UNIQUE(fk_user,page,param)
);
CREATE INDEX idx_llx_user_param_fk_user_page_param ON llx_user_param ();

View File

@ -29,6 +29,7 @@ create table llx_user_rights
(
rowid SERIAL PRIMARY KEY,
"fk_user" integer NOT NULL,
"fk_id" integer NOT NULL
"fk_id" integer NOT NULL,
UNIQUE(fk_user,fk_id)
);

View File

@ -30,6 +30,8 @@ create table llx_usergroup_rights
rowid SERIAL PRIMARY KEY,
"fk_usergroup" integer NOT NULL,
"fk_id" integer NOT NULL,
"UNIQUE"(fk_usergroup,fk_id)
UNIQUE(fk_usergroup,fk_id)
);
CREATE INDEX idx_llx_usergroup_rights_fk_usergroup_fk_id ON llx_usergroup_rights ();

View File

@ -30,5 +30,7 @@ create table llx_usergroup_user
rowid SERIAL PRIMARY KEY,
"fk_user" integer NOT NULL,
"fk_usergroup" integer NOT NULL,
"UNIQUE"(fk_user,fk_usergroup)
UNIQUE(fk_user,fk_usergroup)
);
CREATE INDEX idx_llx_usergroup_user_fk_user_fk_usergroup ON llx_usergroup_user ();