-
Notifications
You must be signed in to change notification settings - Fork 15
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
Link Planter Organization-id to Organization Map #5
Comments
organization should be linked to trees, not via user. However this can happen when trees are uploaded - if a user is part of an org, then this can be copied to the trees. We can also make scripts to retroactively assign trees in orgs when you update the user with their organization id. |
Exactly. Let's leave the retroactive script out for now. If the |
And this is always the planting organization right? The trees will need a column 'planting_organization_id' |
yes |
Are we able to close this one? I think so |
Notes from Slack for Refreence... _The planting_organizations_id in the trees table is not pulling from the entity table, it is linked to the organization table? Ezra 2 hours ago Mark 2 hours ago Mark 2 hours ago Mark 2 hours ago Ezra 1 hour ago Mark 1 hour ago Ezra 1 hour ago Mark 1 hour ago Mark 1 hour ago Ezra 1 hour ago DavidezrajayDavidezrajay
Mark 1 hour ago So the ticket should actually say something like: It is almost like we thought about this one before #4 https://github.com/Greenstand/treetracker-database|Greenstand/treetracker-databaseGreenstand/treetracker-database |
@deepwinter (or anyone else) - Can you give a little technical insight on this being feasible or the best way to go about it. Goal: To have a map that will automatically show the amount of trees on the map that organization has planted. Possible Solutions There are plenty of ways on doing this. I am open to whatever is going to work best. Just wanted to put the idea out there before I started working on it. |
planting_organization_id can be populated during the initial INSERT into the trees table. We look up the planter by their identifier to get their user id, so we have their planting org id also IF it has been populated. how do you want to handle this if planting_organization_id has not been populated yet on a planter record? planting org id will be null, or we could flag that each tree with a new field to or planting org id (-1 ? ) to indicate that the planter did not have an org assigned. |
Ya.. I think that assigning the planter_organization_id something like -1 or 0 would be the best. The concern with NULL would be that since the initial INSERT is done for every line item that is populated, then if a change is made to the organization_id on the planter_table would not change the planter_organization_id on tree_table. In order to do this we would have to made a update trigger. Although, I think I'll start with the initial INSERT on the tree_table and see things are after. |
The organization map should be driven from the planter's organzition_id.
Suggestions:
Every tree should be nested under an organization _id.... manually populated (user_id, or device_id, or another table).
It is manually populated because users often spell their organization incorrectly or often add organizations that do not exist.
All trees that are assigned under the organization_id show up under the map www.treetracker.org/?organization='X'
Possible Problems:
The text was updated successfully, but these errors were encountered: