-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[db] Remove Bug model, replace with LinkReference. Closes #1029
tracking bugs will be performed linking to their URLs instead of keeping a reference to their ID and trying to construct the URL on the fly. Obsoletes #320
- Loading branch information
Showing
8 changed files
with
63 additions
and
70 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from django.db import migrations | ||
|
||
|
||
def forward_copy_data(apps, schema_editor): | ||
Bug = apps.get_model('testcases', 'Bug') | ||
LinkReference = apps.get_model('linkreference', 'LinkReference') | ||
|
||
for bug in Bug.objects.all(): | ||
LinkReference.objects.create( | ||
execution_id=bug.case_run_id, | ||
name="%s %s" % (bug.bug_system.name, bug.bug_id), | ||
url=bug.bug_system.url_reg_exp % bug.bug_id, | ||
is_defect=True, | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('testcases', '0009_populate_missing_text_history'), | ||
('linkreference', '0002_update_fields'), | ||
] | ||
|
||
operations = [ | ||
# copy the data from the related model | ||
migrations.RunPython(forward_copy_data), | ||
|
||
migrations.DeleteModel( | ||
name='Bug', | ||
), | ||
] |
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
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
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
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
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
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