Don't rely on SQL files for migration patches as their existence is not guaranteed

This commit is contained in:
Gregoo 2025-01-30 12:56:14 +01:00
parent 6e0c4775d1
commit 26d4860bcc

View File

@ -5,8 +5,10 @@ if TYPE_CHECKING:
# Grab the list of checkboxes to create a list of SQL columns # Grab the list of checkboxes to create a list of SQL columns
def migration_0007(self: 'BrickSQL', /) -> dict[str, Any]: def migration_0007(sql: 'BrickSQL', /) -> dict[str, Any]:
records = self.fetchall('checkbox/list') # Don't realy on sql files as they could be removed in the future
sql.cursor.execute('SELECT "bricktracker_set_checkboxes"."id" FROM "bricktracker_set_checkboxes') # noqa: E501
records = sql.cursor.fetchall()
return { return {
'sources': ', '.join([ 'sources': ', '.join([