Closed gonzalezeb closed 6 years ago
@gonzalezeb,
Here is what I think the process would look like. It seems more difficult to explain than to do. Hopefully what I say here makes sense, but it might be better to practice with a tiny, dummy database with the most important columns and 2-3 rows (e.g. table site
with columns site
and equation_id
, and table equations
with columns equation_id
and equation_allometry
).
If you add a new site, you would add a row in the sites table (sitespecies
I believe?).
1.1. If that new site uses an equation_allometry
that already exists in the equations
table, then in the sites table add the equation_id
corresponding to the relevant equation_allometry
(which lives in the equations
table).
1.2. If that new site uses a new equation_allometry
-- i.e. not already in the equations
table -- then you would add a new row in the equations
table: Populate the column equation_allometry
with whatever you get from the literature, and populate the column equation_id
with a random id from data-raw/available_random_ids.csv
(here). (Remove each id that you pick, so you don't assign the same id to two different equations).
If you add a new equation for an already existing site, then the equations
table gets a new row as in 1.2.. And the sites table also gets a new row, where the value for the column equation_id
matches the equation_id
correponding to the relevant equation_allometry
in the equaitons
table.
Again, I'm afraid my explanation might be unclear or my rationale wrong. Best to practice and check we got it rigth. We could meet online if you want, and try a few things together.
Sorry, I closed accidentally.
Closing because this has been already discussed and we are ok.
How do I generate a new equation_id at the same time that I am:
This is a direct question for @maurolepore