-- upgrade version 2.3 to 2.4 Set client_encoding to latin1; BEGIN; CREATE TABLE rapport ( debut date, fin date, source text ) inherits (object); create unique index idx_rapport_uid on rapport (uid); create index idx_rapport_ref_statut on rapport (ref_statut); CREATE TABLE rapport_affectation ( ref_affectation int4 DEFAULT 0 ) inherits (rapport); create unique index idx_rapport_affectation_uid on rapport_affectation (uid); create index idx_affectation_ref_affectation on rapport_affectation (ref_affectation); create index idx_port_affectation_ref_statut on rapport_affectation (ref_statut); CREATE TABLE rapport_support ( ref_departement int4 DEFAULT 0 ) inherits (rapport); create unique index idx_rapport_support_uid on rapport_support (uid); create index idx_ort_support_ref_departement on rapport_support (ref_departement); create index idx_rapport_support_ref_statut on rapport_support (ref_statut); CREATE TABLE rapport_dg ( ) inherits (rapport); create unique index idx_rapport_dg_uid on rapport_dg (uid); create index idx_rapport_dg_ref_statut on rapport_dg (ref_statut); ALTER TABLE action ADD COLUMN ref_object int4 DEFAULT 0; create index idx_action_ref_object on action (ref_object); ALTER TABLE departement ADD COLUMN code text; ALTER TABLE departement ADD COLUMN stats boolean DEFAULT true; COMMIT;