Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

chore: exporte la base de données au format json #689

Merged
merged 4 commits into from
Mar 16, 2021
Merged

chore: exporte la base de données au format json #689

merged 4 commits into from
Mar 16, 2021

Conversation

NeoBahamut
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Mar 10, 2021

Codecov Report

Merging #689 (86badde) into master (ca7c2b3) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #689   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           77        77           
  Lines         1974      1974           
  Branches       419       419           
=========================================
  Hits          1974      1974           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca7c2b3...86badde. Read the comment docs.

Copy link
Contributor

@francoisromain francoisromain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on a besoin de

  • supprimer le dossier sources si il existe
  • dropper toutes les tables de la base de données
  • ensuite npm run db:init doit fonctionner à partir du nouveau dossier sources

@NeoBahamut
Copy link
Contributor Author

@NeoBahamut NeoBahamut changed the title [WIP] tooling: exporte les tables identifiées dans /sources au format json [WIP] tooling: exporte la base de données au format json Mar 15, 2021
return field[key]
}

const camelToSnakeCase = (field: string) =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je crois qu’on l’a déjà ça, @francoisromain ?

})

for (const tableName of tablesNames) {
const jsonFileName = `${tableName.replace(/_/g, '-')}.json`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je crois qu’on a déjà un utilitaire pour ça, @francoisromain ?

field
)

const main = () => databaseToJsonExport()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T’as pas un pb avec le async/await ?

databaseToJsonExport() .then(() => { process.exit() }) .catch(() => { process.exit(1) })

@francoisromain francoisromain changed the title [WIP] tooling: exporte la base de données au format json chore: exporte la base de données au format json Mar 15, 2021
@francoisromain francoisromain marked this pull request as ready for review March 15, 2021 17:12
Copy link
Contributor

@francoisromain francoisromain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ce serait bien de faire le singleton knex avant de merger cette PR. @vmaubert

il est utilisé ici : https://github.com/MTES-MCT/camino-api/pull/689/files#diff-1db3872c94f6300144a0f207a1739031e79bfea3125bd0b78dd44a23e0ea7f3dR26

@vmaubert vmaubert merged commit 50c6110 into MTES-MCT:master Mar 16, 2021
@NeoBahamut NeoBahamut deleted the tool-export-tables-json branch March 16, 2021 09:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants