Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Modifying 'priorities' table in testrail database


#1

I’m interested in changing the priorities levels and labels for our needs; currently it looks like this:

mysql> select * from priorities;
±—±---------±-----------------±------------±-----------+
| id | priority | name | short_name | is_default |
±—±---------±-----------------±------------±-----------+
| 1 | 1 | 1 - Don’t Test | 1 - Don’t | 0 |
| 2 | 2 | 2 - Test If Time | 2 - If Time | 0 |
| 3 | 3 | 3 - Test If Time | 3 - If Time | 0 |
| 4 | 4 | 4 - Must Test | 4 - Must | 1 |
| 5 | 5 | 5 - Must Test | 5 - Must | 0 |
±—±---------±-----------------±------------±-----------+

I’d like to remove rowid 4 & 5, rename the remaining 3, and make id3 be the default. It would look something like this:

±—±---------±-----------------±------------±-----------+
| id | priority | name | short_name | is_default |
±—±---------±-----------------±------------±-----------+
| 1 | 1 | 1 - Low | 1 - Low | 0 |
| 2 | 2 | 2 - Medium | 2 - Medium | 0 |
| 3 | 3 | 3 - High | 3 - High | 1 |
±—±---------±-----------------±------------±-----------+

Would this be safe to do without having any negative effects on the application or the schema?

Thanks,
Matt


#2

Hi Matt,

Thanks for your message. As you already noticed, we don’t yet have an UI to configure the priorities within TestRail, but we designed the application and database to allow this. We are not 100% sure if we will keep the priorities as-is or if we migrate them to the upcoming custom fields functionality.

For now it is safe to rename/change the priorities, but I cannot guarantee that all future updates will work flawlessly if you delete existing entries. We will probably take changes of the table into account if/when we migrate the priorities to custom fields, but I cannot guarantee it at this point (it is very likely that we will document any issues in our update change logs though, so you can take actions to fix this before doing the upgrade).

If you want to delete some of the existing priority entries, you need to make sure that none of your existing test cases reference one of the deleted entries.

Regards,
Dennis


#3

Thanks for the quick reply. I figured I probably can’t have any test cases reference the deleted priority id’s. Perhaps a more reliable solution (as far as future upgrades go) would be to only change the names for priority labels as follows:

±—±---------±-----------------±------------±-----------+
| id | priority | name | short_name | is_default |
±—±---------±-----------------±------------±-----------+
| 1 | 1 | 1 - Low | 1 - Low | 0 |
| 2 | 2 | 2 - Medium | 2 - Medium | 0 |
| 3 | 3 | 3 - High | 3 - High | 1 |
| 4 | 4 | - | - | 0 |
| 5 | 5 | - | - | 0 |
±—±---------±-----------------±------------±-----------+


#4

Hi Matt,

Absolutely, this would work much better.

Regards,
Dennis