Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETL job to migrate an organization from prod database to test and dev database #8

Open
dadiorchen opened this issue Sep 4, 2023 · 5 comments · Fixed by #11
Open
Assignees
Labels
ETL good first issue Good for newcomers

Comments

@dadiorchen
Copy link
Contributor

dadiorchen commented Sep 4, 2023

We need a function/job/command to incrementally transport the data in our prod database that belongs to a specified organization on Greenstand, and do some transform, then dump into our dev database.

The data need to be transported are:

  • New planter under the org
  • New capture belongs to the org
  • New species created by these tree.
    *New token minted on capture above.
    * Wallet that occupy token above.

Language, could by Python or Node.js.

@dadiorchen dadiorchen added the help wanted Extra attention is needed label Sep 4, 2023
@dadiorchen dadiorchen changed the title ELT job to migrate an organization from prod database to test database ETL job to migrate an organization from prod database to test database Sep 4, 2023
@dadiorchen dadiorchen added good first issue Good for newcomers ETL and removed help wanted Extra attention is needed labels Sep 4, 2023
@dadiorchen dadiorchen changed the title ETL job to migrate an organization from prod database to test database ETL job to migrate an organization from prod database to test and dev database Sep 22, 2023
@Xinyihe123
Copy link

I'll work on this one.

@dadiorchen dadiorchen moved this from 🌱 Backlog to 🏗️ In Progress in Web map app with V2 (the new DB) Sep 22, 2023
@dadiorchen dadiorchen moved this from Backlog to In-progress in Denormalized Data Service Sep 25, 2023
@github-project-automation github-project-automation bot moved this from 🏗️ In Progress to 🎉 Done in Denormalized Data Service Oct 27, 2023
@dadiorchen dadiorchen reopened this Nov 25, 2023
@dadiorchen dadiorchen moved this from 🎉 Done to 🏗️ In Progress in Denormalized Data Service Nov 25, 2023
@jersey1dev
Copy link

I will take up the task of adding additional functionalities for this issue.

@dadiorchen dadiorchen moved this from 🏗️ In Progress to 🌱 Backlog in Denormalized Data Service Feb 9, 2024
@dadiorchen dadiorchen moved this from 🌱 Backlog to 🏗️ In Progress in Denormalized Data Service Feb 22, 2024
@dadiorchen
Copy link
Contributor Author

@Ayansola Akanmu question:
image

Answer:

  1. organzations has been deprecated, the organization info is saved in this way: entity table and type column equal to O (letter o) so the organzation_id in table planter is linked to this entity table by primary key id.
  2. planters table is deprecated, the planter is valid. As an individual planter ( comparing to planter owned by organization), its organization_id is NULL, so that's fine.
  3. To find the tree belongs to an org, we need: join trees.planter_id with planter.id, join planter.organzation_id with entity.id

There are some chaos, one reason is that the dev db is tweaked by devs from time to time, and we need to do some clean up, another reason is we are not going to maintain this table because we are migrating to new db domain, those table in new domain is arranged by schema, you can find them on all those schema for example reporting

@sole1907
Copy link

thanks @dadiorchen - I'll work on this issue

@dadiorchen dadiorchen moved this from 🏗️ In Progress to 🐞 In Review in Web map app with V2 (the new DB) Mar 26, 2024
@dadiorchen dadiorchen moved this from 🐞 In Review to 🏗️ In Progress in Web map app with V2 (the new DB) Mar 26, 2024
@dadiorchen
Copy link
Contributor Author

to Shikhar Sharma:
The goal is to copy trees under specified org to dev db, the tree data is in trees table, but you need to filter the data by org because it is too many.
The relationship is:
trees.planter_id --> planter.id
planter.organization_id --> entity.id

so we specify a entity/org id, say, 123 in the script, then we will copy all the data in planter that belongs to org 123, and all the trees that belongs to all the planters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ETL good first issue Good for newcomers
Projects
Status: 🏗️ In Progress
Status: 🏗️ In Progress
Development

Successfully merging a pull request may close this issue.

4 participants