Skip to content
Snippets Groups Projects
Select Git revision
  • 7436e185c8484e48b4161e11b47d3fce8d463516
  • master default protected
  • b24
  • ll-wf-finitions
  • ll-workflow
  • alc-scindage-donnees-pj
  • FJ_LL_Tbl_Contrat
  • alc-docker-node
  • ll-apiplatform
  • php84
  • ll-rgpd
  • b23
  • alc-filtre-type-intervenant
  • ll-sans-mdb5
  • formules-ancienne-infra
  • ll-formules
  • alc-intervenant-dmep
  • ll-suppr-v_vol-s
  • b20
  • ll-postgresql
  • b23.0.1
  • 24.10
  • 24.9
  • 24.8
  • 24.7
  • 24.6
  • 24.5
  • 24.4
  • 24.3
  • 24.2
  • 24.1
  • 24.0
  • 23.15
  • 24.0-beta19
  • 24.0-beta18
  • 24.0-beta17
  • 24.0-beta16
  • 24.0-beta15
  • 24.0-beta14
  • 24.0-beta13
  • 23.14
41 results

NewEntityService.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    03_insert_bootstrap_data.sql 2.88 KiB
    --
    -- BOOTSTRAP
    --
    
    --
    -- Sources de données ESUP-SyGAL.
    --
    delete from source where code = 'SYGAL::sygal'
    ;
    insert into source (id, code, libelle, importable)
    values (1, 'SYGAL::sygal', 'ESUP-SyGAL', false)
    ;
    
    --
    -- Pseudo-utilisateur 'sygal-app'.
    --
    delete from utilisateur where username = 'sygal-app'
    ;
    insert into utilisateur (id, username, display_name, password)
    values (1, 'sygal-app', 'Application ESUP-SyGAL', 'ldap')
    ;
    
    --
    -- Rôles multi-établissements.
    --
    delete from role where source_code in ('ADMIN_TECH', 'OBSERV')
    ;
    insert into role (id, code, libelle, source_code, source_id, role_id, these_dep, histo_createur_id, histo_modificateur_id)
      values (1, 'ADMIN_TECH', 'Administrateur technique', 'ADMIN_TECH', 1, 'Administrateur technique', false, 1, 1)
    ;
    insert into role (id, code, libelle, source_code, source_id, role_id, these_dep, histo_createur_id, histo_modificateur_id)
      values (2 /*241*/, 'OBSERV', 'Observateur', 'OBSERV', 1, 'Observateur', false, 1, 1)
    ;
    
    -- drop sequence INDIVIDU_ID_SEQ;
    -- drop sequence UTILISATEUR_ID_SEQ;
    -- drop sequence STRUCTURE_ID_SEQ;
    -- drop sequence ETABLISSEMENT_ID_SEQ;
    -- CREATE SEQUENCE  "INDIVIDU_ID_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 NOORDER  NOCYCLE ;
    -- CREATE SEQUENCE  "UTILISATEUR_ID_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 NOORDER  NOCYCLE ;
    -- CREATE SEQUENCE  "STRUCTURE_ID_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 NOORDER  NOCYCLE ;
    -- CREATE SEQUENCE  "ETABLISSEMENT_ID_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 NOORDER  NOCYCLE ;
    
    --
    -- L'établissement inconnu.
    --
    delete from etablissement where source_code  = 'ETAB_INCONNU'
    ;
    delete from structure where source_code  = 'ETAB_INCONNU'
    ;
    insert into structure(id, libelle, type_structure_id, histo_createur_id, histo_modificateur_id, source_id, source_code, code)
    select nextval('structure_id_seq'),
           'Établissement inconnu',
           1, -- type etab
           1, 1,
           1, -- source sygal
           'ETAB_INCONNU', -- source code unique
           'INCONNU' -- code
    ;
    insert into etablissement(id, structure_id, histo_createur_id, histo_modificateur_id, source_id, source_code)
    select nextval('etablissement_id_seq'),
           currval('structure_id_seq'),
           1, 1,
           1, -- source sygal
           'ETAB_INCONNU' -- source code unique, idem structure
    ;
    
    -- --
    -- -- Avance de sequences.
    -- --
    -- declare
    --   maxid integer;
    --   seqnextval integer;
    -- begin
    --   select max(id) into maxid from UTILISATEUR;
    --   LOOP
    --     select nextval('UTILISATEUR_ID_SEQ') into seqnextval from dual;
    --     EXIT WHEN seqnextval >= maxid;
    --   END LOOP;
    -- end;
    --
    -- declare
    --   maxid integer;
    --   seqnextval integer;
    -- begin
    --   select max(id) into maxid from ROLE;
    --   LOOP
    --     select nextval('ROLE_ID_SEQ') into seqnextval from dual;
    --     EXIT WHEN seqnextval >= maxid;
    --   END LOOP;
    -- end;