This command is used to garbage collect the xfstestsdb sqlite database.
It removes xfstests runs that have no added xunits, and runs older than
180 days that have not been tagged.
Implements: #16 (`xfstestsdb gc`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
I found that deleting an xunit from the database was very, very slow.
This patch addresses the issue by adding additional indexes on the
link_xunit_properties table to make it easier to find properties that
are still in use. I also rework the `cleanup_xunit_properties` trigger
to only check propids that were used by the deleted xunit.
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
I found that deleting an xunit from the database was very, very slow.
This patch addresses the issue by adding additional indexes on the
testcases table to make it easier to find messages that are still in
use. I also rework the `cleanup_testcase_messages` trigger to only check
messageids that were used by the deleted testcase.
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
Right now it doesn't do any extra changes to the database besides
bumping the user_version to '2'. I'll fill it out over the next several
commits.
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This function builds on the built-in Python function, and adds in
opening and reading the file in a way that can be used for running
generic scripts on the database.
I also take this chance to move SQL scripts into a subdirectory to keep
them together.
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>