README
Postgre Installer
MyUnisoft PostgreSQL database installer.
Requirements
- Node.js version 12 or higher
Getting Started
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i @myunisoft/postgre-installer
# or
$ yarn add @myunisoft/postgre-installer
Environment Variables
To configure the project you have to register (set) environment variables on your system. These variables can be set in a .env file (that file must be created at the root of the project).
MYUNISOFT_DB_HOST= localhost
MYUNISOFT_DB_PORT= 5432
MYUNISOFT_DB_USER= postgres
MYUNISOFT_DB_PASSWORD=
MYUNISOFT_DB_NAME= postgres
MYUNISOFT_DB_SYNCHRONIZE= true
MYUNISOFT_DB_LOGGING= true
TODO
- Should we switch a lot of bigint field to integer ? (PrimaryGeneratedColumn set integer by default)
- Check if we need to change
@Column("varchar", { length: 1 })
to@Column("character")
? (eg: sch*/membre.ts) - Irregular table nomenclature
- mess_test_
- No PK in table (added because of typeorm error)
- keyValue
- monitoring
- l_doc_immo
- l_entry_entry
- all boolean seems to be nullable. Need to find a way to assign a default value ?
- Foreign key relation certification
- sch_global marqueBlanche and GroupeMembre (OneToOne or OneToMany/ManyToOne)
- sch*.building -> sch*.Axe (OneToOne or OneToMany/ManyToOne)
- sch*.communaute
- sch*.compte
- sch*.coordonnee_society
- sch*.droit
- sch*.echeance -> sch*.ligneEcriture (OneToOne or OneToMany/ManyToOne)
- sch*.emprunt -> sch*.ligneEcriture (OneToOne or OneToMany/ManyToOne)
- sch*.envoi_edi_attente
- sch*.etablissement -> sch*.societe (maybe OneToMany/ManyToOne)
- sch*.etat_ligne_discu -> sch*.ligne_discu (maybe OneToMany/ManyToOne)
- sch*.etat_mensuel_salarie
- sch*.facture_ocr (missing FK)
- sch*.histo_modif_ligne_discu
- sch*.historique_coffre
- sch*.html_edited (missing FK on id_dossier_revison)
- sch*.html_edited -> sch*.html_model (OneToOne or OneToMany/ManyToOne)
- sch*.iban_compte_tiers (maybe OneToOne)
- sch*.infoCompteTiers -> sch_global.amount_type_paid
- sch*.invitation
- sch*.justification -> sch*.diligence (OneToOne or OneToMany/ManyToOne)
- sch*.justification -> sch*.l_dossier_revision_compte (OneToOne ?)
- sch*.justification_line -> sch*.ligne_ecriture (OneToOne or OneToMany/ManyToOne)
- sch*.l_building_type
- sch*.l_calculis_ecriture
- sch*.l_comment_worksheet (missing FK on id_worksheet ?)
- sch*.l_diary_account
- sch*.l_discu_etiq_pers_physique
- sch*.l_doc_absence
- sch*.l_doc_ecriture_temp -> sch*.ecriture_temp (OneToOne or OneToMany/ManyToOne)
- sch*.l_doc_ligne_discu -> sch*.ligne_discu
- sch*.l_doc_ligne_ecriture -> sch*.ligne_ecriture (OneToOne or OneToMany/ManyToOne)
- sch*.l_doc_ligne_ecriture_temp -> sch*.ligne_ecriture_temp (OneToOne or OneToMany/ManyToOne)
- sch*.l_doc_ligne_rb -> sch*.ligne_rb (OneToOne or OneToMany/ManyToOne)
- sch*.l_doc_ligne_rem_banque -> sch*.ligne_rem_banque (OneToOne or OneToMany/ManyToOne)
- sch*.l_doc_pending (missing FK on id_pers_physique / id_societe / id_type_facture ? Check all FK !)
- sch*.l_doc_user_expense
- sch*.letter
- missing FK on id_dossier_revision / recipient_type / sender_type
- send_at (OneToOne or OneToMany/ManyToOne)
- sch*.ligne_ecriture_section_temp
- sch*.ligne_rb (no FK on id_transaction_qonto ?)
- sch*.l_ligne_discu_etiq_pers_physique
- sch*.l_ligne_discu_tag
- sch*.l_ligne_ecriture_axe
- sch*.l_ligne_ecriture_axe_temp
- sch*.l_param_account_worksheet_dossier_revision (no FK on id_dossier_revision)
- sch*.l_param_general_societe
- sch*.l_token_pers_physique -> sch*.login_logs (OneToOne or OneToMany/ManyToOne)
- sch*.l_user_memo
- sch*.main_principal
- sch*.membre (no FK on id_groupe_membre / id_organisation / id_status_souhait_coffre)
- sch*.memo_test_ -> sch*.societe
- sch*.metadata_partners (no FK on id_entry_origin_partner)
- sch*.notification
- sch*.pers_physique (OneToOne or OneToMany/ManyToOne)
- id_subject (remove or asign FK ?)
- sch*.oauth_tokens (no FK ?)
- sch*.owncloud_historique (empty ?)
- sch*.paiement_teledeclaration -> sch*.teledeclaration (OneToOne or OneToMany/ManyToOne)
- sch*.paragraph -> sch_global_paragraph
- sch*.param_account_worksheet (2 FK not removed)
- sch*.param_diligence (missing FK for id_type_formule_condition / id_base_calcul_echeance)
- sch*.param_etalon_tiers
- sch*.param_vat_groupe_membre (mission account id FK ?)
- sch*.parent_traites
- sch*.pers_physique
- remove civilite text field ? (to have possibility with relation variable. ex: Civilite)
- id_tel_fix (OneToOne or OneToMany/ManyToOne)
- id_tel_portable (OneToOne or OneToMany/ManyToOne)
- id_member
- id_salarie
- How to manage RELATION with sch*.coord_pers_physique ?
- sch*.rem_banque -> sch*.journal (OneToOne or OneToMany/ManyToOne)
- sch*.return_result (WTF is this table ?)
- sch*.societe
- id_agenda_ocr (no FK)
- id_sie (all null)
- id_compte_rb (all null)
- id_budget_insight (no FK)
- id_vat_type_regime (only one line)
- id_vat_exigibility (only one line)
- id_doc_logo (all null)
- id_doc_footer (only one line)
- id_organisation (utility ?)
- id_document (only one line)
- sch*.society_array (removed ?)
- sch*.suiviOcr -> sch*.type_facture (missing FK)
- sch*.temps -> sch*.exercice (OneToOne or OneToMany/ManyToOne)
- sch*.tva -> sch*.type_tva (OneToOne or OneToMany/ManyToOne)
- sch*.user_expense (review all table)
- sch*.worksheet (missing FK on id_account_ht ?)
- lot a l_* tables seems to not have conbinated unique constraint
- PK and unique ?
- l_ligne_discu_tag
- Seed to come back on
- sch_global.sheet*
- sch_global.reset_token
- sch_global.quickbooks_company_tokens
- sch_global.param_compte_ape
- sch_global.oga
- sch_global.monitoring
- sch_global.millesime
- sch_global.ligne_cycle
- sch_global.banque_partenaire
- sch_global.admin_message
- Try to make a real clone_schema sql function which clone sch with:
- table
- sequence
- constraints (FK, Unique)
- table owner ?
- create function on Import is different from others
createImport
becauseimport
is a reserved name