Bug 1393170 - Database Integrity Distro Library distro_activity
Summary: Database Integrity Distro Library distro_activity
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: general
Version: develop
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 25.0
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-09 03:18 UTC by Tyrone Abdy
Modified: 2018-03-19 04:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-19 04:18:41 UTC
Embargoed:


Attachments (Terms of Use)

Description Tyrone Abdy 2016-11-09 03:18:24 UTC
Description of problem:

distro_activity can currently have distro_id nullable which would lead to orphaned activity items if a distro was deleted.

Within the migration script a deletion of orphaned data could be required as there was the possibility of it to happen.

Comment 1 Roman Joost 2016-12-13 23:48:23 UTC
Ideas:

* Change the column to be not nullable and run tests.
* Fix the fallout. Will probably need a migration script.

If it's too much, it's probably better to comment here.

Comment 2 Dan Callaghan 2017-12-20 05:15:54 UTC
Looking at a recent snapshot of our prod database:

MySQL [beaker_dcallagh]> select count(*) from distro_activity where distro_id is null;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.01 sec)

So I am confident we have not had any bugs in the past which have allowed distro rows to be deleted or distro_activity rows to become orphaned. Therefore I think we can safely make distro_activity.distro_id non-NULLable.

Comment 3 Dan Callaghan 2017-12-20 05:32:32 UTC
https://gerrit.beaker-project.org/5956

Comment 5 Dan Callaghan 2018-01-10 03:28:09 UTC
There is no expected change in behaviour here, so verification should just be that the database migration succeeds (it did) and that nothing else breaks.

Comment 7 Roman Joost 2018-03-19 04:18:41 UTC
Beaker 25.0 has been released.

Release notes are available upstream: https://beaker-project.org/docs/whats-new/release-25.html


Note You need to log in before you can comment on or make changes to this bug.