Commit 18e0a9a4 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Scripts SQL pour la version 6.1.2

parent 7239b391
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
@@ -63,6 +63,7 @@ create table IMPORT_OBSERV_RESULT (
    ID NUMBER not null constraint IMPORT_OBSERV_RESULT_PK primary key,
    IMPORT_OBSERV_ID NUMBER not null constraint IMPORT_OBSERV_RESULT_IOE_FK references IMPORT_OBSERV on delete cascade,
    DATE_CREATION DATE default SYSDATE not null,
    source_id NUMBER not null references source(id),
    SOURCE_CODE VARCHAR2(64 char) not null,
    RESULTAT CLOB not null
);
+1 −0
Changes for data/postgresql.sql: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ create table IMPORT_OBSERV_RESULT (
    ID serial 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
);

doc/v6.1.2.md

0 → 100644
+21 −0
Changes for doc/v6.1.2.md: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Version 6.1.2

## SQL

### PostgreSQL

```postgresql
-- Nouvelle colonne import_observ_result.source_id :
alter table import_observ_result add column source_id bigint references source(id);
update import_observ_result ior set source_id = s.id from these t join source s on t.source_id = s.id where t.source_code = ior.source_code;
alter table import_observ_result alter column source_id set not null;
```

### Oracle

```oracle
-- Nouvelle colonne import_observ_result.source_id :
alter table import_observ_result add source_id NUMBER references source(id);
update import_observ_result ior set ior.source_id = (select s.id from these t join source s on t.source_id = s.id where t.source_code = ior.source_code);
alter table import_observ_result modify column source_id not null;
```