Skip to content
Snippets Groups Projects
Select Git revision
  • b708977da6a67db3e8cf27adfe9f529b145b3e80
  • main default protected
  • 2301.4.x protected
  • 24.4.x protected
  • 24.3.x
  • 24.0.x
  • 24.x.x
  • 2301.x.x protected
  • 2301.3.x
  • 21.03 protected
  • 2301.2.x
  • 20.03 protected
  • 20.10 protected
  • 19.04 protected
  • 18.10 protected
  • 18.04 protected
  • 17.06 protected
  • CMIS
  • 2301.4.8
  • 24.4.3
  • 24.3.3
  • 2301.4.7
  • 2301.4.6
  • 2301.4.5
  • 2301.4.4
  • 24.0.2
  • 2301.4.3
  • 2301.4.2
  • 2301.4.1
  • 2301.4.0
  • 2301.3.7
  • 2301.3.6
  • 21.03.33
  • 2301.3.5
  • 2301.3.4
  • 2301.3.3
  • 2301.3.2
  • 2301.3.1
38 results

database.component.ts

Blame
  • delete_all_ressources.sql 2.01 KiB
    /* Warning : This script erase all data in the application Maarch. It keeps in database parameters */
    
    TRUNCATE TABLE listinstance;
    ALTER SEQUENCE listinstance_id_seq restart WITH 1;
    
    TRUNCATE TABLE listinstance_history;
    ALTER SEQUENCE listinstance_history_id_seq restart WITH 1;
    
    TRUNCATE TABLE listinstance_history_details;
    ALTER SEQUENCE listinstance_history_details_id_seq restart WITH 1;
    
    TRUNCATE TABLE history;
    ALTER SEQUENCE history_id_seq restart WITH 1;
    
    TRUNCATE TABLE history_batch;
    ALTER SEQUENCE history_batch_id_seq restart WITH 1;
    
    TRUNCATE TABLE notes;
    ALTER SEQUENCE notes_id_seq restart WITH 1;
    
    TRUNCATE TABLE note_entities;
    
    TRUNCATE TABLE res_letterbox;
    ALTER SEQUENCE res_id_mlb_seq restart WITH 1;
    
    TRUNCATE TABLE res_attachments;
    ALTER SEQUENCE res_attachment_res_id_seq restart WITH 1;
    
    TRUNCATE TABLE adr_letterbox;
    ALTER SEQUENCE adr_letterbox_id_seq restart WITH 1;
    
    TRUNCATE TABLE adr_attachments;
    ALTER SEQUENCE adr_attachments_id_seq restart WITH 1;
    
    TRUNCATE TABLE res_mark_as_read;
    
    TRUNCATE TABLE saved_queries;
    TRUNCATE TABLE lc_stack;
    
    TRUNCATE TABLE tags;
    ALTER SEQUENCE tags_id_seq restart WITH 1;
    
    TRUNCATE TABLE resources_tags;
    
    TRUNCATE TABLE emails;
    
    TRUNCATE TABLE notif_event_stack;
    ALTER SEQUENCE notif_event_stack_seq restart WITH 1;
    
    TRUNCATE TABLE notif_email_stack;
    ALTER SEQUENCE notif_email_stack_seq restart WITH 1;
    
    TRUNCATE TABLE user_signatures;
    ALTER SEQUENCE user_signatures_id_seq restart WITH 1;
    
    TRUNCATE TABLE acknowledgement_receipts;
    ALTER SEQUENCE acknowledgement_receipts_id_seq restart WITH 1;
    
    TRUNCATE TABLE emails;
    ALTER SEQUENCE emails_id_seq restart WITH 1;
    
    TRUNCATE TABLE shippings;
    ALTER SEQUENCE shippings_id_seq restart WITH 1;
    
    
    /* reset chrono */
    UPDATE parameters SET param_value_int = '1' WHERE id = 'chrono_outgoing_' || extract(YEAR FROM current_date);
    UPDATE parameters SET param_value_int = '1' WHERE id = 'chrono_incoming_' || extract(YEAR FROM current_date);
    UPDATE parameters SET param_value_int = '1' WHERE id = 'chrono_internal_' || extract(YEAR FROM current_date);