forked from coderholic/django-cities
-
Notifications
You must be signed in to change notification settings - Fork 126
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
switching foreign key to a more universal and unique id which is geon… #290
Open
abderraxim
wants to merge
3
commits into
yourlabs:master
Choose a base branch
from
abderraxim:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ame_id as local id would mess up the related data on other models if database repopulation
Interesting but doesn't this also require a data migration?
Le ven. 7 juin 2024, 22:25, NABIH Abderrahim ***@***.***> a
écrit :
… …ame_id as local id would mess up the related data on other models if
database repopulation
------------------------------
You can view, comment on, or merge this pull request online at:
#290
Commit Summary
- 818f733
<818f733>
switching foreign key to a more universal and unique id which is geoname_id
as local id would mess up the related data on other models if database
repopulation
File Changes
(2 files <https://github.com/yourlabs/django-cities-light/pull/290/files>)
- *M* src/cities_light/abstract_models.py
<https://github.com/yourlabs/django-cities-light/pull/290/files#diff-c27f7450a6aad926c88514ebb6c1c28d1c4b9ba05a4423e6dd32537f32dd069f>
(12)
- *M* src/cities_light/management/commands/cities_light.py
<https://github.com/yourlabs/django-cities-light/pull/290/files#diff-ecc390657d9b9b8038c4067f01edbed214bee5b99b90716c7b440ac60ab63704>
(8)
Patch Links:
- https://github.com/yourlabs/django-cities-light/pull/290.patch
- https://github.com/yourlabs/django-cities-light/pull/290.diff
—
Reply to this email directly, view it on GitHub
<#290>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAXDLBRP6IXOLK4JZ6HK33ZGIJLRAVCNFSM6AAAAABI7IKTSGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM2DCMJRGEYTAMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Yes indeed ,i will do that later |
In such situation, I've found useful to divide the migration in 3
operations:
- creating a new column
- copying the data
- dropping the old column
It would be interesting to know how long such a migration can take
Le dim. 9 juin 2024, 19:25, NABIH Abderrahim ***@***.***> a
écrit :
… Yes indeed ,i will do that later
—
Reply to this email directly, view it on GitHub
<#290 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAXDLBODEMCJ6WCYYE2OXDZGSFZPAVCNFSM6AAAAABI7IKTSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWG4YDOOBYGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
pardon me but i don't get the idea, if we're just switching to another key column , i'm not replacing the id key generated, but just defining the column to rely on |
Yes but what happens to the existing data which relies on the old column?
Don't the Fks need to be migrated?
Le lun. 10 juin 2024, 00:34, NABIH Abderrahim ***@***.***> a
écrit :
… pardon me but i don't get the idea, if we're just switching to another key
column , i'm not replacing the id key generated, but just defining the
column to rely on
—
Reply to this email directly, view it on GitHub
<#290 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAXDLBHIKP6JLY5GV372T3ZGTJ7XAVCNFSM6AAAAABI7IKTSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJWHAYTSNRRHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
they should implement the migration or they can just explicitly specify the to_field and continue with the old model
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…ame_id as local id would mess up the related data on other models if database repopulation