Fix orphaned parts blocking database upgrade

This commit is contained in:
Gregoo 2025-02-10 16:42:23 +01:00
parent 6d70dbdf8b
commit e28ad8b32c
5 changed files with 20 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 1.2.2:
This release fixes a bug where orphaned parts in the `inventory` table are blocking the database upgrade.
## 1.2.1:
This release fixes a bug where you could not add a set if no metadata was configured.

View File

@ -4,6 +4,19 @@ PRAGMA foreign_keys = ON;
BEGIN TRANSACTION;
-- Fix: somehow a deletion bug was introduced in an older release?
DELETE FROM "inventory"
WHERE "inventory"."u_id" NOT IN (
SELECT "bricktracker_sets"."id"
FROM "bricktracker_sets"
);
DELETE FROM "missing"
WHERE "missing"."u_id" NOT IN (
SELECT "bricktracker_sets"."id"
FROM "bricktracker_sets"
);
-- Create a Bricktracker parts table: an amount of parts linked to a Bricktracker set
CREATE TABLE "bricktracker_parts" (
"id" TEXT NOT NULL,

View File

@ -1,4 +1,4 @@
from typing import Final
__version__: Final[str] = '1.2.1'
__version__: Final[str] = '1.2.2'
__database_version__: Final[int] = 15

View File

@ -2,7 +2,7 @@ services:
bricktracker:
container_name: BrickTracker
restart: unless-stopped
image: gitea.baerentsen.space/frederikbaerentsen/bricktracker:1.2.1
image: gitea.baerentsen.space/frederikbaerentsen/bricktracker:1.2.2
ports:
- "3333:3333"
volumes:

View File

@ -2,7 +2,7 @@ services:
bricktracker:
container_name: BrickTracker
restart: unless-stopped
image: gitea.baerentsen.space/frederikbaerentsen/bricktracker:1.2.1
image: gitea.baerentsen.space/frederikbaerentsen/bricktracker:1.2.2
ports:
- "3333:3333"
volumes: