-
Notifications
You must be signed in to change notification settings - Fork 0
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
PB-1405: Split bod_migrate command #69
Conversation
Add field external_id to provider that is populated by the attribution field in BOD. Field can be used as external id e.g. in url paths. It is not null and unique, which is why db migration is done in 3 steps to populate the column with default values.
Add field external_id to attribution that is populated by the attribution field in BOD. Field can be used as external id e.g. in url paths. It is not null and unique, which is why db migration is done in 3 steps to populate the column with default values.
Use slug for provider and attribution to be consistent with dataset.
Add slug in json api response of provider and attribution. Adapt test cases for slug.
Add flags to bod_migration command to migrate providers, attributes and datasets independently. Add slug and only migrate "top-level" providers. Link multiple attributions to single provider based on slug.
Nice! Looks good in general, some thoughts:
|
Add more test cases for bod_migrate command with only some of the flags set.
Thanks for the input. I added more test cases. I also think the name |
Data has been cleaned in bod DB, so no longer need special check.
As mentioned in https://jira.swisstopo.ch/browse/PB-1405, BOD database has been cleaned, now all providers, attributions and datasets can be synced as expected. |
Model changes
Add field
slug
to providers and attributions. This field is non-null and unique. This allows it to be used in the url path to identify resources. It is not null and unique, which is why db migration is done in 3 steps to populate the column with default values.Command changes
Add flags to management command
bod_migrate
to control which data should be migrated.Added flags are
--providers
,--attributions
,--datasets
. They can also be combined to migrate them at the same time. Beware that--clear
will still clear all the migrated data.Currently there are 4 providers that can't be migrated:
ch.astra
.
Currently cannot migrate the following attribution as there is no provider
ch.kanton
.ch.kantone
The following datasets could not be migrated:
ch.kantone
sss
swisstopo + ENSI
sss
ASTRA, BPUK
ASTRA, BPUK
ASTRA, BPUK
Actions