Commit d6b81cd9 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Correction des scripts d'install SQL

parent bf930354
Loading
Loading
Loading
Loading
+1 −0
Changes for data/oracle.sql: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ create table IMPORT_LOG
    type varchar2(128) not null,
    name varchar2(128) not null,
    success int(1) not null,
    has_problems int(1) default 0 not null,
    log clob not null,
    started_on TIMESTAMP not null,
    ended_on TIMESTAMP not null,
+10 −11
Changes for data/postgresql.sql: 10 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
--
create table source
(
    id bigint not null constraint source_pkey primary key,
    id bigserial not null constraint source_pkey primary key,
    code varchar(64) not null constraint source_code_key unique,
    libelle varchar(128) not null,
    importable boolean not null,
@@ -19,9 +19,9 @@ comment on column source.synchro_update_enabled is 'Indique si dans le cadre d''
comment on column source.synchro_undelete_enabled is 'Indique si dans le cadre d''une synchro l''opération ''undelete'' est autorisée.';
comment on column source.synchro_delete_enabled is 'Indique si dans le cadre d''une synchro l''opération ''delete'' est autorisée.';

INSERT INTO SOURCE (ID, CODE, LIBELLE, IMPORTABLE) VALUES (1, 'app', 'Application', false);
--INSERT INTO SOURCE (ID, CODE, LIBELLE, IMPORTABLE) VALUES (2, 'octopus', 'Référentiel Octopus', true);
--INSERT INTO SOURCE (ID, CODE, LIBELLE, IMPORTABLE) VALUES (3, 'apogee', 'Apogée', true);
INSERT INTO SOURCE (CODE, LIBELLE, IMPORTABLE) VALUES ('app', 'Application', false);
--INSERT INTO SOURCE (CODE, LIBELLE, IMPORTABLE) VALUES ('octopus', 'Référentiel Octopus', true);
--INSERT INTO SOURCE (CODE, LIBELLE, IMPORTABLE) VALUES ('apogee', 'Apogée', true);

/*
--
@@ -51,7 +51,7 @@ alter table TABLE_DESTINATION add constraint TABLE_DESTINATION_HD_FK foreign key
-- Tables nécessaires pour l'observation des synchros.
--
create table IMPORT_OBSERV (
    ID serial not null constraint IMPORT_OBSERV_PK primary key,
    ID bigserial not null constraint IMPORT_OBSERV_PK primary key,
    CODE VARCHAR(50) not null constraint IMPORT_OBSERV_CODE_UN unique,
    TABLE_NAME VARCHAR(50) not null,
    COLUMN_NAME VARCHAR(50) not null,
@@ -63,27 +63,26 @@ create table IMPORT_OBSERV (
    constraint IMPORT_OBSERV_UN unique (TABLE_NAME, COLUMN_NAME, OPERATION, TO_VALUE)
);
create table IMPORT_OBSERV_RESULT (
    ID serial not null constraint IMPORT_OBSERV_RESULT_PK primary key,
    ID bigserial not null constraint IMPORT_OBSERV_RESULT_PK primary key,
    IMPORT_OBSERV_ID integer not null constraint IMPORT_OBSERV_RESULT_IOE_FK references IMPORT_OBSERV on delete cascade,
    DATE_CREATION DATE default now() not null,
    source_id bigint not null references source(id),
    SOURCE_CODE VARCHAR(64) not null,
    RESULTAT text not null
);
create sequence IMPORT_OBSERV_ID_SEQ;
create sequence IMPORT_OBSERV_RESULT_ID_SEQ;
/*
-- Exemple :
INSERT INTO IMPORT_OBSERV (ID, CODE, TABLE_NAME, COLUMN_NAME, OPERATION, TO_VALUE, FILTER, DESCRIPTION, ENABLED)
VALUES (nextval('IMPORT_OBSERV_ID_SEQ'), 'RESULTAT_PASSE_A_ADMIS', 'THESE', 'RESULTAT', 'UPDATE', '1', 'ETABLISSEMENT_ID IN (SELECT ID FROM ETABLISSEMENT WHERE SOURCE_CODE = ''UCN'')', 'Le résultat de la thèse passe à 1 (admis)', 1);
INSERT INTO IMPORT_OBSERV (CODE, TABLE_NAME, COLUMN_NAME, OPERATION, TO_VALUE, FILTER, DESCRIPTION, ENABLED)
VALUES ('RESULTAT_PASSE_A_ADMIS', 'THESE', 'RESULTAT', 'UPDATE', '1', 'ETABLISSEMENT_ID IN (SELECT ID FROM ETABLISSEMENT WHERE SOURCE_CODE = ''UCN'')', 'Le résultat de la thèse passe à 1 (admis)', 1);
*/

create table import_log
(
    id bigserial primary key,
    id bigserial constraint import_log_pkey primary key,
    type varchar(128) not null,
    name varchar(128) not null,
    success boolean not null,
    has_problems boolean default false not null,
    log text not null,
    started_on timestamp not null,
    ended_on timestamp not null,