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

output entities migration ready + fake data for outputs #305

Merged
merged 10 commits into from
Jul 12, 2021

Conversation

aagm
Copy link
Member

@aagm aagm commented Jun 30, 2021

Migration + fake data for outputs

@aagm aagm requested review from kgajowy and hotzevzl June 30, 2021 17:33
@vercel
Copy link

vercel bot commented Jun 30, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

marxan – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan/GgdUwb4cWFTCp9xjQ8V4LxbbzhFN
✅ Preview: https://marxan-git-chore-apioutput-entities-definition-vizzuality1.vercel.app

marxan-storybook – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/Cy5hdGiDDUMsmYishcozJbiJgDLV
✅ Preview: https://marxan-storybook-git-chore-apioutput-entitie-a1d67e-vizzuality1.vercel.app

@aagm aagm added the WIP Work in progress label Jun 30, 2021
@aagm aagm self-assigned this Jun 30, 2021
Copy link
Contributor

@kgajowy kgajowy left a comment

Choose a reason for hiding this comment

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

  1. Failing tests
  2. We shall keep entities definitions (.entity.ts) accurate at least for columns

Copy link
Member

@hotzevzl hotzevzl left a comment

Choose a reason for hiding this comment

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

thanks @aagm, the data parts look ok, though as Kamil noted we need to sync the entities.

data/notebooks/Lab/marxan_utils.ipynb Outdated Show resolved Hide resolved
ALTER TABLE scenario_features_data
DROP COLUMN target_met;
ALTER TABLE scenario_features_data
ADD COLUMN feature_id SERIAL;
Copy link
Member

Choose a reason for hiding this comment

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

should we make this also PRIMARY KEY for simplicity's sake?

Otherwise we should at least enforce uniqueness across (feature_id, scenario_id), I think

Also, I suggest to avoid calling this feature_id as we are already using these something_id names quite consistently for FKs (or sort of FKs if across dbs) - maybe something like marxan_featureid?

ADD COLUMN run_id int;

ALTER TABLE output_scenarios_pu_data
ADD CONSTRAINT value_out_chk CHECK (value = 0 or value = 1);
Copy link
Member

Choose a reason for hiding this comment

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

do we still need value to be double precision if we constrain it to 0 or 1?

@kgajowy kgajowy force-pushed the chore/api/output-entities-definition branch from f71e729 to 34c7491 Compare July 9, 2021 13:22
@aagm aagm merged commit d4b0611 into develop Jul 12, 2021
@kgajowy kgajowy deleted the chore/api/output-entities-definition branch July 12, 2021 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants